BLE Library with custom services for the tortuga bike
Fork of BLE_API by
Diff: ble/services/BikeBatteryService.h
- Revision:
- 1206:8afbec0520f5
- Parent:
- 1205:86f0783a5420
- Child:
- 1207:da7745688342
--- a/ble/services/BikeBatteryService.h Tue Jul 12 11:55:13 2016 +0000 +++ b/ble/services/BikeBatteryService.h Fri Jul 15 12:49:23 2016 +0000 @@ -63,25 +63,25 @@ * Update to battery level. */ void updateBatteryLevel1(uint8_t newLevel) { - /*if (newLevel != batteryLevel) - {*/ + if (newLevel != batteryLevel1) + { batteryLevel1 = newLevel; ble.gattServer().write(batteryLevelCharacteristic1.getValueHandle(), &batteryLevel1, 1); - //} + } } void updateBatteryLevel2(uint8_t newLevel) { - /*if (newLevel != batteryLevel) - {*/ + if (newLevel != batteryLevel2) + { batteryLevel2 = newLevel; ble.gattServer().write(batteryLevelCharacteristic2.getValueHandle(), &batteryLevel2, 1); - //} + } } void updateBatteryLevel3(uint8_t newLevel) { - /*if (newLevel != batteryLevel) - {*/ + if (newLevel != batteryLevel3) + { batteryLevel3 = newLevel; ble.gattServer().write(batteryLevelCharacteristic3.getValueHandle(), &batteryLevel3, 1); - //} + } } protected: