34#include "espressif/c_types.h"
37#define MQTT_CONF_USERNAME_LENGTH 40+1
38#ifndef MQTT_CONF_USERNAME_LENGTH
39#define MQTT_CONF_USERNAME_LENGTH 13
42#define MQTT_CONF_PASSWORD_LENGTH 16+1
43#ifndef MQTT_CONF_PASSWORD_LENGTH
44#define MQTT_CONF_PASSWORD_LENGTH 13
48#define MQTT_MSG_CONNECT 1<<4
49#define MQTT_MSG_CONNACK 2<<4
50#define MQTT_MSG_PUBLISH 3<<4
51#define MQTT_MSG_PUBACK 4<<4
52#define MQTT_MSG_PUBREC 5<<4
53#define MQTT_MSG_PUBREL 6<<4
54#define MQTT_MSG_PUBCOMP 7<<4
55#define MQTT_MSG_SUBSCRIBE 8<<4
56#define MQTT_MSG_SUBACK 9<<4
57#define MQTT_MSG_UNSUBSCRIBE 10<<4
58#define MQTT_MSG_UNSUBACK 11<<4
59#define MQTT_MSG_PINGREQ 12<<4
60#define MQTT_MSG_PINGRESP 13<<4
61#define MQTT_MSG_DISCONNECT 14<<4
69#define MQTTParseMessageType(buffer) ( *buffer & 0xF0 )
77#define MQTTParseMessageDuplicate(buffer) ( *buffer & 0x08 )
84#define MQTTParseMessageQos(buffer) ( (*buffer & 0x06) >> 1 )
92#define MQTTParseMessageRetain(buffer) ( *buffer & 0x01 )
105uint8_t mqtt_num_rem_len_bytes(
const uint8_t* buf);
115uint32_t mqtt_parse_rem_len(
const uint8_t* buf);
123uint16_t mqtt_parse_msg_id(
const uint8_t* buf);
135uint16_t mqtt_parse_pub_topic(
const uint8_t* buf, uint8_t* topic);
141uint16_t mqtt_parse_pub_topic_ptr(
const uint8_t* buf,
const uint8_t** topic_ptr);
153uint32_t mqtt_parse_publish_msg(
const uint8_t* buf, uint8_t* msg);
159uint32_t mqtt_parse_pub_msg_ptr(
const uint8_t* buf,
const uint8_t** msg_ptr);
164 int (*sendBuf)(
void* socket_info,
const void* buf,
unsigned int count);
168 char username[MQTT_CONF_USERNAME_LENGTH];
169 char password[MQTT_CONF_PASSWORD_LENGTH];
173 uint8_t clean_session;
236int mqtt_publish(
mqtt_broker_handle_t* broker,
const char* topic,
const char* msg, uint8_t retain);
252int mqtt_publish_with_qos(
mqtt_broker_handle_t* broker,
const char* topic,
const char* msg, uint8_t retain, uint8_t qos, uint16_t* message_id);
257int mqtt_pub_msg_with_qos(
mqtt_broker_handle_t* broker,
const char* topic,
const unsigned char* msg,
const uint32_t m_len, uint8_t retain, uint8_t qos, uint16_t message_id);
299int mqtt_subscribe_ext(
mqtt_broker_handle_t* broker,
const char* topics[], uint8_t cnt, uint16_t* message_id);
321int mqtt_unsubscribe_ext(
mqtt_broker_handle_t* broker,
const char* topics[], uint8_t cnt, uint16_t* message_id);
#define mqtt_unsubscribe(client, topic, cb, arg)
Definition: mqtt.h:196
#define mqtt_subscribe(client, topic, qos, cb, arg)
Definition: mqtt.h:193
Definition: libemqtt.h:162