callback function for every advertisement transmit complete

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
tristan.ubnt
Offline
Last seen:1 year 11 months ago
加入:2018-08-06 03:04
callback function for every advertisement transmit complete

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:
PM_Dialog
Offline
Last seen:21 hours 55 min ago
工作人员
加入:2018-02-08 11:03
Hi tristan.ubnt,

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