EnigmaIOT  0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EnigmaIOTjsonController Class Referenceabstract

#include <EnigmaIOTjsonController.h>

Inheritance diagram for EnigmaIOTjsonController:
CONTROLLER_CLASS_NAME

Public Member Functions

virtual void setup (EnigmaIOTNodeClass *node, void *config=NULL)=0
 Initialize data structures. More...
 
virtual void loop ()=0
 This should be called periodically for module handling. More...
 
virtual bool processRxCommand (const uint8_t *mac, const uint8_t *buffer, uint8_t length, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding)=0
 Called to process a downlink command. More...
 
void sendDataCallback (sendData_cb cb)
 Register send data callback to run when module needs to send a message. More...
 
virtual void connectInform ()
 Used to notify controller that it is registered on EnigmaIOT network. More...
 
virtual void disconnectInform (nodeInvalidateReason_t reason)
 Used to notify controller that it is unregistered on EnigmaIOT network. More...
 
virtual void configManagerStart ()=0
 Called when wifi manager starts config portal. More...
 
virtual void configManagerExit (bool status)=0
 Called when wifi manager exits config portal. More...
 
virtual bool loadConfig ()=0
 Loads output module configuration. More...
 

Protected Member Functions

virtual bool sendCommandResp (const char *command, bool result)=0
 Sends command processing response acknowledge. More...
 
virtual bool sendStartAnouncement ()=0
 Send a message to notify node has started running. More...
 
virtual bool saveConfig ()=0
 Saves output module configuration. More...
 
bool sendJson (DynamicJsonDocument &json)
 Sends a JSON encoded message to lower layer. More...
 

Protected Attributes

sendData_cb sendData
 
EnigmaIOTNodeClassenigmaIotNode
 

Detailed Description

Definition at line 34 of file EnigmaIOTjsonController.h.

Member Function Documentation

◆ configManagerExit()

virtual void EnigmaIOTjsonController::configManagerExit ( bool  status)
pure virtual

Called when wifi manager exits config portal.

Parameters
statustrue if configuration was successful

Implemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

◆ configManagerStart()

virtual void EnigmaIOTjsonController::configManagerStart ( )
pure virtual

◆ connectInform()

virtual void EnigmaIOTjsonController::connectInform ( )
inlinevirtual

Used to notify controller that it is registered on EnigmaIOT network.

Reimplemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

Definition at line 81 of file EnigmaIOTjsonController.h.

◆ disconnectInform()

virtual void EnigmaIOTjsonController::disconnectInform ( nodeInvalidateReason_t  reason)
inlinevirtual

Used to notify controller that it is unregistered on EnigmaIOT network.

Definition at line 97 of file EnigmaIOTjsonController.h.

◆ loadConfig()

virtual bool EnigmaIOTjsonController::loadConfig ( )
pure virtual

Loads output module configuration.

Returns
Returns true if load was successful. false otherwise

Implemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

◆ loop()

virtual void EnigmaIOTjsonController::loop ( )
pure virtual

This should be called periodically for module handling.

Implemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

◆ processRxCommand()

virtual bool EnigmaIOTjsonController::processRxCommand ( const uint8_t *  mac,
const uint8_t *  buffer,
uint8_t  length,
nodeMessageType_t  command,
nodePayloadEncoding_t  payloadEncoding 
)
pure virtual

Called to process a downlink command.

Parameters
macAddress of sender
bufferMessage bytes
lengthMessage length
commandType of command. nodeMessageType_t
payloadEncodingPayload encoding of type nodePayloadEncoding_t
Returns
true on success

Implemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

◆ saveConfig()

virtual bool EnigmaIOTjsonController::saveConfig ( )
protectedpure virtual

Saves output module configuration.

Returns
Returns true if save was successful. false otherwise

Implemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

◆ sendCommandResp()

virtual bool EnigmaIOTjsonController::sendCommandResp ( const char *  command,
bool  result 
)
protectedpure virtual

Sends command processing response acknowledge.

Parameters
commandCommand name
resultCommand execution success
Returns
Returns true if message sending was successful. false otherwise

Implemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

◆ sendDataCallback()

void EnigmaIOTjsonController::sendDataCallback ( sendData_cb  cb)
inline

Register send data callback to run when module needs to send a message.

Parameters
cbCallback with sendData_cb format

Definition at line 74 of file EnigmaIOTjsonController.h.

◆ sendJson()

bool EnigmaIOTjsonController::sendJson ( DynamicJsonDocument &  json)
inlineprotected

Sends a JSON encoded message to lower layer.

Returns
Returns true if message sending was successful. false otherwise

Definition at line 170 of file EnigmaIOTjsonController.h.

◆ sendStartAnouncement()

virtual bool EnigmaIOTjsonController::sendStartAnouncement ( )
protectedpure virtual

Send a message to notify node has started running.

Returns
Returns true if message sending was successful. false otherwise

Implemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

◆ setup()

virtual void EnigmaIOTjsonController::setup ( EnigmaIOTNodeClass node,
void *  config = NULL 
)
pure virtual

Initialize data structures.

Parameters
nodePointer to EnigmaIOT node instance
configPointer to configuration structure. If it is NULL then it tries to load configuration from flash

Implemented in CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, CONTROLLER_CLASS_NAME, and CONTROLLER_CLASS_NAME.

Member Data Documentation

◆ enigmaIotNode

EnigmaIOTNodeClass* EnigmaIOTjsonController::enigmaIotNode
protected

Definition at line 37 of file EnigmaIOTjsonController.h.

◆ sendData

sendData_cb EnigmaIOTjsonController::sendData
protected

Definition at line 36 of file EnigmaIOTjsonController.h.


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