Hi Team,
I am using DA14586 chip and SDK: 6.0.10.511. I use the example ble_app_sleepmode, and in user_config.h, I set the adv interval to be 1 second, by modifying struct advertise_configuration user_adv_conf. There is no problem for advertisement.
I want to know if any use app callback function or system level callback function open for application software to be notified. The purpose is just to read some GPIO pins state, and if this could be performed along with adv timeslot. That would be more power efficient. In my example, that should be 1 callback every second (i.e. adv interval)
我尝试了the cb functions in user_callback_config.h, but failed.
Please help.
Thank you,
Device:
Hi tristan.ubnt,
Τhere isn’t any callback available for this functionality, but I would suggest one other possible solution for your issue. Please check the code snippet that I have attached. This code snippet demonstrates how to count the advertising events. The arch_last_rwble_evt_get() function will return the last event which was the BLE_END_EVT (the function returns the last state the BLE was, it rolls through the states). If your last state was a BLE_END_EVT, instead of increasing the advertising event, you should read the GPIOs state. Be aware that this procedure should be done while your device is advertising and not when is in a connected state. Please try to add the attached code into the ble_app_sleepmode.c / .h . Then you should register the user_on_ble_powered() function into .app_on_ble_powered callback of user_callback_config.h header file.
It should be like this :
.app_on_ble_powered = user_on_ble_powered,
Thanks, PM_Dialog