blatann.examples.peripheral_battery_service module

This example demonstrates using Bluetooth SIG’s Battery service as a peripheral. The peripheral adds the service, then updates the battery level percentage periodically.

This can be used in conjunction with the nRF Connect apps to explore the functionality demonstrated

blatann.examples.peripheral_battery_service.on_connect(peer, event_args)

Event callback for when a central device connects to us

Parameters
blatann.examples.peripheral_battery_service.on_disconnect(peer, event_args)

Event callback for when the client disconnects from us (or when we disconnect from the client)

Parameters
blatann.examples.peripheral_battery_service.main(serial_port)