add "LE Device Address" 0x1B to advertising data types

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

BatteryService Class Reference

BatteryService Class Reference

BLE Battery Service. More...

#include <BatteryService.h>

Public Member Functions

 BatteryService (BLE &_ble, uint8_t level=100)
void updateBatteryLevel (uint8_t newLevel)
 Update the battery level with a new value.

Detailed Description

BLE Battery Service.

This service displays the battery level from 0% to 100%, represented as an 8bit number. Service: Battery Level Char:

Definition at line 28 of file BatteryService.h.

Constructor & Destructor Documentation

BatteryService ( BLE _ble,
uint8_t  level = 100 
ref]_ble BLE object for the underlying controller.
[in]level8bit batterly level. Usually used to represent percentage of batterly charge remaining.

Definition at line 36 of file BatteryService.h.

Member Function Documentation

void updateBatteryLevel ( uint8_t  newLevel )

Update the battery level with a new value.

[Valid values lie between 0 and 100]; anything outside this range will be ignored.

newLevelUpdate to battery level.

Definition at line 54 of file BatteryService.h.