Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can the Battery Service Client module handle subscribing to multiple notifications from multiple peripherals for battery levels?

Does the Battery Service Client (ble_bas_c) module handle subscribing to notifications from multiple slaves? In my use case, I have the nRF52840 dev kit connecting to multiple peripherals and each of them has the Battery Service. I need to subscribe and get notified of changes in each of their battery levels. Is this possible with the code as it currently stands? or does it require any modifications to make it work? If so, can you provide some guidance on what needs to change?

Parents Reply Children
  • Thanks, . I followed the implementation in the multilink example, but what I'm seeing is that often the central discovers the peripherals (I have 3 of them) and connects to them but then fails to complete the discovery on some of them. Sometimes it also logs that the Battery discovery failed and I never see a successful discovery for it.

    The DB discovery has multiple registered UUIDs (some peripherals have more than one, not including the battery service).

    This happens mostly if I have all three peripherals advertising and then I power on the Central.

    Any suggestions?

  • You need to debug the database discovery procedure for each of the devices.

    I'm guessing there's some logical error in the way the central's application handles the discovery of multiple connected peripherals. Take note of the events from the softdevice and the applications response to them, also note the connection handle associated with each event. 

Related