Locator beacon firmware

Dependencies:   BLE_API mbed nRF51822

Fork of WeatherStation by Weather man

_LampService.h

Committer:
sycorax
Date:
2017-04-29
Revision:
9:dd7ba1fdae47
Parent:
7:8fa805941074

File content as of revision 9:dd7ba1fdae47:

#include "ble/BLE.h"

class LampService {
public:
    typedef uint8_t  LightLevel_t;
    WriteOnlyGattCharacteristic<LightLevel_t> lightLevelCharacteristic;
    
        LampService(BLE& _ble) :
            ble(_ble),
            lightLevelCharacteristic(0x2A58, &lightLevel) 
        {            
            GattCharacteristic *charTable[] = { &lightLevelCharacteristic };
            GattService lampService(0x2600, charTable, sizeof(charTable) / sizeof(GattCharacteristic *));
            ble.gattServer().addService(lampService);
        }
private:
    BLE& ble;
    
    LightLevel_t lightLevel;
};