17 lines
395 B
C++
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;
|
|
}
|
|
};
|