EmlaLockSafe
configuration::ConfigurationServer Class Reference

Class implementing all functions to configure the Controller. More...

#include <ConfigurationServer.h>

Inheritance diagram for configuration::ConfigurationServer:
configuration::ConfigurationServerBase

Static Public Member Functions

static ConfigurationServergetSingleton ()
 Get the Singleton object. More...
 
static ConfigurationServerbegin (LiquidCrystal_PCF8574 &display, RotaryEncoder &encoder)
 Create a new Configuration server. More...
 

Protected Member Functions

void onGetLastValues (AsyncWebServerRequest *request)
 Event handler called if the current configuration should be sent to the browser. More...
 
void onSaveData (AsyncWebServerRequest *request)
 Event handler called if new configuration data should be saved. More...
 
void onGenerateNewKey (AsyncWebServerRequest *request)
 Event handler called if a new emergency key should be generated. More...
 
void onRemoteControlWebSocketEvent (AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len)
 Event handler for the WebSocket connection which is used to remote control the safe. More...
 
- Protected Member Functions inherited from configuration::ConfigurationServerBase
 ConfigurationServerBase ()
 Construct a new Configuration Server object. More...
 
void addSpiffsFileToServer (const char *path, String contentType, const char *filename=nullptr)
 Adds the file from the SPIFFS with the filename to the webserver under the given path. More...
 

Static Protected Member Functions

static ConfigurationServer ** getInstance ()
 Function providing the instance for the singleton. More...
 
static String getParam (AsyncWebServerRequest *request, const String &paramName)
 Extract a passed parameter value from a HTTP GET request. More...
 
static bool isConfigurationAllowed ()
 Quick check if the ConfigurationServerView is active --> changing the configuration is allowed. More...
 

Protected Attributes

AsyncWebSocket remoteControlWebSocket
 Websocket to remote control the display. More...
 
LiquidCrystal_PCF8574 & display
 Reference to the display. More...
 
RotaryEncoder & encoder
 Refernce to the encoder. More...
 
- Protected Attributes inherited from configuration::ConfigurationServerBase
AsyncWebServer server
 The used asynchronous webserver. More...
 

Private Member Functions

 ConfigurationServer (LiquidCrystal_PCF8574 &display, RotaryEncoder &encoder)
 Construct a new Configuration Server object. More...
 

Detailed Description

Class implementing all functions to configure the Controller.

Constructor & Destructor Documentation

◆ ConfigurationServer()

configuration::ConfigurationServer::ConfigurationServer ( LiquidCrystal_PCF8574 &  display,
RotaryEncoder &  encoder 
)
inlineprivate

Construct a new Configuration Server object.

Parameters
displayReference to the display
encoderReference to the encoder

Member Function Documentation

◆ begin()

static ConfigurationServer & configuration::ConfigurationServer::begin ( LiquidCrystal_PCF8574 &  display,
RotaryEncoder &  encoder 
)
inlinestatic

Create a new Configuration server.

Parameters
displayReference to the display
encoderReference to the encoder

◆ getInstance()

static ConfigurationServer ** configuration::ConfigurationServer::getInstance ( )
inlinestaticprotected

Function providing the instance for the singleton.

◆ getParam()

static String configuration::ConfigurationServer::getParam ( AsyncWebServerRequest *  request,
const String &  paramName 
)
inlinestaticprotected

Extract a passed parameter value from a HTTP GET request.

◆ getSingleton()

static ConfigurationServer & configuration::ConfigurationServer::getSingleton ( )
inlinestatic

Get the Singleton object.

◆ isConfigurationAllowed()

static bool configuration::ConfigurationServer::isConfigurationAllowed ( )
inlinestaticprotected

Quick check if the ConfigurationServerView is active --> changing the configuration is allowed.

◆ onGenerateNewKey()

void configuration::ConfigurationServer::onGenerateNewKey ( AsyncWebServerRequest *  request)
inlineprotected

Event handler called if a new emergency key should be generated.

Parameters
requestthe request received from the browser

◆ onGetLastValues()

void configuration::ConfigurationServer::onGetLastValues ( AsyncWebServerRequest *  request)
inlineprotected

Event handler called if the current configuration should be sent to the browser.

Parameters
requestthe request received from the browser

◆ onRemoteControlWebSocketEvent()

void configuration::ConfigurationServer::onRemoteControlWebSocketEvent ( AsyncWebSocketClient *  client,
AwsEventType  type,
void *  arg,
uint8_t *  data,
size_t  len 
)
inlineprotected

Event handler for the WebSocket connection which is used to remote control the safe.

Parameters
clientthe client which triggered the event
typethe event type
argthe information about received data
datathe received data
lenthe length of the received data

◆ onSaveData()

void configuration::ConfigurationServer::onSaveData ( AsyncWebServerRequest *  request)
inlineprotected

Event handler called if new configuration data should be saved.

Parameters
requestthe request received from the browser

Member Data Documentation

◆ display

LiquidCrystal_PCF8574& configuration::ConfigurationServer::display
protected

Reference to the display.

◆ encoder

RotaryEncoder& configuration::ConfigurationServer::encoder
protected

Refernce to the encoder.

◆ remoteControlWebSocket

AsyncWebSocket configuration::ConfigurationServer::remoteControlWebSocket
protected

Websocket to remote control the display.


The documentation for this class was generated from the following file: