open62541 1.4.15
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_RECONNECT_FAILED) \
112 MQTT_ERROR(MQTT_ERROR_RECONNECTING)
113
114/** todo: add more connection refused errors */
115
116
117#define GENERATE_ENUM(ENUM) ENUM,
118
119
120#define GENERATE_STRING(STRING) #STRING,
121
122
123
129
130
131const char* mqtt_error_str(enum MQTTErrors error);
132
133
134ssize_t __mqtt_pack_uint16(uint8_t *buf, uint16_t integer);
135
136
137uint16_t __mqtt_unpack_uint16(const uint8_t *buf);
138
139
140ssize_t __mqtt_pack_str(uint8_t *buf, const char* str);
141
142
143#define __mqtt_packed_cstrlen(x) (2 + (unsigned int)strlen(x))
144
145/** RESPONSES */
146
147
156
157
165
166
168
169 uint8_t dup_flag;
170
171
172 uint8_t qos_level;
173
174
175 uint8_t retain_flag;
176
177
179
180
181 const void* topic_name;
182
183
184 uint16_t packet_id;
185
186
188
189
191};
192
193
195
196 uint16_t packet_id;
197};
198
199
201
202 uint16_t packet_id;
203};
204
205
207
208 uint16_t packet_id;
209};
210
211
213
214 uint16_t packet_id;
215};
216
217
224
225
227
228 uint16_t packet_id;
229
230
231 const uint8_t *return_codes;
232
233
235};
236
237
239
240 uint16_t packet_id;
241};
242
243
247
248
250
252
253
254 union {
255 struct mqtt_response_connack connack;
256 struct mqtt_response_publish publish;
257 struct mqtt_response_puback puback;
258 struct mqtt_response_pubrec pubrec;
259 struct mqtt_response_pubrel pubrel;
260 struct mqtt_response_pubcomp pubcomp;
261 struct mqtt_response_suback suback;
262 struct mqtt_response_unsuback unsuback;
263 struct mqtt_response_pingresp pingresp;
265};
266
267
268ssize_t mqtt_unpack_fixed_header(struct mqtt_response *response, const uint8_t *buf, size_t bufsz);
269
270
271ssize_t mqtt_unpack_connack_response (struct mqtt_response *mqtt_response, const uint8_t *buf);
272
273
274ssize_t mqtt_unpack_publish_response (struct mqtt_response *mqtt_response, const uint8_t *buf);
275
276
277ssize_t mqtt_unpack_pubxxx_response(struct mqtt_response *mqtt_response, const uint8_t *buf);
278
279
280ssize_t mqtt_unpack_suback_response(struct mqtt_response *mqtt_response, const uint8_t *buf);
281
282
283ssize_t mqtt_unpack_response(struct mqtt_response* response, const uint8_t *buf, size_t bufsz);
284
285/** REQUESTS */
286
287
288ssize_t mqtt_pack_fixed_header(uint8_t *buf, size_t bufsz, const struct mqtt_fixed_header *fixed_header);
289
290
302
303
304ssize_t mqtt_pack_connection_request(uint8_t* buf, size_t bufsz,
305 const char* client_id,
306 const char* will_topic,
307 const void* will_message,
308 size_t will_message_size,
309 const char* user_name,
310 const char* password,
311 uint8_t connect_flags,
312 uint16_t keep_alive);
313
314
317 MQTT_PUBLISH_QOS_0 = ((0u << 1) & 0x06),
318 MQTT_PUBLISH_QOS_1 = ((1u << 1) & 0x06),
319 MQTT_PUBLISH_QOS_2 = ((2u << 1) & 0x06),
320 MQTT_PUBLISH_QOS_MASK = ((3u << 1) & 0x06),
323
324
325ssize_t mqtt_pack_publish_request(uint8_t *buf, size_t bufsz,
326 const char* topic_name,
327 uint16_t packet_id,
328 const void* application_message,
329 size_t application_message_size,
330 uint8_t publish_flags);
331
332
333ssize_t mqtt_pack_pubxxx_request(uint8_t *buf, size_t bufsz,
334 enum MQTTControlPacketType control_type,
335 uint16_t packet_id);
336
337
338#define MQTT_SUBSCRIBE_REQUEST_MAX_NUM_TOPICS 8
339
340
341ssize_t mqtt_pack_subscribe_request(uint8_t *buf, size_t bufsz,
342 unsigned int packet_id,
343 ...); /* null terminated */
344
345
346#define MQTT_UNSUBSCRIBE_REQUEST_MAX_NUM_TOPICS 8
347
348
349ssize_t mqtt_pack_unsubscribe_request(uint8_t *buf, size_t bufsz,
350 unsigned int packet_id,
351 ...); /* null terminated */
352
353
354ssize_t mqtt_pack_ping_request(uint8_t *buf, size_t bufsz);
355
356
357ssize_t mqtt_pack_disconnect(uint8_t *buf, size_t bufsz);
358
359
360
366
367
369
370 uint8_t *start;
371
372
373 size_t size;
374
375
376
378
379
380 mqtt_pal_time_t time_sent;
381
382
384
385
386 uint16_t packet_id;
387};
388
389
391
393
394
395 void *mem_end;
396
397
398 uint8_t *curr;
399
400
401 size_t curr_sz;
402
403
405};
406
407
408void mqtt_mq_init(struct mqtt_message_queue *mq, void *buf, size_t bufsz);
409
410
412
413
414struct mqtt_queued_message* mqtt_mq_register(struct mqtt_message_queue *mq, size_t nbytes);
415
416
418
419
420#define mqtt_mq_get(mq_ptr, index) (((struct mqtt_queued_message*) ((mq_ptr)->mem_end)) - 1 - index)
421
422
423#define mqtt_mq_length(mq_ptr) (((struct mqtt_queued_message*) ((mq_ptr)->mem_end)) - (mq_ptr)->queue_tail)
424
425
426#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
427
428/** CLIENT */
429
430
432
433 mqtt_pal_socket_handle socketfd;
434
435
436 uint16_t pid_lfsr;
437
438
439 uint16_t keep_alive;
440
441
443
444
446
447
448 mqtt_pal_time_t time_of_last_send;
449
450
452
453
455
456
458
459
461
462
463 void (*publish_response_callback)(void** state, struct mqtt_response_publish *publish);
464
465
467
468
470
471
472 void (*reconnect_callback)(struct mqtt_client*, void**);
473
474
476
477
478 struct {
479
480 uint8_t *mem_start;
481
482
483 size_t mem_size;
484
485
486 uint8_t *curr;
487
488
489 size_t curr_sz;
491
492
493 mqtt_pal_mutex_t mutex;
494
495
497};
498
499
500uint16_t __mqtt_next_pid(struct mqtt_client *client);
501
502
503ssize_t __mqtt_send(struct mqtt_client *client);
504
505
506ssize_t __mqtt_recv(struct mqtt_client *client);
507
508
509enum MQTTErrors mqtt_sync(struct mqtt_client *client);
510
511
512enum MQTTErrors mqtt_init(struct mqtt_client *client,
513 mqtt_pal_socket_handle sockfd,
514 uint8_t *sendbuf, size_t sendbufsz,
515 uint8_t *recvbuf, size_t recvbufsz,
516 void (*publish_response_callback)(void** state, struct mqtt_response_publish *publish));
517
518
520 void (*reconnect_callback)(struct mqtt_client *client, void** state),
521 void *reconnect_state,
522 void (*publish_response_callback)(void** state, struct mqtt_response_publish *publish));
523
524
525void mqtt_reinit(struct mqtt_client* client,
526 mqtt_pal_socket_handle socketfd,
527 uint8_t *sendbuf, size_t sendbufsz,
528 uint8_t *recvbuf, size_t recvbufsz);
529
530
532 const char* client_id,
533 const char* will_topic,
534 const void* will_message,
535 size_t will_message_size,
536 const char* user_name,
537 const char* password,
538 uint8_t connect_flags,
539 uint16_t keep_alive);
540
541/**
542 todo: will_message should be a void*
543*/
544
545
547 const char* topic_name,
548 const void* application_message,
549 size_t application_message_size,
550 uint8_t publish_flags);
551
552
553ssize_t __mqtt_puback(struct mqtt_client *client, uint16_t packet_id);
554
555
556ssize_t __mqtt_pubrec(struct mqtt_client *client, uint16_t packet_id);
557
558
559ssize_t __mqtt_pubrel(struct mqtt_client *client, uint16_t packet_id);
560
561
562ssize_t __mqtt_pubcomp(struct mqtt_client *client, uint16_t packet_id);
563
564
565
567 const char* topic_name,
568 int max_qos_level);
569
570
572 const char* topic_name);
573
574
575enum MQTTErrors mqtt_ping(struct mqtt_client *client);
576
577
578enum MQTTErrors __mqtt_ping(struct mqtt_client *client);
579
580
582
583
585
586#if defined(__cplusplus)
587}
588#endif
589
590#endif
uint16_t __mqtt_unpack_uint16(const uint8_t *buf)
MQTTConnackReturnCode
RESPONSES.
Definition mqtt.h:148
@ MQTT_CONNACK_REFUSED_IDENTIFIER_REJECTED
Definition mqtt.h:151
@ MQTT_CONNACK_REFUSED_NOT_AUTHORIZED
Definition mqtt.h:154
@ MQTT_CONNACK_REFUSED_PROTOCOL_VERSION
Definition mqtt.h:150
@ MQTT_CONNACK_ACCEPTED
Definition mqtt.h:149
@ MQTT_CONNACK_REFUSED_BAD_USER_NAME_OR_PASSWORD
Definition mqtt.h:153
@ MQTT_CONNACK_REFUSED_SERVER_UNAVAILABLE
Definition mqtt.h:152
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:361
@ MQTT_QUEUED_AWAITING_ACK
Definition mqtt.h:363
@ MQTT_QUEUED_COMPLETE
Definition mqtt.h:364
@ MQTT_QUEUED_UNSENT
Definition mqtt.h:362
MQTTSubackReturnCodes
Definition mqtt.h:218
@ MQTT_SUBACK_FAILURE
Definition mqtt.h:222
@ MQTT_SUBACK_SUCCESS_MAX_QOS_0
Definition mqtt.h:219
@ MQTT_SUBACK_SUCCESS_MAX_QOS_2
Definition mqtt.h:221
@ MQTT_SUBACK_SUCCESS_MAX_QOS_1
Definition mqtt.h:220
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:124
@ MQTT_OK
Definition mqtt.h:127
@ MQTT_ERROR_UNKNOWN
Definition mqtt.h:125
const char * mqtt_error_str(enum MQTTErrors error)
MQTTPublishFlags
Definition mqtt.h:315
@ MQTT_PUBLISH_QOS_0
Definition mqtt.h:317
@ MQTT_PUBLISH_QOS_MASK
Definition mqtt.h:320
@ MQTT_PUBLISH_DUP
Definition mqtt.h:316
@ MQTT_PUBLISH_QOS_2
Definition mqtt.h:319
@ MQTT_PUBLISH_RETAIN
Definition mqtt.h:321
@ MQTT_PUBLISH_QOS_1
Definition mqtt.h:318
ssize_t mqtt_unpack_fixed_header(struct mqtt_response *response, const uint8_t *buf, size_t bufsz)
MQTTConnectFlags
Definition mqtt.h:291
@ MQTT_CONNECT_WILL_RETAIN
Definition mqtt.h:298
@ MQTT_CONNECT_PASSWORD
Definition mqtt.h:299
@ MQTT_CONNECT_WILL_QOS_0
Definition mqtt.h:295
@ MQTT_CONNECT_CLEAN_SESSION
Definition mqtt.h:293
@ MQTT_CONNECT_USER_NAME
Definition mqtt.h:300
@ MQTT_CONNECT_RESERVED
Definition mqtt.h:292
@ MQTT_CONNECT_WILL_QOS_2
Definition mqtt.h:297
@ MQTT_CONNECT_WILL_QOS_1
Definition mqtt.h:296
@ MQTT_CONNECT_WILL_FLAG
Definition mqtt.h:294
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:117
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:431
void(* reconnect_callback)(struct mqtt_client *, void **)
Definition mqtt.h:472
enum MQTTErrors(* inspector_callback)(struct mqtt_client *)
Definition mqtt.h:469
uint8_t * mem_start
Definition mqtt.h:480
void(* publish_response_callback)(void **state, struct mqtt_response_publish *publish)
Definition mqtt.h:463
struct mqtt_client::@10 recv_buffer
mqtt_pal_socket_handle socketfd
Definition mqtt.h:433
int response_timeout
Definition mqtt.h:454
struct mqtt_message_queue mq
Definition mqtt.h:496
float typical_response_time
Definition mqtt.h:460
mqtt_pal_mutex_t mutex
Definition mqtt.h:493
uint16_t pid_lfsr
Definition mqtt.h:436
void * publish_response_callback_state
Definition mqtt.h:466
enum MQTTErrors error
Definition mqtt.h:451
mqtt_pal_time_t time_of_last_send
Definition mqtt.h:448
void * reconnect_state
Definition mqtt.h:475
size_t send_offset
Definition mqtt.h:445
int number_of_keep_alives
Definition mqtt.h:442
size_t mem_size
Definition mqtt.h:483
int number_of_timeouts
Definition mqtt.h:457
uint8_t * curr
Definition mqtt.h:486
size_t curr_sz
Definition mqtt.h:489
uint16_t keep_alive
Definition mqtt.h:439
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:395
size_t curr_sz
Definition mqtt.h:401
void * mem_start
Definition mqtt.h:392
uint8_t * curr
Definition mqtt.h:398
struct mqtt_queued_message * queue_tail
Definition mqtt.h:404
enum MQTTQueuedMessageState state
Definition mqtt.h:377
mqtt_pal_time_t time_sent
Definition mqtt.h:380
enum MQTTControlPacketType control_type
Definition mqtt.h:383
uint8_t * start
Definition mqtt.h:370
uint16_t packet_id
Definition mqtt.h:386
enum MQTTConnackReturnCode return_code
Definition mqtt.h:163
uint8_t session_present_flag
Definition mqtt.h:160
uint16_t packet_id
Definition mqtt.h:196
uint16_t packet_id
Definition mqtt.h:214
size_t application_message_size
Definition mqtt.h:190
const void * topic_name
Definition mqtt.h:181
uint16_t packet_id
Definition mqtt.h:184
const void * application_message
Definition mqtt.h:187
uint8_t qos_level
Definition mqtt.h:172
uint16_t topic_name_size
Definition mqtt.h:178
uint8_t retain_flag
Definition mqtt.h:175
uint16_t packet_id
Definition mqtt.h:202
uint16_t packet_id
Definition mqtt.h:208
uint16_t packet_id
Definition mqtt.h:228
size_t num_return_codes
Definition mqtt.h:234
const uint8_t * return_codes
Definition mqtt.h:231
uint16_t packet_id
Definition mqtt.h:240
struct mqtt_fixed_header fixed_header
Definition mqtt.h:251
union mqtt_response::@9 decoded