Improve readability with getHandle inline
Fork of BLE_API by
Diff: services/BatteryService.h
- Revision:
- 257:6be2b4b0cd71
- Parent:
- 244:0e9201b67e2f
--- a/services/BatteryService.h Tue Dec 02 02:51:52 2014 +0000 +++ b/services/BatteryService.h Mon Jan 12 14:49:53 2015 -0800 @@ -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 +* @brief 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 + * @brief 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; @@ -53,9 +64,9 @@ } private: - BLEDevice &ble; - uint8_t batteryLevel; - GattCharacteristic batteryLevelCharacteristic; + BLEDevice &ble; + uint8_t batteryLevel; + GattCharacteristic batteryLevelCharacteristic; }; -#endif /* #ifndef __BLE_BATTERY_SERVICE_H__*/ +#endif /* #ifndef __BLE_BATTERY_SERVICE_H__*/ \ No newline at end of file