Press buttons to activate the LED.

Dependencies:   BLE_API nRF51822

Fork of Puck by Nordic Pucks

Revision:
6:211ffef3b88e
Parent:
5:2f2a2ac6b231
Parent:
4:91506772210d
Child:
7:c07c01c2a741
--- a/Puck.h	Wed Jul 23 14:19:52 2014 +0000
+++ b/Puck.h	Wed Jul 23 14:34:21 2014 +0000
@@ -92,6 +92,8 @@
         std::vector<CharacteristicWriteCallback> pendingCallbackStack;
         std::vector<uint8_t*> pendingCallbackParameterStack;
         
+        GattCharacteristic **previousCharacteristics;
+        
     public:
         static Puck &getPuck();
         
@@ -252,11 +254,13 @@
         }
         services.erase(services.begin() + removeIndex);
         delete service;
+        free(previousCharacteristics);
     } else {
         characteristicsLength = 1;
         characteristics = (GattCharacteristic**) malloc(sizeof(GattCharacteristic*) * characteristicsLength);
     }
     characteristics[characteristicsLength - 1] = characteristic;
+    previousCharacteristics = characteristics;
     service = new GattService(serviceUuid, characteristics, characteristicsLength);
     services.push_back(service);
 }