GrowNode
|
Data Structures | |
struct | gn_mqtt_startup_message_t |
struct | gn_mqtt_node_config_message_t |
Macros | |
#define | TAG "gn_mqtt_protocol" |
Typedefs | |
typedef gn_mqtt_startup_message_t * | gn_mqtt_startup_message_handle_t |
typedef gn_mqtt_node_config_message_t * | gn_mqtt_node_config_message_handle_t |
Variables | |
EventGroupHandle_t | _gn_event_group_mqtt |
const int | _GN_MQTT_CONNECTED_OK_EVENT_BIT = BIT0 |
const int | _GN_MQTT_CONNECTED_KO_EVENT_BIT = BIT1 |
char | _gn_cmd_topic [_GN_MQTT_MAX_TOPIC_LENGTH] |
char | _gn_sts_topic [_GN_MQTT_MAX_TOPIC_LENGTH] |
char | _gn_log_topic [_GN_MQTT_MAX_TOPIC_LENGTH] |
char | __nodename [13] = "" |
#define TAG "gn_mqtt_protocol" |
void _gn_mqtt_build_command_topic | ( | gn_config_handle_intl_t | config, |
char * | buf | ||
) |
void _gn_mqtt_build_leaf_command_topic | ( | gn_leaf_handle_t | _leaf_config, |
char * | buf | ||
) |
void _gn_mqtt_build_leaf_parameter_command_topic | ( | const gn_leaf_handle_t | _leaf_config, |
const char * | param_name, | ||
char * | buf | ||
) |
void _gn_mqtt_build_leaf_parameter_status_topic | ( | gn_leaf_handle_t | _leaf_config, |
char * | param_name, | ||
char * | buf | ||
) |
void _gn_mqtt_build_leaf_status_topic | ( | gn_leaf_handle_t | _leaf_config, |
char * | buf | ||
) |
void _gn_mqtt_build_log_topic | ( | gn_config_handle_intl_t | config, |
char * | buf | ||
) |
|
inline |
void _gn_mqtt_build_status_topic | ( | gn_config_handle_intl_t | config, |
char * | buf | ||
) |
void _gn_mqtt_event_handler | ( | void * | handler_args, |
esp_event_base_t | base, | ||
int32_t | event_id, | ||
void * | event_data | ||
) |
esp_err_t _gn_mqtt_on_connected | ( | gn_config_handle_t | config | ) |
esp_err_t _gn_mqtt_on_disconnected | ( | gn_config_handle_t | config | ) |
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 | _param | ) |
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 |
gn_err_t gn_mqtt_subscribe_leaf_param | ( | gn_leaf_param_handle_t | _param | ) |
void log_error_if_nonzero | ( | const char * | message, |
int | error_code | ||
) |
char __nodename[13] = "" |
char _gn_cmd_topic[_GN_MQTT_MAX_TOPIC_LENGTH] |
EventGroupHandle_t _gn_event_group_mqtt |
char _gn_log_topic[_GN_MQTT_MAX_TOPIC_LENGTH] |
const int _GN_MQTT_CONNECTED_KO_EVENT_BIT = BIT1 |
const int _GN_MQTT_CONNECTED_OK_EVENT_BIT = BIT0 |
char _gn_sts_topic[_GN_MQTT_MAX_TOPIC_LENGTH] |