Hello Dialog Support team,
I am developping a project based on SDK5.0.3 and ble_app_profile project. When my program status change from connection to disconnection, why the program still can run batt_level_upd_cfm_handler() and app_bass_process_handler() function? My understanding is that all of battery service program should be disabled after disconnection. can you help to explain? thanks a lot!
Best Regards,
Aaron Li
Device:
Hi Aaron Li,
I would like to let you know that SDK5.0.3 is a very old SKD for DA14580 products and it is not currently supported. To do so, I would strongly recommend you to download and use the latest version which is SDK5.0.4. Reggarding batt_level_upd_cfm_handler(), this function handles the confirmation for the Battery Level update., so it will be triggered as soon as you get a BASS_BATT_LEVEL_UPD_CFM message. The app_bass_process_handlers() is a structure that contains batt_level_upd_cfm_handler(). How did you check that the batt_level_upd_cfm_handler() is running? Did you add a break point? Upon disconnection the user_app_adv_undirect_complete(*) should be triggered.
Thanks, PM_Dialog
Hi Dialog PM,
when i stop the program. i found it stop at batt_level_upd_cfm_handler() function. Upon disconnnection the battery service should be disabled. If i want to stop batt_level_upd_cfm_handler() and app_bass_process_handlers() function. How should I do?
my program can't enter extended sleep mode since these function still is running after disconnection. can you give me some suggestion? thanks a lot!
Best Regards,
Aaron Li
Hi Aaron Li,
的ble_app_profile example of the SDK does not have any sleep mode implementation by default. Did you move inti SDK5.0.4? Please check the app_default_sleep_mode in the user_config.h header. It is set to ARCH_SLEEP_OFF. How did you check that is not in sleep mode? In addition, have you added a break point in batt_level_upd_cfm_handler() and it hits after the disconnection? Please let me know if you have done any modifications.
Thanks, PM_Dialog
Hello Dialog PM,
I added sleep mode and wakeup by myself in SDK5.0.3. It can correctly work in advertisement mode. But when program enter connection mode and then disconnection, the program always run, even the advertisement stopped and it can't enter sleep mode again. so I stop the program many times and found some times it stop at batt_level_upd_cfm_handler() function.
So I would like to know how can I stop all of battery service after disconnnection. can you give me some suggestion? thanks a lot!
Best Regards,
Aaron Li
Hi Aaron Li,
Firstly, the SDK5.0.3 is not currently supported, so you should move into SDK5.0.4. After that, please let me know with the modifications that you have done in order to implement the sleep mode in order to try to replicate your issue and try to debug your code. As soon as you are disconnected from the peer device, the batt_level_upd_cfm_handler() should not be triggered. I can not replicate it from my side. Did you add a break point in batt_level_upd_cfm_handler() and it hits after the disconnection? How did you check that the device is not in sleep mode? After the disconnection, is the chip advertising?
Thanks, PM_Dialog