Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Peripheral_1_serial_copy Peripheral_1_serial 151006_1st_Scenario_normal
Fork of BLE_API by
BatteryService Class Reference
#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->100% represented as a 8bit number.
Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.battery_service.xml
Battery Level Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.battery_level.xml
Definition at line 28 of file BatteryService.h.
Constructor & Destructor Documentation
BatteryService | ( | BLE & | _ble, |
uint8_t | level = 100 |
||
) |
- Parameters:
-
ref] _ble BLE object for the underlying controller. [in] level 8bit 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 range from 0..100. Anything outside this range will be ignored.
- Parameters:
-
newLevel update to battery level.
Definition at line 54 of file BatteryService.h.
Generated on Mon Jul 18 2022 21:56:46 by
