BLE Nano LED control
Dependencies: BLE_API mbed nRF51822
ble_nanoled_service.h@2:f4709d271f13, 2016-12-24 (annotated)
- Committer:
- hiro99ma
- Date:
- Sat Dec 24 15:18:47 2016 +0000
- Revision:
- 2:f4709d271f13
- Parent:
- 1:f3a478216681
delete File Header
Who changed what in which revision?
User | Revision | Line number | New 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 | 1:f3a478216681 | 23 | #endif //BLE_NANOLED_SERVICE_H__ |