EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
#include <ButtonController.h>
Public Member Functions | |
void | setup (EnigmaIOTNodeClass *node, void *data=NULL) |
Initialize data structures. More... | |
bool | processRxCommand (const uint8_t *address, const uint8_t *buffer, uint8_t length, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding) override |
Called to process a downlink command. More... | |
void | loop () override |
This should be called periodically for module handling. More... | |
~CONTROLLER_CLASS_NAME () | |
void | configManagerStart () override |
Called when wifi manager starts config portal. More... | |
void | configManagerExit (bool status) override |
Called when wifi manager exits config portal. More... | |
bool | loadConfig () override |
Loads output module configuration. More... | |
void | connectInform () |
Used to notify controller that it is registered on EnigmaIOT network. More... | |
void | setup (EnigmaIOTNodeClass *node, void *data=NULL) |
Initialize data structures. More... | |
bool | processRxCommand (const uint8_t *address, const uint8_t *buffer, uint8_t length, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding) |
Called to process a downlink command. More... | |
void | loop () |
This should be called periodically for module handling. More... | |
~CONTROLLER_CLASS_NAME () | |
void | configManagerStart () |
Called when wifi manager starts config portal. More... | |
void | configManagerExit (bool status) |
Called when wifi manager exits config portal. More... | |
bool | loadConfig () |
Loads output module configuration. More... | |
void | connectInform () |
Used to notify controller that it is registered on EnigmaIOT network. More... | |
void | setup (EnigmaIOTNodeClass *node, void *data=NULL) |
Initializes controller structures. More... | |
bool | processRxCommand (const uint8_t *address, const uint8_t *buffer, uint8_t length, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding) |
Processes received GET or SET commands. More... | |
void | loop () |
Executes repetitive tasks on controller. More... | |
~CONTROLLER_CLASS_NAME () | |
Default destructor. More... | |
void | configManagerStart () |
Called when wifi manager starts config portal. More... | |
void | configManagerExit (bool status) |
Called when wifi manager exits config portal. More... | |
bool | loadConfig () |
Loads output module configuration. More... | |
void | connectInform () |
Executed as soon as node is registered on EnigmaIOT network. More... | |
void | setup (EnigmaIOTNodeClass *node, void *data=NULL) |
Initialize data structures. More... | |
bool | processRxCommand (const uint8_t *address, const uint8_t *buffer, uint8_t length, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding) |
Called to process a downlink command. More... | |
void | loop () |
This should be called periodically for module handling. More... | |
~CONTROLLER_CLASS_NAME () | |
void | configManagerStart () |
Called when wifi manager starts config portal. More... | |
void | configManagerExit (bool status) |
Called when wifi manager exits config portal. More... | |
bool | loadConfig () |
Loads output module configuration. More... | |
void | connectInform () |
Used to notify controller that it is registered on EnigmaIOT network. More... | |
void | setup (EnigmaIOTNodeClass *node, void *data=NULL) |
Initialize data structures. More... | |
bool | processRxCommand (const uint8_t *address, const uint8_t *buffer, uint8_t length, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding) |
Called to process a downlink command. More... | |
void | loop () |
This should be called periodically for module handling. More... | |
~CONTROLLER_CLASS_NAME () | |
void | configManagerStart () |
Called when wifi manager starts config portal. More... | |
void | configManagerExit (bool status) |
Called when wifi manager exits config portal. More... | |
bool | loadConfig () |
Loads output module configuration. More... | |
void | connectInform () |
Used to notify controller that it is registered on EnigmaIOT network. More... | |
void | setup (EnigmaIOTNodeClass *node, void *data=NULL) |
Initialize data structures. More... | |
bool | processRxCommand (const uint8_t *address, const uint8_t *buffer, uint8_t length, nodeMessageType_t command, nodePayloadEncoding_t payloadEncoding) |
Called to process a downlink command. More... | |
void | loop () |
This should be called periodically for module handling. More... | |
~CONTROLLER_CLASS_NAME () | |
void | configManagerStart () |
Called when wifi manager starts config portal. More... | |
void | configManagerExit (bool status) |
Called when wifi manager exits config portal. More... | |
bool | loadConfig () |
Loads output module configuration. More... | |
void | connectInform () |
Used to notify controller that it is registered on EnigmaIOT network. More... | |
Protected Member Functions | |
bool | saveConfig () override |
Saves output module configuration. More... | |
bool | sendCommandResp (const char *command, bool result) override |
Sends command processing response acknowledge. More... | |
bool | sendStartAnouncement () override |
Send a message to notify node has started running. More... | |
void | buildHADiscovery () |
bool | saveConfig () |
Saves output module configuration. More... | |
bool | sendCommandResp (const char *command, bool result) |
Sends command processing response acknowledge. More... | |
bool | sendStartAnouncement () |
Send a message to notify node has started running. More... | |
void | buildHADiscovery () |
bool | saveConfig () |
Saves output module configuration. More... | |
bool | sendCommandResp (const char *command, bool result) |
Send response to commands to gateway. More... | |
bool | sendStartAnouncement () |
Sends a notification message including configurable controller name and protocol version. More... | |
void | buildHADiscovery () |
Sends a HA discovery message for a single entity. Add as many functions like this as number of entities you need to create. More... | |
bool | saveConfig () |
Saves output module configuration. More... | |
bool | sendCommandResp (const char *command, bool result) |
Sends command processing response acknowledge. More... | |
bool | sendStartAnouncement () |
Send a message to notify node has started running. More... | |
void | buildHADiscovery () |
bool | sendLedStatus () |
bool | saveConfig () |
Saves output module configuration. More... | |
bool | sendCommandResp (const char *command, bool result) |
Sends command processing response acknowledge. More... | |
bool | sendStartAnouncement () |
Send a message to notify node has started running. More... | |
bool | sendTemperature (float temp) |
bool | saveConfig () |
Saves output module configuration. More... | |
bool | sendCommandResp (const char *command, bool result) |
Sends command processing response acknowledge. More... | |
bool | sendStartAnouncement () |
Send a message to notify node has started running. More... | |
void | buildHASwitchDiscovery () |
Sends a HA discovery message for a single entity. Add as many functions like this as number of entities you need to create. More... | |
void | buildHATriggerDiscovery () |
void | buildHALinkDiscovery () |
void | defaultConfig () |
void | toggleRelay () |
void | setRelay (bool state) |
bool | sendRelayStatus () |
void | setLinked (bool state) |
bool | sendLinkStatus () |
void | setBoot (int state) |
bool | sendBootStatus () |
Protected Attributes | |
bool | pushTriggered = false |
bool | pushReleased = true |
bool | buttonPressSent = false |
int | led = _LED_OFF |
OneWire * | oneWire |
DallasTemperature * | sensors |
DeviceAddress | insideThermometer |
bool | tempSent = false |
float | tempC |
smartSwitchControllerHw_t | config |
AsyncWiFiManagerParameter * | buttonPinParam |
AsyncWiFiManagerParameter * | relayPinParam |
AsyncWiFiManagerParameter * | bootStatusParam |
AsyncWiFiManagerParameter * | bootStatusListParam |
Additional Inherited Members | |
Private Member Functions inherited from EnigmaIOTjsonController | |
void | sendDataCallback (sendData_cb cb) |
Register send data callback to run when module needs to send a message. More... | |
virtual void | disconnectInform (nodeInvalidateReason_t reason) |
Used to notify controller that it is unregistered on EnigmaIOT network. More... | |
bool | sendJson (DynamicJsonDocument &json) |
Sends a JSON encoded message to lower layer. More... | |
Private Attributes inherited from EnigmaIOTjsonController | |
sendData_cb | sendData |
EnigmaIOTNodeClass * | enigmaIotNode |
Definition at line 27 of file ButtonController.h.
CONTROLLER_CLASS_NAME::~CONTROLLER_CLASS_NAME | ( | ) |
Definition at line 98 of file ButtonController.cpp.
CONTROLLER_CLASS_NAME::~CONTROLLER_CLASS_NAME | ( | ) |
CONTROLLER_CLASS_NAME::~CONTROLLER_CLASS_NAME | ( | ) |
Default destructor.
CONTROLLER_CLASS_NAME::~CONTROLLER_CLASS_NAME | ( | ) |
CONTROLLER_CLASS_NAME::~CONTROLLER_CLASS_NAME | ( | ) |
CONTROLLER_CLASS_NAME::~CONTROLLER_CLASS_NAME | ( | ) |
|
protected |
Definition at line 124 of file ButtonController.cpp.
|
protected |
|
protected |
Sends a HA discovery message for a single entity. Add as many functions like this as number of entities you need to create.
|
protected |
|
protected |
|
protected |
Sends a HA discovery message for a single entity. Add as many functions like this as number of entities you need to create.
|
protected |
|
virtual |
Called when wifi manager exits config portal.
status | true if configuration was successful |
Implements EnigmaIOTjsonController.
|
virtual |
Called when wifi manager exits config portal.
status | true if configuration was successful |
Implements EnigmaIOTjsonController.
|
virtual |
Called when wifi manager exits config portal.
status | true if configuration was successful |
Implements EnigmaIOTjsonController.
|
virtual |
Called when wifi manager exits config portal.
status | true if configuration was successful |
Implements EnigmaIOTjsonController.
|
virtual |
Called when wifi manager exits config portal.
status | true if configuration was successful |
Implements EnigmaIOTjsonController.
|
overridevirtual |
Called when wifi manager exits config portal.
status | true if configuration was successful |
Implements EnigmaIOTjsonController.
Definition at line 109 of file ButtonController.cpp.
|
virtual |
Called when wifi manager starts config portal.
Implements EnigmaIOTjsonController.
|
virtual |
Called when wifi manager starts config portal.
Implements EnigmaIOTjsonController.
|
virtual |
Called when wifi manager starts config portal.
node | Pointer to EnigmaIOT gateway instance |
Implements EnigmaIOTjsonController.
|
virtual |
Called when wifi manager starts config portal.
node | Pointer to EnigmaIOT gateway instance |
Implements EnigmaIOTjsonController.
|
virtual |
Called when wifi manager starts config portal.
node< | Pointer to EnigmaIOT gateway instance |
Implements EnigmaIOTjsonController.
|
overridevirtual |
Called when wifi manager starts config portal.
Implements EnigmaIOTjsonController.
Definition at line 103 of file ButtonController.cpp.
|
virtual |
Used to notify controller that it is registered on EnigmaIOT network.
Reimplemented from EnigmaIOTjsonController.
Definition at line 31 of file ButtonController.cpp.
|
virtual |
Used to notify controller that it is registered on EnigmaIOT network.
Reimplemented from EnigmaIOTjsonController.
|
virtual |
Executed as soon as node is registered on EnigmaIOT network.
Reimplemented from EnigmaIOTjsonController.
|
virtual |
Used to notify controller that it is registered on EnigmaIOT network.
Reimplemented from EnigmaIOTjsonController.
|
virtual |
Used to notify controller that it is registered on EnigmaIOT network.
Reimplemented from EnigmaIOTjsonController.
|
virtual |
Used to notify controller that it is registered on EnigmaIOT network.
Reimplemented from EnigmaIOTjsonController.
|
protected |
Definition at line 382 of file SmartSwitchController.cpp.
|
virtual |
Loads output module configuration.
true
if load was successful. false
otherwise Implements EnigmaIOTjsonController.
|
virtual |
Loads output module configuration.
true
if load was successful. false
otherwise Implements EnigmaIOTjsonController.
|
virtual |
Loads output module configuration.
true
if load was successful. false
otherwise Implements EnigmaIOTjsonController.
|
virtual |
Loads output module configuration.
true
if load was successful. false
otherwise Implements EnigmaIOTjsonController.
|
virtual |
Loads output module configuration.
true
if load was successful. false
otherwise Implements EnigmaIOTjsonController.
|
overridevirtual |
Loads output module configuration.
true
if load was successful. false
otherwise Implements EnigmaIOTjsonController.
Definition at line 114 of file ButtonController.cpp.
|
virtual |
This should be called periodically for module handling.
Implements EnigmaIOTjsonController.
|
virtual |
Executes repetitive tasks on controller.
Implements EnigmaIOTjsonController.
|
virtual |
This should be called periodically for module handling.
Implements EnigmaIOTjsonController.
|
virtual |
This should be called periodically for module handling.
Implements EnigmaIOTjsonController.
|
virtual |
This should be called periodically for module handling.
Implements EnigmaIOTjsonController.
|
overridevirtual |
This should be called periodically for module handling.
Implements EnigmaIOTjsonController.
Definition at line 53 of file ButtonController.cpp.
|
virtual |
Called to process a downlink command.
mac | Address of sender |
buffer | Message bytes |
length | Message length |
command | Type of command. nodeMessageType_t |
payloadEncoding | Payload encoding of type nodePayloadEncoding_t |
true
on success Implements EnigmaIOTjsonController.
|
virtual |
Processes received GET or SET commands.
address | Origin MAC address |
buffer | Command payload |
length | Payload length in bytes |
command | Command type. nodeMessageType_t::DOWNSTREAM_DATA_GET or nodeMessageType_t::DOWNSTREAM_DATA_SET |
payloadEncoding | Payload encoding. MSG_PACK is recommended |
Implements EnigmaIOTjsonController.
|
virtual |
Called to process a downlink command.
mac | Address of sender |
buffer | Message bytes |
length | Message length |
command | Type of command. nodeMessageType_t |
payloadEncoding | Payload encoding of type nodePayloadEncoding_t |
true
on success Implements EnigmaIOTjsonController.
|
virtual |
Called to process a downlink command.
mac | Address of sender |
buffer | Message bytes |
length | Message length |
command | Type of command. nodeMessageType_t |
payloadEncoding | Payload encoding of type nodePayloadEncoding_t |
true
on success Implements EnigmaIOTjsonController.
|
virtual |
Called to process a downlink command.
mac | Address of sender |
buffer | Message bytes |
length | Message length |
command | Type of command. nodeMessageType_t |
payloadEncoding | Payload encoding of type nodePayloadEncoding_t |
true
on success Implements EnigmaIOTjsonController.
|
overridevirtual |
Called to process a downlink command.
mac | Address of sender |
buffer | Message bytes |
length | Message length |
command | Type of command. nodeMessageType_t |
payloadEncoding | Payload encoding of type nodePayloadEncoding_t |
true
on success Implements EnigmaIOTjsonController.
Definition at line 19 of file ButtonController.cpp.
|
protectedvirtual |
Saves output module configuration.
true
if save was successful. false
otherwise Implements EnigmaIOTjsonController.
|
protectedvirtual |
Saves output module configuration.
true
if save was successful. false
otherwise Implements EnigmaIOTjsonController.
|
protectedvirtual |
Saves output module configuration.
true
if save was successful. false
otherwise Implements EnigmaIOTjsonController.
|
protectedvirtual |
Saves output module configuration.
true
if save was successful. false
otherwise Implements EnigmaIOTjsonController.
|
protectedvirtual |
Saves output module configuration.
true
if save was successful. false
otherwise Implements EnigmaIOTjsonController.
|
overrideprotectedvirtual |
Saves output module configuration.
true
if save was successful. false
otherwise Implements EnigmaIOTjsonController.
Definition at line 119 of file ButtonController.cpp.
|
protected |
Definition at line 160 of file SmartSwitchController.cpp.
|
protectedvirtual |
Sends command processing response acknowledge.
command | Command name |
result | Command execution success |
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
|
protectedvirtual |
Send response to commands to gateway.
command | Refered command |
result | true if command was correctly executed, false otherwise |
Implements EnigmaIOTjsonController.
|
protectedvirtual |
Sends command processing response acknowledge.
command | Command name |
result | Command execution success |
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
|
protectedvirtual |
Sends command processing response acknowledge.
command | Command name |
result | Command execution success |
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
|
protectedvirtual |
Sends command processing response acknowledge.
command | Command name |
result | Command execution success |
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
|
overrideprotectedvirtual |
Sends command processing response acknowledge.
command | Command name |
result | Command execution success |
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
Definition at line 26 of file ButtonController.cpp.
|
protected |
Definition at line 105 of file LedController.cpp.
|
protected |
Definition at line 150 of file SmartSwitchController.cpp.
|
protected |
Definition at line 138 of file SmartSwitchController.cpp.
|
inlineprotectedvirtual |
Send a message to notify node has started running.
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
Definition at line 73 of file DashButtonController.h.
|
inlineprotectedvirtual |
Sends a notification message including configurable controller name and protocol version.
Implements EnigmaIOTjsonController.
Definition at line 99 of file BasicController.h.
|
inlineprotectedvirtual |
Send a message to notify node has started running.
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
Definition at line 78 of file LedController.h.
|
inlineprotectedvirtual |
Send a message to notify node has started running.
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
Definition at line 81 of file ds18b20Controller.h.
|
inlineprotectedvirtual |
Send a message to notify node has started running.
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
Definition at line 101 of file SmartSwitchController.h.
|
inlineoverrideprotectedvirtual |
Send a message to notify node has started running.
true
if message sending was successful. false
otherwise Implements EnigmaIOTjsonController.
Definition at line 72 of file ButtonController.h.
|
protected |
Definition at line 35 of file ds18b20Controller.cpp.
|
protected |
Definition at line 250 of file SmartSwitchController.cpp.
|
protected |
Definition at line 240 of file SmartSwitchController.cpp.
|
protected |
Definition at line 227 of file SmartSwitchController.cpp.
|
virtual |
Initialize data structures.
node | Pointer to EnigmaIOT node instance |
config | Pointer to configuration structure. If it is NULL then it tries to load configuration from flash |
Implements EnigmaIOTjsonController.
Definition at line 40 of file ButtonController.cpp.
|
virtual |
Initialize data structures.
node | Pointer to EnigmaIOT node instance |
config | Pointer to configuration structure. If it is NULL then it tries to load configuration from flash |
Implements EnigmaIOTjsonController.
|
virtual |
Initializes controller structures.
node | Pointer to EnigmaIOT gateway instance |
data | Parameter data for controller |
Implements EnigmaIOTjsonController.
|
virtual |
Initialize data structures.
node | Pointer to EnigmaIOT node instance |
config | Pointer to configuration structure. If it is NULL then it tries to load configuration from flash |
Implements EnigmaIOTjsonController.
|
virtual |
Initialize data structures.
node | Pointer to EnigmaIOT node instance |
config | Pointer to configuration structure. If it is NULL then it tries to load configuration from flash |
Implements EnigmaIOTjsonController.
|
virtual |
Initialize data structures.
node | Pointer to EnigmaIOT node instance |
config | Pointer to configuration structure. If it is NULL then it tries to load configuration from flash |
Implements EnigmaIOTjsonController.
|
protected |
Definition at line 213 of file SmartSwitchController.cpp.
|
protected |
Definition at line 61 of file SmartSwitchController.h.
|
protected |
Definition at line 60 of file SmartSwitchController.h.
|
protected |
Definition at line 58 of file SmartSwitchController.h.
|
protected |
Definition at line 35 of file DashButtonController.h.
|
protected |
Definition at line 57 of file SmartSwitchController.h.
|
protected |
Definition at line 39 of file ds18b20Controller.h.
|
protected |
Definition at line 38 of file LedController.h.
|
protected |
Definition at line 37 of file ds18b20Controller.h.
|
protected |
Definition at line 33 of file ButtonController.h.
|
protected |
Definition at line 32 of file ButtonController.h.
|
protected |
Definition at line 59 of file SmartSwitchController.h.
|
protected |
Definition at line 38 of file ds18b20Controller.h.
|
protected |
Definition at line 41 of file ds18b20Controller.h.
|
protected |
Definition at line 40 of file ds18b20Controller.h.