lwIP
2.0.2
Lightweight IP stack
|
#include "lwip/apps/mqtt.h"
#include "lwip/timeouts.h"
#include "lwip/ip_addr.h"
#include "lwip/mem.h"
#include "lwip/err.h"
#include "lwip/pbuf.h"
#include "lwip/tcp.h"
#include <string.h>
Macros | |
#define | MQTT_DEBUG LWIP_DBG_OFF |
#define | MQTT_CTL_PACKET_TYPE(fixed_hdr_byte0) ((fixed_hdr_byte0 & 0xf0) >> 4) |
#define | mqtt_ringbuf_put(rb, item) ((rb)->buf)[(rb)->put++ & MQTT_RINGBUF_IDX_MASK] = (item) |
#define | mqtt_ringbuf_len(rb) ((u16_t)((rb)->put - (rb)->get)) |
#define | mqtt_ringbuf_free(rb) (MQTT_OUTPUT_RINGBUF_SIZE - mqtt_ringbuf_len(rb)) |
#define | mqtt_ringbuf_linear_read_length(rb) LWIP_MIN(mqtt_ringbuf_len(rb), (MQTT_OUTPUT_RINGBUF_SIZE - ((rb)->get & MQTT_RINGBUF_IDX_MASK))) |
#define | mqtt_ringbuf_get_ptr(rb) (&(rb)->buf[(rb)->get & MQTT_RINGBUF_IDX_MASK]) |
Enumerations | |
enum | |
enum | mqtt_message_type |
enum | mqtt_connect_flag |
Functions | |
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) |
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) |
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_client_t * | mqtt_client_new (void) |
err_t | mqtt_client_connect (mqtt_client_t *client, const ip_addr_t *ip_addr, 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) |
u8_t | mqtt_client_is_connected (mqtt_client_t *client) |
MQTT client
#define MQTT_CTL_PACKET_TYPE | ( | fixed_hdr_byte0 | ) | ((fixed_hdr_byte0 & 0xf0) >> 4) |
Helpers to extract control packet type and qos from first byte in fixed header
#define MQTT_DEBUG LWIP_DBG_OFF |
MQTT_DEBUG: Default is off.
#define mqtt_ringbuf_free | ( | rb | ) | (MQTT_OUTPUT_RINGBUF_SIZE - mqtt_ringbuf_len(rb)) |
Return number of bytes free in ring buffer
#define mqtt_ringbuf_get_ptr | ( | rb | ) | (&(rb)->buf[(rb)->get & MQTT_RINGBUF_IDX_MASK]) |
Return pointer to ring buffer get position
#define mqtt_ringbuf_len | ( | rb | ) | ((u16_t)((rb)->put - (rb)->get)) |
Return number of bytes in ring buffer
#define mqtt_ringbuf_linear_read_length | ( | rb | ) | LWIP_MIN(mqtt_ringbuf_len(rb), (MQTT_OUTPUT_RINGBUF_SIZE - ((rb)->get & MQTT_RINGBUF_IDX_MASK))) |
Return number of bytes possible to read without wrapping around
#define mqtt_ringbuf_put | ( | rb, | |
item | |||
) | ((rb)->buf)[(rb)->put++ & MQTT_RINGBUF_IDX_MASK] = (item) |
Add single item to ring buffer
anonymous enum |
MQTT client connection states
enum mqtt_connect_flag |
MQTT connect flags, only used in CONNECT message
enum mqtt_message_type |
MQTT control message types