当前位置:网站首页>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
边栏推荐
- leetcode刷题记录
- Food safety | attention to smoking food, do you know this knowledge
- Shrimp noodles: what do you know about the JVM memory layout?
- Pymoo学习 (2):带约束的双目标优化问题
- Literature learning (part100) -- an introduction to autoencoders
- 封玩家IP和机器码以及解开被封的教程
- 来自某学生的求助,干了,闲暇能帮就帮一把!
- Agile testing practice in large-scale teams
- 面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
- Detailed explanation of SQL bool blind note and time blind note
猜你喜欢

爱可可AI前沿推介(7.23)

How to refine the operation of small program mall?

阿里二面:什么是CAS?

转账业务追加日志(事务的传播行为).

食品安全|喝鲜奶可能感染结核病?带你了解什么是牛奶灭菌

Log slimming operation: from 5g to 1g!

Software configuration | Anaconda download, installation, environment configuration and uninstall

5秒到1秒,记一次效果“非常”显著的性能优化

Kubernetes kubelet manages pod core process

Search Binary Tree - find nodes, insert nodes, delete nodes
随机推荐
59. General knowledge of lightning safety
Description and usage of Axi interconnect IP core
Food safety | attention to smoking food, do you know this knowledge
Software configuration | Anaconda download, installation, environment configuration and uninstall
单细胞文献学习(part6)--ForestFireClustering for sc sequencing combines iterative label propagation with ...
From Markov chain to GPT, Li Hang, director of ByteDance AI Lab, detailed the past and present lives of language models
[pytorch] basic use 7. GPU allocation
从马尔可夫链到GPT,字节跳动AI Lab总监李航细说语言模型的前世今生
元素内容必须由格式正确的字符数据或标记组成
How to refine the operation of small program mall?
【Js】检查Date对象是否为Invalid Date
Food safety | eight things you must know when choosing probiotic products
Implementation of deep copy deepclone
日志瘦身骚操作:从5G优化到1G!
Encapsulate the general connection and query of the project with pymysql
深拷贝deepClone的实现
网络基础设施可视化
Kubernetes kubelet manages pod core process
日期格式化
股票历史数据下载接口汇总(动态更新)