Jurica Resetar / Mbed OS acn52832_LANC_BLE

Dependencies:   aconno_LANC aconno_bsp aconno_SEGGER_RTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AckService.h Source File

AckService.h

00001 
00002 // Template allows you to use 'constant' values on non-constant places (XD)
00003 template<uint8_t dataSize>
00004 
00005 class ACKService{
00006     public:
00007         const static uint16_t ACK_SERVICE_UUID = 0xA000;
00008         const static uint16_t ACK_CHARA_UUID = 0xA001;
00009 
00010         ACKService(BLEDevice &_ble, uint8_t *_initValues) : ble(_ble), ACK(ACK_CHARA_UUID, _initValues){
00011                 GattCharacteristic *charTable[] = {&ACK};     // Add characteristick in table
00012                 GattService AckService(ACK_SERVICE_UUID, charTable, sizeof(charTable)/sizeof(GattCharacteristic *));   
00013                 ble.addService(AckService); // Add service in the BLE
00014         }
00015     private:
00016         BLEDevice &ble;
00017         // Create new characteristic
00018         WriteOnlyArrayGattCharacteristic<uint8_t, dataSize> ACK;
00019 };