Andrew Fox / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Revision:
663:73177d7c6e75
Parent:
567:e4b38e43de7c
Child:
664:1624b24837d0
--- a/services/BatteryService.h	Fri Jun 19 15:53:00 2015 +0100
+++ b/services/BatteryService.h	Fri Jun 19 15:53:00 2015 +0100
@@ -38,16 +38,10 @@
         batteryLevel(level),
         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) {
-            return;
-        }
-
         GattCharacteristic *charTable[] = {&batteryLevelCharacteristic};
         GattService         batteryService(GattService::UUID_BATTERY_SERVICE, charTable, sizeof(charTable) / sizeof(GattCharacteristic *));
 
         ble.addService(batteryService);
-        serviceAdded = true;
     }
 
     /**