当前位置:网站首页>sns_ sensor_ instance_ api
sns_ sensor_ instance_ api
2022-07-23 17:35:00 【Hahaha, boy】
//
As shown in the figure :
spl07_inst_init This Where does the function begin to execute …

Of course For this kind of determination where the function is called , There is a general method : Print stack , Then analysis elf file , You can find it . however High pass adsp compiled elf file , I don't know how to parse it …
Try to use objdump perhaps arm Of objdump Tools I can't figure it out .
The card owner in an instant ???
not so bad , I saw this article on the Internet , Just record …
Look at Qualcomm's documentation
instance yes from client ( It can also be sensor ) Created …
sns_sensor_init_fw
Take a look at this function
sns_rc
sns_sensor_init_fw(void)
{
.....
sensor_cb = (sns_sensor_cb)
{
.struct_len = sizeof(sensor_cb),
.get_service_manager = &get_service_manager,
.get_sensor_instance = &get_sensor_instance,
.create_instance = &sns_sensor_instance_init,
.remove_instance = &sns_sensor_instance_deinit,
.get_library_sensor = &get_library_sensor,
.get_registration_index = &get_registration_index,
.create_instance_v2 = &sns_sensor_instance_init_v2,
};
......
}
create_instance Let's go in at look down
look down create_instance This note :
Allocation and initialization sensor Of example
Would call init . I don't know. Which one? init ???
because
.create_instance = &sns_sensor_instance_init,
Go in and have a look sns_sensor_instance_init
SNS_SECTION(".text.sns") sns_sensor_instance*
sns_sensor_instance_init(sns_sensor *sensor, uint32_t state_len)
{
return sns_sensor_instance_init_v2(sensor, state_len, 0);
}
Looking at the sns_sensor_instance_init_v2
SNS_SECTION(".text.sns") sns_sensor_instance*
sns_sensor_instance_init_v2(sns_sensor *sensor, uint32_t state_len,
uint32_t state_len_ni)
{
...... // sensor The number of
uint32_t sensors_cnt = fw_sensor->library->sensors.cnt;
.... binding instance.cb
instance->instance.cb = &instance_cb;
// initialization Some linked lists ...
// instance->client_req_lists It's empty ,instance->data_streams It's empty
sns_isafe_list_init(&instance->client_req_lists);
sns_isafe_list_init(&instance->data_streams);
// use instance initialization instance->list_entry
sns_isafe_list_item_init(&instance->list_entry, instance);
...... I don't know what to do
for(uint8_t i = 0; i < ARR_SIZE(state_init); i++)
if(NULL != state_init[i].init)
state_init[i].init(instance, fw_sensor);
// ---- This Will be called to Specifically driven
// such as : sns_sensor_instance_api sns_see_spl07_sensor_instance_api
rv = sensor->instance_api->init(
(sns_sensor_instance*)instance, sensor->state);
}
So here comes the question , Who will call it ?
spl07_sensor_set_client_request This function There are
create_instance : Will enter the above
instance = this->cb->create_instance(this, sizeof(spl07_instance_state));
rv = sensor->instance_api->init(
(sns_sensor_instance*)instance, sensor->state);
Update the client request of the sensor (.set_client_request())
Here you can. See instance yes sensor Of example , You need to , I'll create it …
therefore This Is belong to sns_sensor_api Inside
边栏推荐
- SQL bool盲注和时间盲注详解
- Date formatting
- 程序员最想干的三件事 |漫画
- Software configuration | pychart download, installation, environment configuration and uninstall
- Preliminary tutorial of Hezhou esp32c3 PIO Arduino development framework based on vscode
- Typescript 清空数组
- Pymoo学习 (1):基本概念
- 股票历史数据下载接口汇总(动态更新)
- 使用 Preparedstatement 选择和显示记录的 JDBC 程序
- 动态库*.dll文件的Debug/Release版本是否可以混用(交叉用)?
猜你喜欢

面试官:如何用 Redis 实现分布式锁?

工业物联网中的时序数据

新零售电商平台怎么做?才能实现传统零售企业数字化转型?

Explain SQL optimization in detail

Unity production QR code scanning
一加OnePlus 10T的一系列规格在产品发布前被披露

Food safety | eight things you must know when choosing probiotic products

Données chronologiques dans l'Internet industriel des objets

Encapsulate the general connection and query of the project with pymysql

12 pictures +6k figure ZGC garbage collector and tuning skills
随机推荐
工業物聯網中的時序數據
What about the reason why GOM and GEE set up a black screen and the fact that individual equipment maps are not displayed?
食品安全|选购益生菌类产品,你必须知道的八件事
Food safety eating preserved eggs will lead poisoning? Don't worry about eating after knowing these points
Transfer business append log (transaction propagation behavior)
【redis入门系列】redis的数据类型及相关命令
Leetcode question brushing record
Kubernetes Kubelet管理pod核心流程
食品安全|巧克力也有真假?关于它你了解多少
使用 PreparedStatement 的 JDBC 程序示例
Failure analysis and solution of vscode PIO creation project
Food safety | drinking fresh milk may infect tuberculosis? Take you to know what is milk sterilization
Description and usage of Axi interconnect IP core
Compressed storage of arrays and special matrices
Software configuration | Anaconda download, installation, environment configuration and uninstall
KV260单板PS控制设置IIC开关芯片
unity之制作二维码扫描
单细胞论文记录(part19)--A comprehensive comparison on cell-type composition inference for ST data
Agile testing practice in large-scale teams
JS tool CECP