BLE Nano LED control

Dependencies:   BLE_API mbed nRF51822

Committer:
hiro99ma
Date:
Sat Dec 24 14:50:03 2016 +0000
Revision:
0:355d86799c43
Child:
1:f3a478216681
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hiro99ma 0:355d86799c43 1 #ifndef BLE_NANOLED_SERVICE_H__
hiro99ma 0:355d86799c43 2 #define BLE_NANOLED_SERVICE_H__
hiro99ma 0:355d86799c43 3
hiro99ma 0:355d86799c43 4 #include "mbed.h"
hiro99ma 0:355d86799c43 5 #include "ble/BLE.h"
hiro99ma 0:355d86799c43 6
hiro99ma 0:355d86799c43 7 class ServiceUart {
hiro99ma 0:355d86799c43 8 private:
hiro99ma 0:355d86799c43 9 static const int TXRX_BUF_LEN = 20;
hiro99ma 0:355d86799c43 10 static const int CHAR_NUM = 2;
hiro99ma 0:355d86799c43 11
hiro99ma 0:355d86799c43 12 public:
hiro99ma 0:355d86799c43 13 void addService(BLE& ble);
hiro99ma 0:355d86799c43 14 void writtenHandler(BLE& ble, const GattWriteCallbackParams* params);
hiro99ma 0:355d86799c43 15 void readHandler(BLE& ble, const GattReadCallbackParams* params);
hiro99ma 0:355d86799c43 16
hiro99ma 0:355d86799c43 17 private:
hiro99ma 0:355d86799c43 18 GattCharacteristic* mChars[CHAR_NUM];
hiro99ma 0:355d86799c43 19 uint8_t mTxPayload[TXRX_BUF_LEN];
hiro99ma 0:355d86799c43 20 uint8_t mRxPayload[TXRX_BUF_LEN];
hiro99ma 0:355d86799c43 21 };
hiro99ma 0:355d86799c43 22
hiro99ma 0:355d86799c43 23 #endif //_BLE_NANOLED_SERVICE_H__
hiro99ma 0:355d86799c43 24