|
EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
Go to the documentation of this file.
3 #ifndef _BASICCONTROLLER_h
4 #define _BASICCONTROLLER_h
6 #if defined(ARDUINO) && ARDUINO >= 100
15 #define CONTROLLER_CLASS_NAME BasicController
18 #if SUPPORT_HA_DISCOVERY
101 const size_t capacity = JSON_OBJECT_SIZE (10);
102 DynamicJsonDocument json (capacity);
103 json[
"status"] =
"start";
105 char version_buf[10];
106 snprintf (version_buf, 10,
"%d.%d.%d",
108 json[
"version"] = String (version_buf);
void configManagerStart()
Called when wifi manager starts config portal.
nodeMessageType
Message code definition.
void loop()
Executes repetitive tasks on controller.
static const uint8_t ENIGMAIOT_PROT_VERS[3]
EnitmaIoT Version.
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.
bool saveConfig()
Saves output module configuration.
void buildHADiscovery()
Sends a HA discovery message for a single entity. Add as many functions like this as number of entiti...
bool sendJson(DynamicJsonDocument &json)
Sends a JSON encoded message to lower layer.
bool sendCommandResp(const char *command, bool result)
Send response to commands to gateway.
~CONTROLLER_CLASS_NAME()
Default destructor.
Home Assistant trigger integration.
void connectInform()
Executed as soon as node is registered on EnigmaIOT network.
void configManagerExit(bool status)
Called when wifi manager exits config portal.
Main node class. Manages communication with gateway and allows sending and receiving user data.
void setup(EnigmaIOTNodeClass *node, void *data=NULL)
Initializes controller structures.
Prototype for JSON/MSGPACK based controller node.
bool sendStartAnouncement()
Sends a notification message including configurable controller name and protocol version.
bool loadConfig()
Loads output module configuration.
static const char * CONTROLLER_NAME