App for BLE Nano to monitor the power consumption for a specific location, by intercepting the led flashes of a standard power meter. It counts and log the flashes for each second. It works with RedBear App for smart phone (Simple Chat App).

Dependencies:   BLE_API lib_mma8451q mbed nRF51822

Fork of nRF51822_DataLogger_with_Chat by Valentin Tanasa

Revision:
2:4b66b69c7ecb
Parent:
1:1c058e553423
Child:
3:b3f6c612b603
Child:
4:d7872f84c03c
--- a/main.cpp	Fri Oct 31 14:38:44 2014 +0000
+++ b/main.cpp	Mon Jul 27 06:52:44 2015 +0000
@@ -25,7 +25,7 @@
  */
  
 #include "mbed.h"
-#include "BLEDevice.h"
+#include "ble/BLE.h"
 
 
 #define BLE_UUID_TXRX_SERVICE            0x0000 /**< The UUID of the Nordic UART Service. */
@@ -34,7 +34,7 @@
 
 #define TXRX_BUF_LEN                     20
 
-BLEDevice  ble;
+BLE  ble;
 
 Serial pc(USBTX, USBRX);
 
@@ -70,12 +70,12 @@
     ble.startAdvertising();
 }
 
-void WrittenHandler(const GattCharacteristicWriteCBParams *Handler)
+void WrittenHandler(const GattWriteCallbackParams *Handler)
 {   
     uint8_t buf[TXRX_BUF_LEN];
     uint16_t bytesRead, index;
     
-    if (Handler->charHandle == txCharacteristic.getValueAttribute().getHandle()) 
+    if (Handler->handle == txCharacteristic.getValueAttribute().getHandle()) 
     {
         ble.readCharacteristicValue(txCharacteristic.getValueAttribute().getHandle(), buf, &bytesRead);
         memset(txPayload, 0, TXRX_BUF_LEN);