oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
net_mqtt.h File Reference
#include "ove/types.h"
#include "ove/net.h"
#include "ove_config.h"
#include "ove/storage.h"
Include dependency graph for net_mqtt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ove_mqtt_config_t
 MQTT connection configuration. More...
 

Macros

#define OVE_MQTT_QOS0   ((ove_mqtt_qos_t)0)
 
#define OVE_MQTT_QOS1   ((ove_mqtt_qos_t)1)
 

Typedefs

typedef uint8_t ove_mqtt_qos_t
 MQTT QoS level.
 
typedef void(* ove_mqtt_msg_cb) (const char *topic, size_t topic_len, const void *payload, size_t payload_len, void *user_data)
 MQTT message callback.
 

Functions

int ove_mqtt_client_init (ove_mqtt_client_t *client, ove_mqtt_client_storage_t *storage)
 Initialise an MQTT client from caller-supplied storage.
 
void ove_mqtt_client_deinit (ove_mqtt_client_t client)
 De-initialise an MQTT client.
 
int ove_mqtt_connect (ove_mqtt_client_t client, const ove_mqtt_config_t *cfg)
 Connect to an MQTT broker.
 
void ove_mqtt_disconnect (ove_mqtt_client_t client)
 Disconnect from the MQTT broker.
 
int ove_mqtt_publish (ove_mqtt_client_t client, const char *topic, const void *payload, size_t payload_len, ove_mqtt_qos_t qos)
 Publish a message.
 
int ove_mqtt_subscribe (ove_mqtt_client_t client, const char *topic, ove_mqtt_qos_t qos)
 Subscribe to a topic.
 
int ove_mqtt_unsubscribe (ove_mqtt_client_t client, const char *topic)
 Unsubscribe from a topic.
 
int ove_mqtt_loop (ove_mqtt_client_t client, uint64_t timeout_ns)
 Process incoming packets and send keep-alive pings.
 
int ove_mqtt_client_create (ove_mqtt_client_t *client)
 Heap-allocate and initialise an MQTT client.
 
void ove_mqtt_client_destroy (ove_mqtt_client_t client)
 Destroy a heap-allocated MQTT client.