Hello,
I implemented a Custom Profile as shown in ble_app_perihperal.
I want to do some things after a write to a Characteristic happened.
因为this I want to create a task and send it a message when the write happens.
void user_custs1_ctrl_wr_ind_handler(ke_msg_id_t const msgid,
struct custs1_val_write_ind const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
//create and send message to own task
}
我如何实现任务吗?
Device:
Hi Firefox,
I dont quite get what you would like to do, you mean create an additional task like APP_TASK or like any other task like the profiles TASK_BASS, TASK_DISS etc ? The whole SDK in based on tasks and delivering messages in different tasks, you can start by taking as an example any of the profiles in order to do that. You can check the _init function that most of the profiles have in order to be created when initialized. Also you will have to declare your TASK in the KE_TASK_TYPE definition.
Thanks MT_dialog
Hi, Dialog
I would like to implement a task that work periodically(maybe 1 second or longer) to measure ADC value and add it in the advertising data. How could I create a new task and change advertising data? And where the whole system start? Thanks.
Hi Liang Yun Hao,
You can use a kernel timer that will trigger some adc measurements, the flow should go like described below:
Thanks MT_dialog
Hi, Dialog
What is the database? Does it mean "task"? And where is the advertising start after boot up?(I use the prox_reporter project) Thanks.
Hi Liang Yun Hao,
No, the database is how the BLE data are organized in a peripheral device, and has nothing to do with a task. The advertising starts as soon as the database of the device has been created (if there is a database), for example in the proximity reporter the advertise operation starts as soon as the database has been created, which is at the .app_on_db_init_complete callback function hence at the default_app_on_db_init_complete() function.
Thanks MT_dialog