This example creates and updates a standard Battery Level service containing a single GATT characteristic. The battery service transmits a device's battery level in percentage, with 100% being a fully charged battery and 0% being a fully drained battery. The canonical source for this example lives at https://github.com/ARMmbed/mbed-os-example-ble/tree/master/BLE_BatteryLevel

Auto generated API documentation and code listings for mbed-os-example-ble-BatteryLevel

Code

main.cpp [code]
pretty_printer.h [code]