LedDisplay/vscode/OmobiLEDdisplayBluetooth/include/OmobiLedDisplay.h
2020-10-14 23:54:54 +02:00

44 lines
1.1 KiB
C++

#ifndef OMOBI_LED_DISPLAY
#define OMOBI_LED_DISPLAY
#include <Arduino.h>
#include <ArduinoJson.h>
#include "BluetoothLeUartServer.h"
#include "LedDisplayController.h"
class OmobiLedDisplay : protected BluetoothLeUartServerCallbacks
{
public:
explicit OmobiLedDisplay(String deviceName, Adafruit_NeoMatrix *ledDisplayMatrix);
// befriend for callbacks
friend class BluetoothLeUartServer;
protected:
// calbacks for BluetoothLeUartServerCallbacks
void onDeviceConnectedChanged(bool deviceConnected) override;
void onDataReceived(String data) override;
private:
enum OmobiDisplayCommand
{
GetAllTextSetsCommand = 10,
GetTextSetParameterCommand = 11,
GetDisplayBrightnessCommand = 12,
SetTextSetParameterCommand = 20,
SetDisplayBrightnessCommand = 21
};
enum OmobiDisplayStatusCode
{
Success = 200,
InternalError = 500,
DisplayControllerError = 501
};
LedDisplayController *ledDisplayController;
BluetoothLeUartServer *bleServer;
};
#endif // OMOBI_LED_DISPLAY