|
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
19 #define CONTROLLER_CLASS_NAME LedController
22 #if SUPPORT_HA_DISCOVERY
31 #define _LED_OFF !_LED_ON
80 const size_t capacity = JSON_OBJECT_SIZE (10);
81 DynamicJsonDocument json (capacity);
82 json[
"status"] =
"start";
85 snprintf (version_buf, 10,
"%d.%d.%d",
87 json[
"version"] = String (version_buf);
void configManagerStart()
Called when wifi manager starts config portal.
nodeMessageType
Message code definition.
static const char * CONTROLLER_NAME
void loop()
This should be called periodically for module handling.
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)
Called to process a downlink command.
bool saveConfig()
Saves output module configuration.
Home Assistant switch integration.
bool sendJson(DynamicJsonDocument &json)
Sends a JSON encoded message to lower layer.
bool sendCommandResp(const char *command, bool result)
Sends command processing response acknowledge.
void connectInform()
Used to notify controller that it 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)
Initialize data structures.
Prototype for JSON/MSGPACK based controller node.
bool sendStartAnouncement()
Send a message to notify node has started running.
bool loadConfig()
Loads output module configuration.