Soletta™ Framework
|
MQTT Publish client. More...
Functions | |
int | main (int argc, char *argv[]) |
static void | on_connect (void *data, struct sol_mqtt *mqtt) |
static void | on_disconnect (void *data, struct sol_mqtt *mqtt) |
static void | on_message (void *data, struct sol_mqtt *mqtt, const struct sol_mqtt_message *message) |
static bool | try_reconnect (void *data) |
Variables | |
static char * | topic |
MQTT Publish client.
Sample client that connects a broker at host:port and subscribes to the provided topic. Whenever a new message is published to that topic, it is printed in the console.
int main | ( | int | argc, |
char * | argv[] | ||
) |
References sol_mqtt_config::api_version, sol_mqtt_config::host, on_connect(), on_disconnect(), on_message(), sol_mqtt_config::port, SOL_INF, sol_init(), SOL_MQTT_CONFIG_API_VERSION, sol_mqtt_connect(), sol_mqtt_disconnect(), SOL_MQTT_HANDLERS_API_VERSION, sol_run(), SOL_SET_API_VERSION, sol_shutdown(), SOL_WRN, and topic.
|
static |
References SOL_ERR, SOL_MQTT_CONNECTED, sol_mqtt_get_connection_status(), SOL_MQTT_QOS_AT_MOST_ONCE, sol_mqtt_subscribe(), sol_timeout_add(), SOL_WRN, topic, and try_reconnect().
Referenced by main().
|
static |
References SOL_INF, sol_timeout_add(), and try_reconnect().
Referenced by main().
|
static |
References sol_buffer::data, sol_mqtt_message::payload, SOL_INF, SOL_NULL_CHECK, and sol_buffer::used.
Referenced by main().
|
static |
References sol_mqtt_reconnect().
Referenced by on_connect(), and on_disconnect().
|
static |
Referenced by main(), and on_connect().