vancontrolsystems/src/BluetoothLEDCallback.cpp
2021-08-22 21:42:47 +01:00

17 lines
395 B
C++

#include "JsonLightControl.cpp"
#include <BLEUtils.h>
class BluetoothLEDCallback : public BLECharacteristicCallbacks {
JsonLightControl *_lightControl;
void onWrite(BLECharacteristic *characteristic) {
std::string value = characteristic->getValue();
_lightControl->action(value);
}
public:
BluetoothLEDCallback(JsonLightControl *lightControl){
_lightControl = lightControl;
}
};