Sony's LANC camera control protocol project.
Dependencies: aconno_LANC aconno_bsp aconno_SEGGER_RTT
Diff: AckService.h
- Revision:
- 6:8cf24e946b0b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AckService.h Wed Nov 01 18:05:20 2017 +0000 @@ -0,0 +1,19 @@ + +// Template allows you to use 'constant' values on non-constant places (XD) +template<uint8_t dataSize> + +class ACKService{ + public: + const static uint16_t ACK_SERVICE_UUID = 0xA000; + const static uint16_t ACK_CHARA_UUID = 0xA001; + + ACKService(BLEDevice &_ble, uint8_t *_initValues) : ble(_ble), ACK(ACK_CHARA_UUID, _initValues){ + GattCharacteristic *charTable[] = {&ACK}; // Add characteristick in table + GattService AckService(ACK_SERVICE_UUID, charTable, sizeof(charTable)/sizeof(GattCharacteristic *)); + ble.addService(AckService); // Add service in the BLE + } + private: + BLEDevice &ble; + // Create new characteristic + WriteOnlyArrayGattCharacteristic<uint8_t, dataSize> ACK; +}; \ No newline at end of file