7#include "espressif/c_types.h"
10#define MQTT_CONF_USERNAME_LENGTH 40+1
11#ifndef MQTT_CONF_USERNAME_LENGTH
12#define MQTT_CONF_USERNAME_LENGTH 13
15#define MQTT_CONF_PASSWORD_LENGTH 16+1
16#ifndef MQTT_CONF_PASSWORD_LENGTH
17#define MQTT_CONF_PASSWORD_LENGTH 13
21#define MQTT_MSG_CONNECT 1<<4
22#define MQTT_MSG_CONNACK 2<<4
23#define MQTT_MSG_PUBLISH 3<<4
24#define MQTT_MSG_PUBACK 4<<4
25#define MQTT_MSG_PUBREC 5<<4
26#define MQTT_MSG_PUBREL 6<<4
27#define MQTT_MSG_PUBCOMP 7<<4
28#define MQTT_MSG_SUBSCRIBE 8<<4
29#define MQTT_MSG_SUBACK 9<<4
30#define MQTT_MSG_UNSUBSCRIBE 10<<4
31#define MQTT_MSG_UNSUBACK 11<<4
32#define MQTT_MSG_PINGREQ 12<<4
33#define MQTT_MSG_PINGRESP 13<<4
34#define MQTT_MSG_DISCONNECT 14<<4
42#define MQTTParseMessageType(buffer) ( *buffer & 0xF0 )
50#define MQTTParseMessageDuplicate(buffer) ( *buffer & 0x08 )
57#define MQTTParseMessageQos(buffer) ( (*buffer & 0x06) >> 1 )
65#define MQTTParseMessageRetain(buffer) ( *buffer & 0x01 )
78uint8_t tuya_mqtt_num_rem_len_bytes(
const uint8_t* buf);
88uint32_t tuya_mqtt_parse_rem_len(
const uint8_t* buf);
96uint16_t tuya_mqtt_parse_msg_id(
const uint8_t* buf);
108uint16_t tuya_mqtt_parse_pub_topic(
const uint8_t* buf, uint8_t* topic);
114uint16_t tuya_mqtt_parse_pub_topic_ptr(
const uint8_t* buf,
const uint8_t** topic_ptr);
126uint32_t tuya_mqtt_parse_publish_msg(
const uint8_t* buf, uint8_t* msg);
132uint32_t tuya_mqtt_parse_pub_msg_ptr(
const uint8_t* buf,
const uint8_t** msg_ptr);
137 int (*sendBuf)(
void* socket_info,
const void* buf,
unsigned int count);
141 char username[MQTT_CONF_USERNAME_LENGTH];
142 char password[MQTT_CONF_PASSWORD_LENGTH];
146 uint8_t clean_session;
226 const uint32_t m_len, uint8_t retain, uint8_t qos, uint16_t message_id, uint8_t is_dup);
229 const uint32_t m_len, uint8_t retain, uint8_t qos, uint16_t message_id);
295int tuya_mqtt_unsubscribe_ext(
tuya_mqtt_broker_handle_t* broker,
const char* topics[], uint8_t cnt, uint16_t* message_id);
Definition: tuya_lib_mqtt.h:135