51 lines
No EOL
1.2 KiB
C++
51 lines
No EOL
1.2 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;
|
|
|
|
void loop();
|
|
|
|
protected:
|
|
// calbacks for BluetoothLeUartServerCallbacks
|
|
void onDeviceConnectedChanged(bool deviceConnected) override;
|
|
void onDataReceived(String data) override;
|
|
|
|
private:
|
|
enum OmobiDisplayCommand
|
|
{
|
|
AuthorizeSessionCommand = 0,
|
|
KeepAliveCommand = 1,
|
|
GetAllTextSetsCommand = 10,
|
|
GetTextSetParameterCommand = 11,
|
|
GetDisplayBrightnessCommand = 12,
|
|
SetTextSetParameterCommand = 20,
|
|
SetDisplayBrightnessCommand = 21
|
|
};
|
|
|
|
enum OmobiDisplayStatusCode
|
|
{
|
|
Success = 200,
|
|
InternalError = 500,
|
|
DisplayControllerError = 501
|
|
};
|
|
|
|
unsigned long lastKeepAlive;
|
|
const int maximumKeepAliveDelay = 10000;
|
|
|
|
LedDisplayController *ledDisplayController;
|
|
BluetoothLeUartServer *bleServer;
|
|
};
|
|
|
|
#endif // OMOBI_LED_DISPLAY
|