1
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
67
68
69
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
93
94
95
96
97
98
99
100
101
102
103
104
107
108
109
110
111
112
113
114
115
116
117
120
125
126
129
134
135
138
139
140
141
142
143
144
145
146
147
148
149
150
153
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
272
273
274
281
282
283
284
285
286
/* ... */
#ifndef _MQTT5_CLIENT_H_
#define _MQTT5_CLIENT_H_
#include "mqtt_client.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct esp_mqtt_client *esp_mqtt5_client_handle_t;
/* ... */
enum mqtt5_error_reason_code {
MQTT5_UNSPECIFIED_ERROR = 0x80,
MQTT5_MALFORMED_PACKET = 0x81,
MQTT5_PROTOCOL_ERROR = 0x82,
MQTT5_IMPLEMENT_SPECIFIC_ERROR = 0x83,
MQTT5_UNSUPPORTED_PROTOCOL_VER = 0x84,
MQTT5_INVAILD_CLIENT_ID __attribute__((deprecated)) = 0x85,
MQTT5_INVALID_CLIENT_ID = 0x85,
MQTT5_BAD_USERNAME_OR_PWD = 0x86,
MQTT5_NOT_AUTHORIZED = 0x87,
MQTT5_SERVER_UNAVAILABLE = 0x88,
MQTT5_SERVER_BUSY = 0x89,
MQTT5_BANNED = 0x8A,
MQTT5_SERVER_SHUTTING_DOWN = 0x8B,
MQTT5_BAD_AUTH_METHOD = 0x8C,
MQTT5_KEEP_ALIVE_TIMEOUT = 0x8D,
MQTT5_SESSION_TAKEN_OVER = 0x8E,
MQTT5_TOPIC_FILTER_INVAILD __attribute__((deprecated)) = 0x8F,
MQTT5_TOPIC_FILTER_INVALID = 0x8F,
MQTT5_TOPIC_NAME_INVAILD __attribute__((deprecated)) = 0x90,
MQTT5_TOPIC_NAME_INVALID = 0x90,
MQTT5_PACKET_IDENTIFIER_IN_USE = 0x91,
MQTT5_PACKET_IDENTIFIER_NOT_FOUND = 0x92,
MQTT5_RECEIVE_MAXIMUM_EXCEEDED = 0x93,
MQTT5_TOPIC_ALIAS_INVAILD __attribute__((deprecated)) = 0x94,
MQTT5_TOPIC_ALIAS_INVALID = 0x94,
MQTT5_PACKET_TOO_LARGE = 0x95,
MQTT5_MESSAGE_RATE_TOO_HIGH = 0x96,
MQTT5_QUOTA_EXCEEDED = 0x97,
MQTT5_ADMINISTRATIVE_ACTION = 0x98,
MQTT5_PAYLOAD_FORMAT_INVAILD __attribute__((deprecated)) = 0x99,
MQTT5_PAYLOAD_FORMAT_INVALID = 0x99,
MQTT5_RETAIN_NOT_SUPPORT = 0x9A,
MQTT5_QOS_NOT_SUPPORT = 0x9B,
MQTT5_USE_ANOTHER_SERVER = 0x9C,
MQTT5_SERVER_MOVED = 0x9D,
MQTT5_SHARED_SUBSCR_NOT_SUPPORTED = 0x9E,
MQTT5_CONNECTION_RATE_EXCEEDED = 0x9F,
MQTT5_MAXIMUM_CONNECT_TIME = 0xA0,
MQTT5_SUBSCRIBE_IDENTIFIER_NOT_SUPPORT = 0xA1,
MQTT5_WILDCARD_SUBSCRIBE_NOT_SUPPORT = 0xA2,
}{ ... };
/* ... */
typedef struct mqtt5_user_property_list_t *mqtt5_user_property_handle_t;
/* ... */
typedef struct {
uint32_t session_expiry_interval;
uint32_t maximum_packet_size;
uint16_t receive_maximum;
uint16_t topic_alias_maximum;
bool request_resp_info;
bool request_problem_info;
mqtt5_user_property_handle_t user_property;
uint32_t will_delay_interval;
uint32_t message_expiry_interval;
bool payload_format_indicator;
const char *content_type;
const char *response_topic;
const char *correlation_data;
uint16_t correlation_data_len;
mqtt5_user_property_handle_t will_user_property;
}{ ... } esp_mqtt5_connection_property_config_t;
/* ... */
typedef struct {
bool payload_format_indicator;
uint32_t message_expiry_interval;
uint16_t topic_alias;
const char *response_topic;
const char *correlation_data;
uint16_t correlation_data_len;
const char *content_type;
mqtt5_user_property_handle_t user_property;
}{ ... } esp_mqtt5_publish_property_config_t;
/* ... */
typedef struct {
uint16_t subscribe_id;
bool no_local_flag;
bool retain_as_published_flag;
uint8_t retain_handle;
bool is_share_subscribe;
const char *share_name;
mqtt5_user_property_handle_t user_property;
}{ ... } esp_mqtt5_subscribe_property_config_t;
/* ... */
typedef struct {
bool is_share_subscribe;
const char *share_name;
mqtt5_user_property_handle_t user_property;
}{ ... } esp_mqtt5_unsubscribe_property_config_t;
/* ... */
typedef struct {
uint32_t session_expiry_interval;
uint8_t disconnect_reason;
mqtt5_user_property_handle_t user_property;
}{ ... } esp_mqtt5_disconnect_property_config_t;
/* ... */
typedef struct {
bool payload_format_indicator;
char *response_topic;
int response_topic_len;
char *correlation_data;
uint16_t correlation_data_len;
char *content_type;
int content_type_len;
uint16_t subscribe_id;
mqtt5_user_property_handle_t user_property;
}{ ... } esp_mqtt5_event_property_t;
/* ... */
typedef struct {
const char *key;
const char *value;
}{ ... } esp_mqtt5_user_property_item_t;
/* ... */
esp_err_t esp_mqtt5_client_set_connect_property(esp_mqtt5_client_handle_t client, const esp_mqtt5_connection_property_config_t *connect_property);
/* ... */
esp_err_t esp_mqtt5_client_set_publish_property(esp_mqtt5_client_handle_t client, const esp_mqtt5_publish_property_config_t *property);
/* ... */
esp_err_t esp_mqtt5_client_set_subscribe_property(esp_mqtt5_client_handle_t client, const esp_mqtt5_subscribe_property_config_t *property);
/* ... */
esp_err_t esp_mqtt5_client_set_unsubscribe_property(esp_mqtt5_client_handle_t client, const esp_mqtt5_unsubscribe_property_config_t *property);
/* ... */
esp_err_t esp_mqtt5_client_set_disconnect_property(esp_mqtt5_client_handle_t client, const esp_mqtt5_disconnect_property_config_t *property);
/* ... */
esp_err_t esp_mqtt5_client_set_user_property(mqtt5_user_property_handle_t *user_property, esp_mqtt5_user_property_item_t item[], uint8_t item_num);
/* ... */
esp_err_t esp_mqtt5_client_get_user_property(mqtt5_user_property_handle_t user_property, esp_mqtt5_user_property_item_t *item, uint8_t *item_num);
/* ... */
uint8_t esp_mqtt5_client_get_user_property_count(mqtt5_user_property_handle_t user_property);
/* ... */
void esp_mqtt5_client_delete_user_property(mqtt5_user_property_handle_t user_property);
#ifdef __cplusplus
}{...}
#endif
/* ... */
#endif