Rodrigo Miguez / Mbed 2 deprecated i2c_acelerometro

Dependencies:   BLE_API mbed nRF51822 circular_buffer

Revision:
9:3708b94b2312
Child:
10:8c5a246b9045
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AccelService.h	Tue Mar 08 15:33:13 2016 +0000
@@ -0,0 +1,33 @@
+#ifndef ACCELSERVICE_H
+#define ACCELSERVICE_H
+
+#include "BLE.h"
+#include "Vector.h"
+
+#define SERVICE_UUID 0xA000
+#define CHARACTERISTIC_UUID 0xA001
+
+class AccelService {
+    
+public:
+    AccelService();
+    void updateAccelState(Vector v);
+      
+private:
+    GattCharacteristic _accelState;
+    int _values[3];
+    
+    static void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params){
+    
+        BLE::Instance().gap().startAdvertising();
+        
+    }
+    
+    static void connectionCallback(const Gap::ConnectionCallbackParams_t *params){
+    
+        BLE::Instance().gap().stopAdvertising();
+        
+    }
+};
+
+#endif //#ifndef ACCELSERVICE_H
\ No newline at end of file