Battery service function in SDK5.0.3

⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
Aaron Li
Offline
Last seen:2 months 3 weeks ago
加入:2016-09-12 14:20
Battery service function in SDK5.0.3

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:
PM_Dialog
Offline
Last seen:1 day 3 hours ago
工作人员
加入:2018-02-08 11:03
Hi Aaron Li,

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

Aaron Li
Offline
Last seen:2 months 3 weeks ago
加入:2016-09-12 14:20
Hi Dialog PM,

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

PM_Dialog
Offline
Last seen:1 day 3 hours ago
工作人员
加入:2018-02-08 11:03
Hi 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

Aaron Li
Offline
Last seen:2 months 3 weeks ago
加入:2016-09-12 14:20
Hello Dialog PM,

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

PM_Dialog
Offline
Last seen:1 day 3 hours ago
工作人员
加入:2018-02-08 11:03
Hi 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