|
GrowNode
|
Macros | |
| #define | _GN_MQTT_MAX_TOPIC_LENGTH 80 |
| #define | _GN_MQTT_MAX_PAYLOAD_LENGTH CONFIG_GROWNODE_MQTT_BUFFER_SIZE |
| #define | _GN_MQTT_COMMAND_MESS "cmd" |
| #define | _GN_MQTT_STATUS_MESS "sts" |
| #define | _GN_MQTT_LOG_MESS "log" |
| #define | _GN_MQTT_PAYLOAD_RST "RST" |
| #define | _GN_MQTT_PAYLOAD_OTA "OTA" |
| #define | _GN_MQTT_PAYLOAD_RBT "RBT" |
| #define | _GN_MQTT_DEFAULT_QOS 0 |
Functions | |
| gn_err_t | gn_mqtt_publish_leaf (gn_leaf_handle_t leaf_config) |
| subscribe leaf to the MQTT server in order to receive messages More... | |
| esp_err_t | gn_mqtt_subscribe_leaf_param (gn_leaf_param_handle_t param) |
| gn_err_t | gn_mqtt_init (gn_config_handle_t config) |
| inits the MQTT subsystem More... | |
| gn_err_t | gn_mqtt_send_node_config (gn_node_handle_t conf) |
| send node parameters via JSON message to the server More... | |
| gn_err_t | gn_mqtt_send_leaf_message (gn_leaf_handle_t leaf, const char *msg) |
| gn_err_t | gn_mqtt_send_leaf_param (gn_leaf_param_handle_t config) |
| gn_err_t | gn_mqtt_send_startup_message (gn_config_handle_t _config) |
| gn_err_t | gn_mqtt_send_reboot_message (gn_config_handle_t _config) |
| gn_err_t | gn_mqtt_send_reset_message (gn_config_handle_t _config) |
| gn_err_t | gn_mqtt_send_ota_message (gn_config_handle_t _config) |
| gn_err_t | gn_mqtt_send_log_message (gn_config_handle_t _config, char *log_tag, gn_log_level_t level, char *message) |
| sends log message via MQTT More... | |
| #define _GN_MQTT_COMMAND_MESS "cmd" |
| #define _GN_MQTT_DEFAULT_QOS 0 |
| #define _GN_MQTT_LOG_MESS "log" |
| #define _GN_MQTT_MAX_PAYLOAD_LENGTH CONFIG_GROWNODE_MQTT_BUFFER_SIZE |
| #define _GN_MQTT_MAX_TOPIC_LENGTH 80 |
| #define _GN_MQTT_PAYLOAD_OTA "OTA" |
| #define _GN_MQTT_PAYLOAD_RBT "RBT" |
| #define _GN_MQTT_PAYLOAD_RST "RST" |
| #define _GN_MQTT_STATUS_MESS "sts" |
| gn_err_t gn_mqtt_init | ( | gn_config_handle_t | config | ) |
inits the MQTT subsystem
| config | the configuration to use |
| gn_err_t gn_mqtt_publish_leaf | ( | gn_leaf_handle_t | _leaf_config | ) |
subscribe leaf to the MQTT server in order to receive messages
| leaf_config | the leaf to start |
| gn_err_t gn_mqtt_send_leaf_message | ( | gn_leaf_handle_t | _leaf, |
| const char * | msg | ||
| ) |
@sends a command message to the specific leaf
| _leaf | the recipient leaf |
| msg | payload |
| gn_err_t gn_mqtt_send_leaf_param | ( | gn_leaf_param_handle_t | config | ) |
| gn_err_t gn_mqtt_send_log_message | ( | gn_config_handle_t | _config, |
| char * | log_tag, | ||
| gn_log_level_t | level, | ||
| char * | message | ||
| ) |
sends log message via MQTT
this uses the log level of the tag in understanding if the message has to be sent, in a similar way to ESP_LOGX
| _config | the configuration to use |
| log_tag | the tag to be checked against |
| level | the log level to be checked |
| message | the payload |
| gn_err_t gn_mqtt_send_node_config | ( | gn_node_handle_t | _node_config | ) |
send node parameters via JSON message to the server
this sends only if the node has already been started (status = GN_CONFIG_STATUS_STARTED)
| _node_config | the node to publish |
| gn_err_t gn_mqtt_send_ota_message | ( | gn_config_handle_t | _config | ) |
@sends a JSON message saying the board is going to download the firmware
payload is {"msgtype":"OTA"}
| _config | the configuration to use |
| gn_err_t gn_mqtt_send_reboot_message | ( | gn_config_handle_t | _config | ) |
@sends a JSON message saying the board is rebooted
payload is {"msgtype":"RBT"}
| _config | the configuration to use |
| gn_err_t gn_mqtt_send_reset_message | ( | gn_config_handle_t | _config | ) |
@sends a JSON message saying the board is going to reset
payload is {"msgtype":"RST"}
| _config | the configuration to use |
| gn_err_t gn_mqtt_send_startup_message | ( | gn_config_handle_t | _config | ) |
@sends a JSON message saying the board is online
payload is {"msgtype":"online"}
| _config | the configuration to use |
| esp_err_t gn_mqtt_subscribe_leaf_param | ( | gn_leaf_param_handle_t | param | ) |