EEP fORK

Dependencies:   BLE_API mbed nRF51822

Fork of MCS_LRF by Farshad N

Revision:
7:8a23a257b66a
Child:
9:afd6bd6e88bd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bleHelper.h	Wed Dec 09 03:28:42 2015 +0000
@@ -0,0 +1,39 @@
+
+#ifndef __BLE_HELPER_H__
+#define __BLE_HELPER_H__
+
+#include "mbed.h"
+#include "Serial.h"
+#include "BLE.h"
+#include "DeviceInformationService.h"
+#include "UARTService.h"
+
+
+
+class BLEHelper
+{
+public:
+    // constructor
+    BLEHelper(BLEDevice* ble, UARTService* UuartServicePtr);
+
+    void sendPacketOverBLE(uint16_t cmd, uint8_t data[], uint16_t len);
+
+
+private:
+    typedef enum {
+        PS_FIRST_AND_ONLY =     0b0000000000000000,
+        PS_FIRST_AND_NOT_LAST = 0b0010000000000000,
+        PS_LAST =               0b0100000000000000,
+        PS_MIDDLE =             0b0110000000000000
+    } PacketStatus_e;
+    
+    BLEDevice* blePtr;
+    UARTService* uartServicePtr;
+    PacketStatus_e packetStatus;
+
+    void sendOverBLE(uint16_t cmd, uint8_t data[], uint16_t len, PacketStatus_e status);
+};
+
+
+
+#endif // __BLE_HELPER_H__
\ No newline at end of file