open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
mqtt.h
Go to the documentation of this file.
1#if !defined(__MQTT_H__)
2#define __MQTT_H__
3
4/*
5MIT License
6
7Copyright(c) 2018 Liam Bindle
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files(the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions :
15
16The above copyright notice and this permission notice shall be included in all
17copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25SOFTWARE.
26*/
27
28#if defined(__cplusplus)
29extern "C" {
30#endif
31
32// Users can override mqtt_pal.h with their own configuration by defining
33// MQTTC_PAL_FILE as a header file to include (-DMQTTC_PAL_FILE=my_mqtt_pal.h).
34//
35// If MQTTC_PAL_FILE is used, none of the default utils will be emitted and must be
36// provided by the config file. To start, I would suggest copying mqtt_pal.h
37// and modifying as needed.
38#if defined(MQTTC_PAL_FILE)
39#define MQTTC_STR2(x) #x
40#define MQTTC_STR(x) MQTTC_STR2(x)
41#include MQTTC_STR(MQTTC_PAL_FILE)
42#else
43#include <mqtt_pal.h>
44#endif /* MQTT_PAL_FILE */
45
46
47
48
49
66
67
69
71
72
73 uint32_t control_flags: 4;
74
75
77};
78
79
80#define MQTT_PROTOCOL_LEVEL 0x04
81
82
83#define __ALL_MQTT_ERRORS(MQTT_ERROR) \
84 MQTT_ERROR(MQTT_ERROR_NULLPTR) \
85 MQTT_ERROR(MQTT_ERROR_CONTROL_FORBIDDEN_TYPE) \
86 MQTT_ERROR(MQTT_ERROR_CONTROL_INVALID_FLAGS) \
87 MQTT_ERROR(MQTT_ERROR_CONTROL_WRONG_TYPE) \
88 MQTT_ERROR(MQTT_ERROR_CONNECT_CLIENT_ID_REFUSED) \
89 MQTT_ERROR(MQTT_ERROR_CONNECT_NULL_WILL_MESSAGE) \
90 MQTT_ERROR(MQTT_ERROR_CONNECT_FORBIDDEN_WILL_QOS) \
91 MQTT_ERROR(MQTT_ERROR_CONNACK_FORBIDDEN_FLAGS) \
92 MQTT_ERROR(MQTT_ERROR_CONNACK_FORBIDDEN_CODE) \
93 MQTT_ERROR(MQTT_ERROR_PUBLISH_FORBIDDEN_QOS) \
94 MQTT_ERROR(MQTT_ERROR_SUBSCRIBE_TOO_MANY_TOPICS) \
95 MQTT_ERROR(MQTT_ERROR_MALFORMED_RESPONSE) \
96 MQTT_ERROR(MQTT_ERROR_UNSUBSCRIBE_TOO_MANY_TOPICS) \
97 MQTT_ERROR(MQTT_ERROR_RESPONSE_INVALID_CONTROL_TYPE) \
98 MQTT_ERROR(MQTT_ERROR_CONNECT_NOT_CALLED) \
99 MQTT_ERROR(MQTT_ERROR_SEND_BUFFER_IS_FULL) \
100 MQTT_ERROR(MQTT_ERROR_SOCKET_ERROR) \
101 MQTT_ERROR(MQTT_ERROR_MALFORMED_REQUEST) \
102 MQTT_ERROR(MQTT_ERROR_RECV_BUFFER_TOO_SMALL) \
103 MQTT_ERROR(MQTT_ERROR_ACK_OF_UNKNOWN) \
104 MQTT_ERROR(MQTT_ERROR_NOT_IMPLEMENTED) \
105 MQTT_ERROR(MQTT_ERROR_CONNECTION_REFUSED) \
106 MQTT_ERROR(MQTT_ERROR_SUBSCRIBE_FAILED) \
107 MQTT_ERROR(MQTT_ERROR_CONNECTION_CLOSED) \
108 MQTT_ERROR(MQTT_ERROR_INITIAL_RECONNECT) \
109 MQTT_ERROR(MQTT_ERROR_INVALID_REMAINING_LENGTH) \
110 MQTT_ERROR(MQTT_ERROR_CLEAN_SESSION_IS_REQUIRED) \
111 MQTT_ERROR(MQTT_ERROR_RECONNECTING)
112
113/** todo: add more connection refused errors */
114
115
116#define GENERATE_ENUM(ENUM) ENUM,
117
118
119#define GENERATE_STRING(STRING) #STRING,
120
121
122
128
129
130const char* mqtt_error_str(enum MQTTErrors error);
131
132
133ssize_t __mqtt_pack_uint16(uint8_t *buf, uint16_t integer);
134
135
136uint16_t __mqtt_unpack_uint16(const uint8_t *buf);
137
138
139ssize_t __mqtt_pack_str(uint8_t *buf, const char* str);
140
141
142#define __mqtt_packed_cstrlen(x) (2 + (unsigned int)strlen(x))
143
144/** RESPONSES */
145
146
155
156
164
165
167
168 uint8_t dup_flag;
169
170
171 uint8_t qos_level;
172
173
174 uint8_t retain_flag;
175
176
178
179
180 const void* topic_name;
181
182
183 uint16_t packet_id;
184
185
187
188
190};
191
192
194
195 uint16_t packet_id;
196};
197
198
200
201 uint16_t packet_id;
202};
203
204
206
207 uint16_t packet_id;
208};
209
210
212
213 uint16_t packet_id;
214};
215
216
223
224
226
227 uint16_t packet_id;
228
229
230 const uint8_t *return_codes;
231
232
234};
235
236
238
239 uint16_t packet_id;
240};
241
242
246
247
249
251
252
253 union {
254 struct mqtt_response_connack connack;
255 struct mqtt_response_publish publish;
256 struct mqtt_response_puback puback;
257 struct mqtt_response_pubrec pubrec;
258 struct mqtt_response_pubrel pubrel;
259 struct mqtt_response_pubcomp pubcomp;
260 struct mqtt_response_suback suback;
261 struct mqtt_response_unsuback unsuback;
262 struct mqtt_response_pingresp pingresp;
264};
265
266
267ssize_t mqtt_unpack_fixed_header(struct mqtt_response *response, const uint8_t *buf, size_t bufsz);
268
269
270ssize_t mqtt_unpack_connack_response (struct mqtt_response *mqtt_response, const uint8_t *buf);
271
272
273ssize_t mqtt_unpack_publish_response (struct mqtt_response *mqtt_response, const uint8_t *buf);
274
275
276ssize_t mqtt_unpack_pubxxx_response(struct mqtt_response *mqtt_response, const uint8_t *buf);
277
278
279ssize_t mqtt_unpack_suback_response(struct mqtt_response *mqtt_response, const uint8_t *buf);
280
281
282ssize_t mqtt_unpack_response(struct mqtt_response* response, const uint8_t *buf, size_t bufsz);
283
284/** REQUESTS */
285
286
287ssize_t mqtt_pack_fixed_header(uint8_t *buf, size_t bufsz, const struct mqtt_fixed_header *fixed_header);
288
289
301
302
303ssize_t mqtt_pack_connection_request(uint8_t* buf, size_t bufsz,
304 const char* client_id,
305 const char* will_topic,
306 const void* will_message,
307 size_t will_message_size,
308 const char* user_name,
309 const char* password,
310 uint8_t connect_flags,
311 uint16_t keep_alive);
312
313
316 MQTT_PUBLISH_QOS_0 = ((0u << 1) & 0x06),
317 MQTT_PUBLISH_QOS_1 = ((1u << 1) & 0x06),
318 MQTT_PUBLISH_QOS_2 = ((2u << 1) & 0x06),
319 MQTT_PUBLISH_QOS_MASK = ((3u << 1) & 0x06),
322
323
324ssize_t mqtt_pack_publish_request(uint8_t *buf, size_t bufsz,
325 const char* topic_name,
326 uint16_t packet_id,
327 const void* application_message,
328 size_t application_message_size,
329 uint8_t publish_flags);
330
331
332ssize_t mqtt_pack_pubxxx_request(uint8_t *buf, size_t bufsz,
333 enum MQTTControlPacketType control_type,
334 uint16_t packet_id);
335
336
337#define MQTT_SUBSCRIBE_REQUEST_MAX_NUM_TOPICS 8
338
339
340ssize_t mqtt_pack_subscribe_request(uint8_t *buf, size_t bufsz,
341 unsigned int packet_id,
342 ...); /* null terminated */
343
344
345#define MQTT_UNSUBSCRIBE_REQUEST_MAX_NUM_TOPICS 8
346
347
348ssize_t mqtt_pack_unsubscribe_request(uint8_t *buf, size_t bufsz,
349 unsigned int packet_id,
350 ...); /* null terminated */
351
352
353ssize_t mqtt_pack_ping_request(uint8_t *buf, size_t bufsz);
354
355
356ssize_t mqtt_pack_disconnect(uint8_t *buf, size_t bufsz);
357
358
359
365
366
368
369 uint8_t *start;
370
371
372 size_t size;
373
374
375
377
378
379 mqtt_pal_time_t time_sent;
380
381
383
384
385 uint16_t packet_id;
386};
387
388
390
392
393
394 void *mem_end;
395
396
397 uint8_t *curr;
398
399
400 size_t curr_sz;
401
402
404};
405
406
407void mqtt_mq_init(struct mqtt_message_queue *mq, void *buf, size_t bufsz);
408
409
411
412
413struct mqtt_queued_message* mqtt_mq_register(struct mqtt_message_queue *mq, size_t nbytes);
414
415
417
418
419#define mqtt_mq_get(mq_ptr, index) (((struct mqtt_queued_message*) ((mq_ptr)->mem_end)) - 1 - index)
420
421
422#define mqtt_mq_length(mq_ptr) (((struct mqtt_queued_message*) ((mq_ptr)->mem_end)) - (mq_ptr)->queue_tail)
423
424
425#define mqtt_mq_currsz(mq_ptr) (mq_ptr->curr >= (uint8_t*) ((mq_ptr)->queue_tail - 1)) ? 0 : ((uint8_t*) ((mq_ptr)->queue_tail - 1)) - (mq_ptr)->curr
426
427/** CLIENT */
428
429
431
432 mqtt_pal_socket_handle socketfd;
433
434
435 uint16_t pid_lfsr;
436
437
438 uint16_t keep_alive;
439
440
442
443
445
446
447 mqtt_pal_time_t time_of_last_send;
448
449
451
452
454
455
457
458
460
461
462 void (*publish_response_callback)(void** state, struct mqtt_response_publish *publish);
463
464
466
467
469
470
471 void (*reconnect_callback)(struct mqtt_client*, void**);
472
473
475
476
477 struct {
478
479 uint8_t *mem_start;
480
481
482 size_t mem_size;
483
484
485 uint8_t *curr;
486
487
488 size_t curr_sz;
490
491
492 mqtt_pal_mutex_t mutex;
493
494
496};
497
498
499uint16_t __mqtt_next_pid(struct mqtt_client *client);
500
501
502ssize_t __mqtt_send(struct mqtt_client *client);
503
504
505ssize_t __mqtt_recv(struct mqtt_client *client);
506
507
508enum MQTTErrors mqtt_sync(struct mqtt_client *client);
509
510
511enum MQTTErrors mqtt_init(struct mqtt_client *client,
512 mqtt_pal_socket_handle sockfd,
513 uint8_t *sendbuf, size_t sendbufsz,
514 uint8_t *recvbuf, size_t recvbufsz,
515 void (*publish_response_callback)(void** state, struct mqtt_response_publish *publish));
516
517
519 void (*reconnect_callback)(struct mqtt_client *client, void** state),
520 void *reconnect_state,
521 void (*publish_response_callback)(void** state, struct mqtt_response_publish *publish));
522
523
524void mqtt_reinit(struct mqtt_client* client,
525 mqtt_pal_socket_handle socketfd,
526 uint8_t *sendbuf, size_t sendbufsz,
527 uint8_t *recvbuf, size_t recvbufsz);
528
529
531 const char* client_id,
532 const char* will_topic,
533 const void* will_message,
534 size_t will_message_size,
535 const char* user_name,
536 const char* password,
537 uint8_t connect_flags,
538 uint16_t keep_alive);
539
540/**
541 todo: will_message should be a void*
542*/
543
544
546 const char* topic_name,
547 const void* application_message,
548 size_t application_message_size,
549 uint8_t publish_flags);
550
551
552ssize_t __mqtt_puback(struct mqtt_client *client, uint16_t packet_id);
553
554
555ssize_t __mqtt_pubrec(struct mqtt_client *client, uint16_t packet_id);
556
557
558ssize_t __mqtt_pubrel(struct mqtt_client *client, uint16_t packet_id);
559
560
561ssize_t __mqtt_pubcomp(struct mqtt_client *client, uint16_t packet_id);
562
563
564
566 const char* topic_name,
567 int max_qos_level);
568
569
571 const char* topic_name);
572
573
574enum MQTTErrors mqtt_ping(struct mqtt_client *client);
575
576
577enum MQTTErrors __mqtt_ping(struct mqtt_client *client);
578
579
581
582
584
585#if defined(__cplusplus)
586}
587#endif
588
589#endif
uint16_t __mqtt_unpack_uint16(const uint8_t *buf)
MQTTConnackReturnCode
RESPONSES.
Definition mqtt.h:147
@ MQTT_CONNACK_REFUSED_IDENTIFIER_REJECTED
Definition mqtt.h:150
@ MQTT_CONNACK_REFUSED_NOT_AUTHORIZED
Definition mqtt.h:153
@ MQTT_CONNACK_REFUSED_PROTOCOL_VERSION
Definition mqtt.h:149
@ MQTT_CONNACK_ACCEPTED
Definition mqtt.h:148
@ MQTT_CONNACK_REFUSED_BAD_USER_NAME_OR_PASSWORD
Definition mqtt.h:152
@ MQTT_CONNACK_REFUSED_SERVER_UNAVAILABLE
Definition mqtt.h:151
enum MQTTErrors mqtt_unsubscribe(struct mqtt_client *client, const char *topic_name)
void mqtt_mq_init(struct mqtt_message_queue *mq, void *buf, size_t bufsz)
struct mqtt_queued_message * mqtt_mq_find(struct mqtt_message_queue *mq, enum MQTTControlPacketType control_type, uint16_t *packet_id)
ssize_t __mqtt_pack_str(uint8_t *buf, const char *str)
MQTTQueuedMessageState
Definition mqtt.h:360
@ MQTT_QUEUED_AWAITING_ACK
Definition mqtt.h:362
@ MQTT_QUEUED_COMPLETE
Definition mqtt.h:363
@ MQTT_QUEUED_UNSENT
Definition mqtt.h:361
MQTTSubackReturnCodes
Definition mqtt.h:217
@ MQTT_SUBACK_FAILURE
Definition mqtt.h:221
@ MQTT_SUBACK_SUCCESS_MAX_QOS_0
Definition mqtt.h:218
@ MQTT_SUBACK_SUCCESS_MAX_QOS_2
Definition mqtt.h:220
@ MQTT_SUBACK_SUCCESS_MAX_QOS_1
Definition mqtt.h:219
enum MQTTErrors mqtt_reconnect(struct mqtt_client *client)
ssize_t mqtt_pack_connection_request(uint8_t *buf, size_t bufsz, const char *client_id, const char *will_topic, const void *will_message, size_t will_message_size, const char *user_name, const char *password, uint8_t connect_flags, uint16_t keep_alive)
ssize_t mqtt_pack_subscribe_request(uint8_t *buf, size_t bufsz, unsigned int packet_id,...)
ssize_t __mqtt_pack_uint16(uint8_t *buf, uint16_t integer)
ssize_t __mqtt_pubrel(struct mqtt_client *client, uint16_t packet_id)
enum MQTTErrors __mqtt_ping(struct mqtt_client *client)
void mqtt_init_reconnect(struct mqtt_client *client, void(*reconnect_callback)(struct mqtt_client *client, void **state), void *reconnect_state, void(*publish_response_callback)(void **state, struct mqtt_response_publish *publish))
ssize_t __mqtt_recv(struct mqtt_client *client)
ssize_t mqtt_unpack_suback_response(struct mqtt_response *mqtt_response, const uint8_t *buf)
ssize_t mqtt_pack_fixed_header(uint8_t *buf, size_t bufsz, const struct mqtt_fixed_header *fixed_header)
REQUESTS.
ssize_t mqtt_pack_disconnect(uint8_t *buf, size_t bufsz)
uint16_t __mqtt_next_pid(struct mqtt_client *client)
#define __ALL_MQTT_ERRORS(MQTT_ERROR)
Definition mqtt.h:83
ssize_t __mqtt_pubcomp(struct mqtt_client *client, uint16_t packet_id)
ssize_t __mqtt_pubrec(struct mqtt_client *client, uint16_t packet_id)
ssize_t mqtt_unpack_pubxxx_response(struct mqtt_response *mqtt_response, const uint8_t *buf)
enum MQTTErrors mqtt_disconnect(struct mqtt_client *client)
ssize_t mqtt_pack_pubxxx_request(uint8_t *buf, size_t bufsz, enum MQTTControlPacketType control_type, uint16_t packet_id)
ssize_t mqtt_unpack_connack_response(struct mqtt_response *mqtt_response, const uint8_t *buf)
struct mqtt_queued_message * mqtt_mq_register(struct mqtt_message_queue *mq, size_t nbytes)
enum MQTTErrors mqtt_init(struct mqtt_client *client, mqtt_pal_socket_handle sockfd, uint8_t *sendbuf, size_t sendbufsz, uint8_t *recvbuf, size_t recvbufsz, void(*publish_response_callback)(void **state, struct mqtt_response_publish *publish))
ssize_t mqtt_pack_unsubscribe_request(uint8_t *buf, size_t bufsz, unsigned int packet_id,...)
ssize_t mqtt_unpack_response(struct mqtt_response *response, const uint8_t *buf, size_t bufsz)
ssize_t mqtt_pack_ping_request(uint8_t *buf, size_t bufsz)
ssize_t mqtt_pack_publish_request(uint8_t *buf, size_t bufsz, const char *topic_name, uint16_t packet_id, const void *application_message, size_t application_message_size, uint8_t publish_flags)
MQTTControlPacketType
Definition mqtt.h:50
@ MQTT_CONTROL_PINGREQ
Definition mqtt.h:62
@ MQTT_CONTROL_PINGRESP
Definition mqtt.h:63
@ MQTT_CONTROL_PUBREC
Definition mqtt.h:55
@ MQTT_CONTROL_PUBLISH
Definition mqtt.h:53
@ MQTT_CONTROL_DISCONNECT
Definition mqtt.h:64
@ MQTT_CONTROL_UNSUBACK
Definition mqtt.h:61
@ MQTT_CONTROL_SUBSCRIBE
Definition mqtt.h:58
@ MQTT_CONTROL_PUBREL
Definition mqtt.h:56
@ MQTT_CONTROL_UNSUBSCRIBE
Definition mqtt.h:60
@ MQTT_CONTROL_PUBCOMP
Definition mqtt.h:57
@ MQTT_CONTROL_CONNACK
Definition mqtt.h:52
@ MQTT_CONTROL_CONNECT
Definition mqtt.h:51
@ MQTT_CONTROL_SUBACK
Definition mqtt.h:59
@ MQTT_CONTROL_PUBACK
Definition mqtt.h:54
ssize_t __mqtt_send(struct mqtt_client *client)
MQTTErrors
Definition mqtt.h:123
@ MQTT_OK
Definition mqtt.h:126
@ MQTT_ERROR_UNKNOWN
Definition mqtt.h:124
const char * mqtt_error_str(enum MQTTErrors error)
MQTTPublishFlags
Definition mqtt.h:314
@ MQTT_PUBLISH_QOS_0
Definition mqtt.h:316
@ MQTT_PUBLISH_QOS_MASK
Definition mqtt.h:319
@ MQTT_PUBLISH_DUP
Definition mqtt.h:315
@ MQTT_PUBLISH_QOS_2
Definition mqtt.h:318
@ MQTT_PUBLISH_RETAIN
Definition mqtt.h:320
@ MQTT_PUBLISH_QOS_1
Definition mqtt.h:317
ssize_t mqtt_unpack_fixed_header(struct mqtt_response *response, const uint8_t *buf, size_t bufsz)
MQTTConnectFlags
Definition mqtt.h:290
@ MQTT_CONNECT_WILL_RETAIN
Definition mqtt.h:297
@ MQTT_CONNECT_PASSWORD
Definition mqtt.h:298
@ MQTT_CONNECT_WILL_QOS_0
Definition mqtt.h:294
@ MQTT_CONNECT_CLEAN_SESSION
Definition mqtt.h:292
@ MQTT_CONNECT_USER_NAME
Definition mqtt.h:299
@ MQTT_CONNECT_RESERVED
Definition mqtt.h:291
@ MQTT_CONNECT_WILL_QOS_2
Definition mqtt.h:296
@ MQTT_CONNECT_WILL_QOS_1
Definition mqtt.h:295
@ MQTT_CONNECT_WILL_FLAG
Definition mqtt.h:293
void mqtt_mq_clean(struct mqtt_message_queue *mq)
enum MQTTErrors mqtt_connect(struct mqtt_client *client, const char *client_id, const char *will_topic, const void *will_message, size_t will_message_size, const char *user_name, const char *password, uint8_t connect_flags, uint16_t keep_alive)
ssize_t __mqtt_puback(struct mqtt_client *client, uint16_t packet_id)
enum MQTTErrors mqtt_sync(struct mqtt_client *client)
enum MQTTErrors mqtt_ping(struct mqtt_client *client)
ssize_t mqtt_unpack_publish_response(struct mqtt_response *mqtt_response, const uint8_t *buf)
enum MQTTErrors mqtt_subscribe(struct mqtt_client *client, const char *topic_name, int max_qos_level)
#define GENERATE_ENUM(ENUM)
todo: add more connection refused errors
Definition mqtt.h:116
void mqtt_reinit(struct mqtt_client *client, mqtt_pal_socket_handle socketfd, uint8_t *sendbuf, size_t sendbufsz, uint8_t *recvbuf, size_t recvbufsz)
enum MQTTErrors mqtt_publish(struct mqtt_client *client, const char *topic_name, const void *application_message, size_t application_message_size, uint8_t publish_flags)
todo: will_message should be a void*
CLIENT.
Definition mqtt.h:430
void(* reconnect_callback)(struct mqtt_client *, void **)
Definition mqtt.h:471
enum MQTTErrors(* inspector_callback)(struct mqtt_client *)
Definition mqtt.h:468
uint8_t * mem_start
Definition mqtt.h:479
void(* publish_response_callback)(void **state, struct mqtt_response_publish *publish)
Definition mqtt.h:462
mqtt_pal_socket_handle socketfd
Definition mqtt.h:432
double typical_response_time
Definition mqtt.h:459
int response_timeout
Definition mqtt.h:453
struct mqtt_message_queue mq
Definition mqtt.h:495
mqtt_pal_mutex_t mutex
Definition mqtt.h:492
uint16_t pid_lfsr
Definition mqtt.h:435
void * publish_response_callback_state
Definition mqtt.h:465
enum MQTTErrors error
Definition mqtt.h:450
mqtt_pal_time_t time_of_last_send
Definition mqtt.h:447
void * reconnect_state
Definition mqtt.h:474
size_t send_offset
Definition mqtt.h:444
int number_of_keep_alives
Definition mqtt.h:441
struct mqtt_client::@9 recv_buffer
size_t mem_size
Definition mqtt.h:482
int number_of_timeouts
Definition mqtt.h:456
uint8_t * curr
Definition mqtt.h:485
size_t curr_sz
Definition mqtt.h:488
uint16_t keep_alive
Definition mqtt.h:438
enum MQTTControlPacketType control_type
Definition mqtt.h:70
uint32_t remaining_length
Definition mqtt.h:76
uint32_t control_flags
Definition mqtt.h:73
void * mem_end
Definition mqtt.h:394
size_t curr_sz
Definition mqtt.h:400
void * mem_start
Definition mqtt.h:391
uint8_t * curr
Definition mqtt.h:397
struct mqtt_queued_message * queue_tail
Definition mqtt.h:403
enum MQTTQueuedMessageState state
Definition mqtt.h:376
mqtt_pal_time_t time_sent
Definition mqtt.h:379
enum MQTTControlPacketType control_type
Definition mqtt.h:382
uint8_t * start
Definition mqtt.h:369
uint16_t packet_id
Definition mqtt.h:385
enum MQTTConnackReturnCode return_code
Definition mqtt.h:162
uint8_t session_present_flag
Definition mqtt.h:159
uint16_t packet_id
Definition mqtt.h:195
uint16_t packet_id
Definition mqtt.h:213
size_t application_message_size
Definition mqtt.h:189
const void * topic_name
Definition mqtt.h:180
uint16_t packet_id
Definition mqtt.h:183
const void * application_message
Definition mqtt.h:186
uint8_t qos_level
Definition mqtt.h:171
uint16_t topic_name_size
Definition mqtt.h:177
uint8_t retain_flag
Definition mqtt.h:174
uint16_t packet_id
Definition mqtt.h:201
uint16_t packet_id
Definition mqtt.h:207
uint16_t packet_id
Definition mqtt.h:227
size_t num_return_codes
Definition mqtt.h:233
const uint8_t * return_codes
Definition mqtt.h:230
uint16_t packet_id
Definition mqtt.h:239
struct mqtt_fixed_header fixed_header
Definition mqtt.h:250
union mqtt_response::@8 decoded