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.
Fork of BLE_API by
Diff: services/BatteryService.h
- Revision:
- 238:905d6fc17fda
- Parent:
- 118:620d28e7a1ba
- Child:
- 242:0e9201b67e2f
diff -r 6050833395f1 -r 905d6fc17fda services/BatteryService.h --- a/services/BatteryService.h Mon Dec 08 20:17:37 2014 +0000 +++ b/services/BatteryService.h Mon Dec 08 20:24:12 2014 +0000 @@ -19,11 +19,20 @@ #include "BLEDevice.h" -/* Battery Service */ -/* 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 */ +/** +* @class BatteryService +* @breif BLE Battery Service. This service displays the battery level from 0%->100% represented as a 8bit number.<br> +* Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.battery_service.xml <br> +* Battery Level Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.battery_level.xml +*/ class BatteryService { public: + /** + * @param[ref] _ble + * BLEDevice object for the underlying controller. + * @param[in] level + * 8bit batterly level. Usually used to represent percentage of batterly charge remaining. + */ BatteryService(BLEDevice &_ble, uint8_t level = 100) : ble(_ble), batteryLevel(level), @@ -43,9 +52,11 @@ } /** - * Update the battery level with a new value. Valid values range from + * @breif Update the battery level with a new value. Valid values range from * 0..100. Anything outside this range will be ignored. - * @param newLevel New level. + * + * @param newLevel + * update to battery level. */ void updateBatteryLevel(uint8_t newLevel) { batteryLevel = newLevel;