High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Revision:
526:caa67c3187a0
Parent:
524:6e97ab392e2a
Child:
528:8d21604fe31d
--- a/services/BatteryService.h	Fri Jun 19 15:52:06 2015 +0100
+++ b/services/BatteryService.h	Fri Jun 19 15:52:06 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;
     }
 
     /**
@@ -62,7 +56,7 @@
         ble.updateCharacteristicValue(batteryLevelCharacteristic.getValueAttribute().getHandle(), &batteryLevel, 1);
     }
 
-private:
+protected:
     BLEDevice &ble;
 
     uint8_t    batteryLevel;