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:
- 277:1407d2f1ce3c
- Parent:
- 242:0e9201b67e2f
- Child:
- 520:2ac0f11a183a
--- a/services/BatteryService.h Thu Jan 22 09:59:43 2015 +0000 +++ b/services/BatteryService.h Thu Jan 22 09:59:44 2015 +0000 @@ -36,8 +36,7 @@ BatteryService(BLEDevice &_ble, uint8_t level = 100) : ble(_ble), batteryLevel(level), - batteryLevelCharacteristic(GattCharacteristic::UUID_BATTERY_LEVEL_CHAR, &batteryLevel, sizeof(batteryLevel), sizeof(batteryLevel), - GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) { + batteryLevelCharacteristic(GattCharacteristic::UUID_BATTERY_LEVEL_CHAR, &batteryLevel, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) { static bool serviceAdded = false; /* We should only ever need to add the heart rate service once. */ if (serviceAdded) { @@ -64,9 +63,10 @@ } private: - BLEDevice &ble; - uint8_t batteryLevel; - GattCharacteristic batteryLevelCharacteristic; + BLEDevice &ble; + + uint8_t batteryLevel; + ReadOnlyGattCharacteristic<uint8_t> batteryLevelCharacteristic; }; #endif /* #ifndef __BLE_BATTERY_SERVICE_H__*/ \ No newline at end of file