MQTT management interface. More...
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
union | net_mqtt_t |
Opaque MQTT handle. More... | |
Typedefs | |
typedef union net_mqtt_t | net_mqtt_t |
Opaque MQTT handle. More... | |
typedef void(* | net_mqtt_connect_callback_t) (net_mqtt_t *mqtt, net_mqtt_status_t status, void *user_data) |
Callback invoked on connection state changes and errors. More... | |
Enumerations | |
enum | net_mqtt_status_t { net_mqtt_status_connected_t, net_mqtt_status_disconnected_t, net_mqtt_status_dns_error_t = (1 << 2), net_mqtt_status_protocol_error_t, net_mqtt_status_auth_error_t, net_mqtt_status_timeout_t, net_mqtt_status_error_t } |
Connection/event status flags for MQTT operations. More... | |
Functions | |
net_mqtt_t | net_mqtt_init (net_mqtt_connect_callback_t connect, void *user_data) |
Create and initialize an MQTT handle. More... | |
bool | net_mqtt_valid (net_mqtt_t *mqtt) |
Check whether an MQTT client is valid and connected. More... | |
void | net_mqtt_finalize (net_mqtt_t *mqtt) |
Finalize the MQTT handle and free associated resources. More... | |
bool | net_mqtt_connect (net_mqtt_t *mqtt, const char *hostname, uint16_t port, const char *client_id, const char *user, const char *password, uint16_t keepalive_secs, const char *will_topic, const char *will_message) |
Begin an asynchronous connection to an MQTT broker. More... | |
bool | net_mqtt_disconnect (net_mqtt_t *mqtt) |
Begin an asynchronous disconnect from the MQTT broker. More... | |
bool | net_mqtt_publish (net_mqtt_t *mqtt, const char *topic, const void *data, size_t size, uint8_t qos) |
Publish a message to a topic. More... | |
static bool | net_mqtt_publish_str (net_mqtt_t *mqtt, const char *topic, const char *str, uint8_t qos) |
Publish a NULL-terminated string to a topic. More... | |
bool | net_mqtt_subscribe (net_mqtt_t *mqtt, const char *topic, uint8_t qos) |
Subscribe to a topic. More... | |