BLE Nano LED control

Dependencies:   BLE_API mbed nRF51822

Revision:
0:355d86799c43
Child:
1:f3a478216681
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ble_nanoled_service.h	Sat Dec 24 14:50:03 2016 +0000
@@ -0,0 +1,24 @@
+#ifndef BLE_NANOLED_SERVICE_H__
+#define BLE_NANOLED_SERVICE_H__
+
+#include "mbed.h"
+#include "ble/BLE.h"
+
+class ServiceUart {
+private:
+    static const int TXRX_BUF_LEN = 20;
+    static const int CHAR_NUM = 2;
+
+public:
+    void addService(BLE& ble);
+    void writtenHandler(BLE& ble, const GattWriteCallbackParams* params);
+    void readHandler(BLE& ble, const GattReadCallbackParams* params);
+
+private:
+    GattCharacteristic* mChars[CHAR_NUM];
+    uint8_t mTxPayload[TXRX_BUF_LEN];
+    uint8_t mRxPayload[TXRX_BUF_LEN];
+};
+
+#endif //_BLE_NANOLED_SERVICE_H__
+