ReactOS 0.4.16-dev-297-gc569aee
mqtt.h File Reference
#include "lwip/apps/mqtt_opts.h"
#include "lwip/err.h"
#include "lwip/ip_addr.h"
#include "lwip/prot/iana.h"
Include dependency graph for mqtt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mqtt_connect_client_info_t
 

Macros

#define MQTT_PORT   LWIP_IANA_PORT_MQTT
 
#define MQTT_TLS_PORT   LWIP_IANA_PORT_SECURE_MQTT
 
#define mqtt_subscribe(client, topic, qos, cb, arg)   mqtt_sub_unsub(client, topic, qos, cb, arg, 1)
 
#define mqtt_unsubscribe(client, topic, cb, arg)   mqtt_sub_unsub(client, topic, 0, cb, arg, 0)
 

Typedefs

typedef struct mqtt_client_s mqtt_client_t
 
typedef void(* mqtt_connection_cb_t) (mqtt_client_t *client, void *arg, mqtt_connection_status_t status)
 
typedef void(* mqtt_incoming_data_cb_t) (void *arg, const u8_t *data, u16_t len, u8_t flags)
 
typedef void(* mqtt_incoming_publish_cb_t) (void *arg, const char *topic, u32_t tot_len)
 
typedef void(* mqtt_request_cb_t) (void *arg, err_t err)
 

Enumerations

enum  mqtt_connection_status_t {
  MQTT_CONNECT_ACCEPTED = 0 , MQTT_CONNECT_REFUSED_PROTOCOL_VERSION = 1 , MQTT_CONNECT_REFUSED_IDENTIFIER = 2 , MQTT_CONNECT_REFUSED_SERVER = 3 ,
  MQTT_CONNECT_REFUSED_USERNAME_PASS = 4 , MQTT_CONNECT_REFUSED_NOT_AUTHORIZED_ = 5 , MQTT_CONNECT_DISCONNECTED = 256 , MQTT_CONNECT_TIMEOUT = 257
}
 
enum  { MQTT_DATA_FLAG_LAST = 1 }
 

Functions

err_t mqtt_client_connect (mqtt_client_t *client, const ip_addr_t *ipaddr, u16_t port, mqtt_connection_cb_t cb, void *arg, const struct mqtt_connect_client_info_t *client_info)
 
void mqtt_disconnect (mqtt_client_t *client)
 
mqtt_client_tmqtt_client_new (void)
 
void mqtt_client_free (mqtt_client_t *client)
 
u8_t mqtt_client_is_connected (mqtt_client_t *client)
 
void mqtt_set_inpub_callback (mqtt_client_t *client, mqtt_incoming_publish_cb_t pub_cb, mqtt_incoming_data_cb_t data_cb, void *arg)
 
err_t mqtt_sub_unsub (mqtt_client_t *client, const char *topic, u8_t qos, mqtt_request_cb_t cb, void *arg, u8_t sub)
 
err_t mqtt_publish (mqtt_client_t *client, const char *topic, const void *payload, u16_t payload_length, u8_t qos, u8_t retain, mqtt_request_cb_t cb, void *arg)
 

Detailed Description

MQTT client

Definition in file mqtt.h.

Typedef Documentation

◆ mqtt_client_t

Definition at line 49 of file mqtt.h.

Function Documentation

◆ mqtt_client_connect()

err_t mqtt_client_connect ( mqtt_client_t client,
const ip_addr_t ipaddr,
u16_t  port,
mqtt_connection_cb_t  cb,
void arg,
const struct mqtt_connect_client_info_t client_info 
)

Referenced by START_TEST().

◆ mqtt_client_free()

void mqtt_client_free ( mqtt_client_t client)

◆ mqtt_client_is_connected()

u8_t mqtt_client_is_connected ( mqtt_client_t client)

◆ mqtt_client_new()

mqtt_client_t * mqtt_client_new ( void  )

Referenced by START_TEST().

◆ mqtt_disconnect()

void mqtt_disconnect ( mqtt_client_t client)

Referenced by START_TEST().

◆ mqtt_publish()

err_t mqtt_publish ( mqtt_client_t client,
const char topic,
const void payload,
u16_t  payload_length,
u8_t  qos,
u8_t  retain,
mqtt_request_cb_t  cb,
void arg 
)

◆ mqtt_set_inpub_callback()

void mqtt_set_inpub_callback ( mqtt_client_t client,
mqtt_incoming_publish_cb_t  pub_cb,
mqtt_incoming_data_cb_t  data_cb,
void arg 
)

◆ mqtt_sub_unsub()

err_t mqtt_sub_unsub ( mqtt_client_t client,
const char topic,
u8_t  qos,
mqtt_request_cb_t  cb,
void arg,
u8_t  sub 
)