nRF5 SDK v17.1.0
Battery Service
This information applies to the following SoftDevices: S132, S140

This module implements the Battery Service with the Battery Level characteristic. During initialization it adds the Battery Service and Battery Level characteristic to the BLE stack database. Optionally it can also add a Report Reference descriptor to the Battery Level characteristic (used when including the Battery Service in the HID service).

If specified, the module will support notification of the Battery Level characteristic through the ble_bas_battery_level_update() function. If an event handler is supplied by the application, the Battery Service will generate Battery Service events to the application.

Note
The application must register each instance of this module as a BLE stack event observer using the NRF_SDH_BLE_OBSERVER macro from the SoftDevice Handler library.
For the requirements in the BAS specification to be fulfilled, it is necessary to send a battery level notification to the bonded peer right after reconnection. You can refer to the Immediate Alert Server Application example to see how it is handled in multi connection scenario.

Documentation feedback | Developer Zone | Subscribe | Updated