Paho Asynchronous MQTT C Client Library
MQTTAsync.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2009, 2025 IBM Corp., Ian Craggs and others
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v2.0
6  * and Eclipse Distribution License v1.0 which accompany this distribution.
7  *
8  * The Eclipse Public License is available at
9  * https://www.eclipse.org/legal/epl-2.0/
10  * and the Eclipse Distribution License is available at
11  * http://www.eclipse.org/org/documents/edl-v10.php.
12  *
13  * Contributors:
14  * Ian Craggs - initial API and implementation
15  * Ian Craggs, Allan Stockdill-Mander - SSL connections
16  * Ian Craggs - multiple server connection support
17  * Ian Craggs - MQTT 3.1.1 support
18  * Ian Craggs - fix for bug 444103 - success/failure callbacks not invoked
19  * Ian Craggs - automatic reconnect and offline buffering (send while disconnected)
20  * Ian Craggs - binary will message
21  * Ian Craggs - binary password
22  * Ian Craggs - remove const on eyecatchers #168
23  * Ian Craggs - MQTT 5.0
24  *******************************************************************************/
25 
26 /********************************************************************/
27 
88 /*
90 */
91 #if !defined(MQTTASYNC_H)
92 #define MQTTASYNC_H
93 
94 #if defined(__cplusplus)
95  extern "C" {
96 #endif
97 
98 #include <stdio.h>
99 /*
101 */
102 
103 #include "MQTTExportDeclarations.h"
104 
105 #include "MQTTProperties.h"
106 #include "MQTTReasonCodes.h"
107 #include "MQTTSubscribeOpts.h"
108 #if !defined(NO_PERSISTENCE)
109 #include "MQTTClientPersistence.h"
110 #else
111 #define MQTTCLIENT_PERSISTENCE_NONE 1
112 #endif
113 
118 #define MQTTASYNC_SUCCESS 0
119 
123 #define MQTTASYNC_FAILURE -1
124 
125 /* error code -2 is MQTTAsync_PERSISTENCE_ERROR */
126 
127 #define MQTTASYNC_PERSISTENCE_ERROR -2
128 
132 #define MQTTASYNC_DISCONNECTED -3
133 
137 #define MQTTASYNC_MAX_MESSAGES_INFLIGHT -4
138 
141 #define MQTTASYNC_BAD_UTF8_STRING -5
142 
145 #define MQTTASYNC_NULL_PARAMETER -6
146 
151 #define MQTTASYNC_TOPICNAME_TRUNCATED -7
152 
156 #define MQTTASYNC_BAD_STRUCTURE -8
157 
160 #define MQTTASYNC_BAD_QOS -9
161 
164 #define MQTTASYNC_NO_MORE_MSGIDS -10
165 
168 #define MQTTASYNC_OPERATION_INCOMPLETE -11
169 
172 #define MQTTASYNC_MAX_BUFFERED_MESSAGES -12
173 
176 #define MQTTASYNC_SSL_NOT_SUPPORTED -13
177 
187 #define MQTTASYNC_BAD_PROTOCOL -14
188 
191 #define MQTTASYNC_BAD_MQTT_OPTION -15
192 
195 #define MQTTASYNC_WRONG_MQTT_VERSION -16
196 
199 #define MQTTASYNC_0_LEN_WILL_TOPIC -17
200 /*
201  * Return code: connect or disconnect command ignored because there is already a connect or disconnect
202  * command at the head of the list waiting to be processed. Use the onSuccess/onFailure callbacks to wait
203  * for the previous connect or disconnect command to be complete.
204  */
205 #define MQTTASYNC_COMMAND_IGNORED -18
206  /*
207  * Return code: maxBufferedMessages in the connect options must be >= 0
208  */
209  #define MQTTASYNC_MAX_BUFFERED -19
210 
214 #define MQTTVERSION_DEFAULT 0
215 
218 #define MQTTVERSION_3_1 3
219 
222 #define MQTTVERSION_3_1_1 4
223 
226 #define MQTTVERSION_5 5
227 
230 #define MQTT_BAD_SUBSCRIBE 0x80
231 
232 
236 typedef struct
237 {
239  char struct_id[4];
245 
246 #define MQTTAsync_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 }
247 
252 LIBMQTT_API void MQTTAsync_global_init(MQTTAsync_init_options* inits);
253 
258 typedef void* MQTTAsync;
268 typedef int MQTTAsync_token;
269 
276 typedef struct
277 {
279  char struct_id[4];
286  void* payload;
300  int qos;
319  int retained;
326  int dup;
332  int msgid;
338 
339 #define MQTTAsync_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer }
340 
374 typedef int MQTTAsync_messageArrived(void* context, char* topicName, int topicLen, MQTTAsync_message* message);
375 
397 typedef void MQTTAsync_deliveryComplete(void* context, MQTTAsync_token token);
398 
417 typedef void MQTTAsync_connectionLost(void* context, char* cause);
418 
419 
435 typedef void MQTTAsync_connected(void* context, char* cause);
436 
448 typedef void MQTTAsync_disconnected(void* context, MQTTProperties* properties,
449  enum MQTTReasonCodes reasonCode);
450 
466 LIBMQTT_API int MQTTAsync_setDisconnected(MQTTAsync handle, void* context, MQTTAsync_disconnected* co);
467 
469 typedef struct
470 {
472  char struct_id[4];
481  const char* username;
487  struct {
488  int len;
489  const void* data;
490  } binarypwd;
492 
493 #define MQTTAsync_connectData_initializer {{'M', 'Q', 'C', 'D'}, 0, NULL, {0, NULL}}
494 
501 typedef int MQTTAsync_updateConnectOptions(void* context, MQTTAsync_connectData* data);
502 
512 LIBMQTT_API int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void* context, MQTTAsync_updateConnectOptions* co);
513 
514 #if !defined(NO_PERSISTENCE)
515 
524 LIBMQTT_API int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void* context, MQTTPersistence_beforeWrite* co);
525 
526 
536 LIBMQTT_API int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void* context, MQTTPersistence_afterRead* co);
537 #endif
538 
540 typedef struct
541 {
543  MQTTAsync_token token;
545  int code;
547  const char *message;
549 
550 
552 typedef struct
553 {
555  char struct_id[4];
559  MQTTAsync_token token;
561  enum MQTTReasonCodes reasonCode;
565  int code;
567  const char *message;
571 
572 #define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, 0, NULL, 0}
573 
575 typedef struct
576 {
578  MQTTAsync_token token;
580  union
581  {
584  int qos;
587  int* qosList;
589  struct
590  {
593  } pub;
594  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
595  struct
596  {
597  char* serverURI;
600  } connect;
601  } alt;
603 
604 
606 typedef struct
607 {
608  char struct_id[4];
611  MQTTAsync_token token;
612  enum MQTTReasonCodes reasonCode;
615  union
616  {
618  struct
619  {
622  } sub;
624  struct
625  {
628  } pub;
629  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
630  struct
631  {
632  char* serverURI;
635  } connect;
637  struct
638  {
639  int reasonCodeCount;
640  enum MQTTReasonCodes* reasonCodes;
641  } unsub;
642  } alt;
644 
645 #define MQTTAsync_successData5_initializer {{'M', 'Q', 'S', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, {.sub={0,0}}}
646 
660 typedef void MQTTAsync_onSuccess(void* context, MQTTAsync_successData* response);
661 
676 typedef void MQTTAsync_onSuccess5(void* context, MQTTAsync_successData5* response);
677 
691 typedef void MQTTAsync_onFailure(void* context, MQTTAsync_failureData* response);
692 
706 typedef void MQTTAsync_onFailure5(void* context, MQTTAsync_failureData5* response);
707 
714 {
716  char struct_id[4];
737  void* context;
744  MQTTAsync_token token;
761  /*
762  * MQTT V5 subscribe options, when used with subscribe only.
763  */
765  /*
766  * MQTT V5 subscribe option count, when used with subscribeMany only.
767  * The number of entries in the subscribe_options_list array.
768  */
770  /*
771  * MQTT V5 subscribe option array, when used with subscribeMany only.
772  */
775 
776 #define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 1, NULL, NULL, 0, 0, NULL, NULL, MQTTProperties_initializer, MQTTSubscribe_options_initializer, 0, NULL}
777 
780 #define MQTTAsync_callOptions_initializer MQTTAsync_responseOptions_initializer
781 
810 LIBMQTT_API int MQTTAsync_setCallbacks(MQTTAsync handle, void* context, MQTTAsync_connectionLost* cl,
812 
833 LIBMQTT_API int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void* context,
835 
857 LIBMQTT_API int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void* context,
859 
879 LIBMQTT_API int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void* context,
881 
894 LIBMQTT_API int MQTTAsync_setConnected(MQTTAsync handle, void* context, MQTTAsync_connected* co);
895 
896 
905 LIBMQTT_API int MQTTAsync_reconnect(MQTTAsync handle);
906 
907 
960 LIBMQTT_API int MQTTAsync_create(MQTTAsync* handle, const char* serverURI, const char* clientId,
961  int persistence_type, void* persistence_context);
962 
964 typedef struct
965 {
967  char struct_id[4];
990  /*
991  * When the maximum number of buffered messages is reached, delete the oldest rather than the newest.
992  */
994  /*
995  * Restore messages from persistence on create - or clear it.
996  */
998  /*
999  * Persist QoS0 publish commands - an option to not persist them.
1000  */
1003 
1004 #define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_DEFAULT, 0, 0, 1, 1}
1005 
1006 #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_5, 0, 0, 1, 1}
1007 
1008 
1009 LIBMQTT_API int MQTTAsync_createWithOptions(MQTTAsync* handle, const char* serverURI, const char* clientId,
1010  int persistence_type, void* persistence_context, MQTTAsync_createOptions* options);
1011 
1024 typedef struct
1025 {
1027  char struct_id[4];
1033  const char* topicName;
1035  const char* message;
1044  int qos;
1046  struct
1047  {
1048  int len;
1049  const void* data;
1050  } payload;
1052 
1053 #define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } }
1054 
1055 #define MQTT_SSL_VERSION_DEFAULT 0
1056 #define MQTT_SSL_VERSION_TLS_1_0 1
1057 #define MQTT_SSL_VERSION_TLS_1_1 2
1058 #define MQTT_SSL_VERSION_TLS_1_2 3
1059 
1072 typedef struct
1073 {
1075  char struct_id[4];
1076 
1085 
1087  const char* trustStore;
1088 
1092  const char* keyStore;
1093 
1097  const char* privateKey;
1098 
1100  const char* privateKeyPassword;
1101 
1110  const char* enabledCipherSuites;
1111 
1114 
1120 
1126  int verify;
1127 
1133  const char* CApath;
1134 
1139  int (*ssl_error_cb) (const char *str, size_t len, void *u);
1140 
1146 
1152  unsigned int (*ssl_psk_cb) (const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len, void *u);
1153 
1159 
1166 
1174  const unsigned char *protos;
1175 
1180  unsigned int protos_len;
1182 
1183 #define MQTTAsync_SSLOptions_initializer { {'M', 'Q', 'T', 'S'}, 5, NULL, NULL, NULL, NULL, NULL, 1, MQTT_SSL_VERSION_DEFAULT, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0 }
1184 
1186 typedef struct
1187 {
1188  const char* name;
1189  const char* value;
1191 
1202 typedef struct
1203 {
1205  char struct_id[4];
1265  const char* username;
1271  const char* password;
1306  void* context;
1322  char* const* serverURIs;
1345  struct {
1346  int len;
1347  const void* data;
1348  } binarypwd;
1349  /*
1350  * MQTT V5 clean start flag. Only clears state at the beginning of the session.
1351  */
1382  const char* httpProxy;
1386  const char* httpsProxy;
1388 
1390 #define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 8, 60, 1, 65535, NULL, NULL, NULL, 30, 0,\
1391 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1392 
1394 #define MQTTAsync_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 8, 60, 0, 65535, NULL, NULL, NULL, 30, 0,\
1395 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1396 
1400 #define MQTTAsync_connectOptions_initializer_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 1, 65535, NULL, NULL, NULL, 30, 0,\
1401 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1402 
1406 #define MQTTAsync_connectOptions_initializer5_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 0, 65535, NULL, NULL, NULL, 30, 0,\
1407 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1408 
1409 
1430 LIBMQTT_API int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options);
1431 
1433 typedef struct
1434 {
1436  char struct_id[4];
1443  int timeout;
1461  void* context;
1469  enum MQTTReasonCodes reasonCode;
1483 
1484 #define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 0, 0, NULL, NULL, NULL,\
1485  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1486 
1487 #define MQTTAsync_disconnectOptions_initializer5 { {'M', 'Q', 'T', 'D'}, 1, 0, NULL, NULL, NULL,\
1488  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1489 
1508 LIBMQTT_API int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions* options);
1509 
1510 
1518 LIBMQTT_API int MQTTAsync_isConnected(MQTTAsync handle);
1519 
1520 
1535 LIBMQTT_API int MQTTAsync_subscribe(MQTTAsync handle, const char* topic, int qos, MQTTAsync_responseOptions* response);
1536 
1537 
1555 LIBMQTT_API int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char* const* topic, const int* qos, MQTTAsync_responseOptions* response);
1556 
1569 LIBMQTT_API int MQTTAsync_unsubscribe(MQTTAsync handle, const char* topic, MQTTAsync_responseOptions* response);
1570 
1583 LIBMQTT_API int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const* topic, MQTTAsync_responseOptions* response);
1584 
1585 
1605 LIBMQTT_API int MQTTAsync_send(MQTTAsync handle, const char* destinationName, int payloadlen, const void* payload, int qos,
1606  int retained, MQTTAsync_responseOptions* response);
1607 
1624 LIBMQTT_API int MQTTAsync_sendMessage(MQTTAsync handle, const char* destinationName, const MQTTAsync_message* msg, MQTTAsync_responseOptions* response);
1625 
1626 
1645 LIBMQTT_API int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens);
1646 
1655 #define MQTTASYNC_TRUE 1
1656 LIBMQTT_API int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token);
1657 
1658 
1671 LIBMQTT_API int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout);
1672 
1673 
1684 LIBMQTT_API void MQTTAsync_freeMessage(MQTTAsync_message** msg);
1685 
1694 LIBMQTT_API void MQTTAsync_free(void* ptr);
1695 
1703 LIBMQTT_API void* MQTTAsync_malloc(size_t size);
1704 
1712 LIBMQTT_API void MQTTAsync_destroy(MQTTAsync* handle);
1713 
1714 
1715 
1717 {
1725 };
1726 
1727 
1733 LIBMQTT_API void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level);
1734 
1735 
1745 typedef void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char* message);
1746 
1753 LIBMQTT_API void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback* callback);
1754 
1762 
1769 LIBMQTT_API const char* MQTTAsync_strerror(int code);
1770 
1771 
2400 #if defined(__cplusplus)
2401  }
2402 #endif
2403 
2404 #endif
int sendWhileDisconnected
Definition: MQTTAsync.h:975
MQTTAsync_token token
Definition: MQTTAsync.h:578
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:750
Definition: MQTTAsync.h:1722
int struct_version
Definition: MQTTAsync.h:609
int len
Definition: MQTTAsync.h:1048
void * ssl_error_context
Definition: MQTTAsync.h:1145
int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens)
void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback *callback)
int MQTTAsync_isConnected(MQTTAsync handle)
const char * message
Definition: MQTTAsync.h:547
int MQTTAsync_token
Definition: MQTTAsync.h:268
int * qosList
Definition: MQTTAsync.h:587
MQTTProperties properties
Definition: MQTTAsync.h:760
char *const * serverURIs
Definition: MQTTAsync.h:1322
char * serverURI
Definition: MQTTAsync.h:632
int struct_version
Definition: MQTTAsync.h:1216
char * destinationName
Definition: MQTTAsync.h:627
MQTTAsync_token token
Definition: MQTTAsync.h:611
MQTTAsync_token token
Definition: MQTTAsync.h:543
Definition: MQTTAsync.h:1024
void MQTTAsync_connectionLost(void *context, char *cause)
Definition: MQTTAsync.h:417
int MQTTVersion
Definition: MQTTAsync.h:598
MQTTProperties properties
Definition: MQTTAsync.h:1465
MQTTAsync_willOptions * will
Definition: MQTTAsync.h:1259
MQTTAsync_token token
Definition: MQTTAsync.h:744
void MQTTAsync_connected(void *context, char *cause)
Definition: MQTTAsync.h:435
int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions *options)
int struct_version
Definition: MQTTAsync.h:241
const char * keyStore
Definition: MQTTAsync.h:1092
const void * data
Definition: MQTTAsync.h:1347
int MQTTAsync_createWithOptions(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTAsync_createOptions *options)
int MQTTVersion
Definition: MQTTAsync.h:985
int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void *context, MQTTAsync_messageArrived *ma)
int sessionPresent
Definition: MQTTAsync.h:599
Definition: MQTTAsync.h:276
int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char *const *topic, MQTTAsync_responseOptions *response)
int MQTTVersion
Definition: MQTTAsync.h:1329
int struct_version
Definition: MQTTAsync.h:719
const char * password
Definition: MQTTAsync.h:1271
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:756
int cleanstart
Definition: MQTTAsync.h:1352
int deleteOldestMessages
Definition: MQTTAsync.h:993
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:731
int keepAliveInterval
Definition: MQTTAsync.h:1227
void MQTTAsync_deliveryComplete(void *context, MQTTAsync_token token)
Definition: MQTTAsync.h:397
int qos
Definition: MQTTAsync.h:300
int MQTTVersion
Definition: MQTTAsync.h:633
Definition: MQTTAsync.h:469
MQTTProperties * willProperties
Definition: MQTTAsync.h:1360
Definition: MQTTSubscribeOpts.h:21
MQTTASYNC_TRACE_LEVELS
Definition: MQTTAsync.h:1716
int automaticReconnect
Definition: MQTTAsync.h:1333
void * payload
Definition: MQTTAsync.h:286
int len
Definition: MQTTAsync.h:488
int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions *options)
const char * trustStore
Definition: MQTTAsync.h:1087
const MQTTAsync_nameValue * httpHeaders
Definition: MQTTAsync.h:1376
void * context
Definition: MQTTAsync.h:737
char struct_id[4]
Definition: MQTTAsync.h:716
int MQTTAsync_setCallbacks(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl, MQTTAsync_messageArrived *ma, MQTTAsync_deliveryComplete *dc)
const char * CApath
Definition: MQTTAsync.h:1133
int payloadlen
Definition: MQTTAsync.h:284
MQTTAsync_message message
Definition: MQTTAsync.h:591
MQTTSubscribe_options subscribeOptions
Definition: MQTTAsync.h:764
void * MQTTAsync_malloc(size_t size)
int packet_type
Definition: MQTTAsync.h:569
Definition: MQTTAsync.h:713
int MQTTAsync_send(MQTTAsync handle, const char *destinationName, int payloadlen, const void *payload, int qos, int retained, MQTTAsync_responseOptions *response)
const char * username
Definition: MQTTAsync.h:481
int msgid
Definition: MQTTAsync.h:332
MQTTProperties * connectProperties
Definition: MQTTAsync.h:1356
int struct_version
Definition: MQTTAsync.h:1084
int struct_version
Definition: MQTTAsync.h:973
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1481
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1475
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1300
int struct_version
Definition: MQTTAsync.h:1438
struct MQTTAsync_responseOptions MQTTAsync_responseOptions
int persistQoS0
Definition: MQTTAsync.h:1001
MQTTAsync_SSLOptions * ssl
Definition: MQTTAsync.h:1288
int allowDisconnectedSendAtAnyTime
Definition: MQTTAsync.h:989
const char * privateKeyPassword
Definition: MQTTAsync.h:1100
int sslVersion
Definition: MQTTAsync.h:1119
const char * topicName
Definition: MQTTAsync.h:1033
Definition: MQTTAsync.h:1721
int MQTTAsync_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
Definition: MQTTAsync.h:374
int subscribeOptionsCount
Definition: MQTTAsync.h:769
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1449
Definition: MQTTAsync.h:1202
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1372
const char * name
Definition: MQTTAsync.h:1188
Definition: MQTTAsync.h:1723
Definition: MQTTAsync.h:1072
int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void *context, MQTTPersistence_beforeWrite *co)
void * context
Definition: MQTTAsync.h:1461
MQTTProperties properties
Definition: MQTTAsync.h:563
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:725
int reasonCodeCount
Definition: MQTTAsync.h:620
void MQTTAsync_free(void *ptr)
int struct_version
Definition: MQTTAsync.h:1031
char * destinationName
Definition: MQTTAsync.h:592
int retryInterval
Definition: MQTTAsync.h:1283
int MQTTAsync_updateConnectOptions(void *context, MQTTAsync_connectData *data)
Definition: MQTTAsync.h:501
int struct_version
Definition: MQTTAsync.h:474
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1294
void MQTTAsync_freeMessage(MQTTAsync_message **msg)
const char * httpProxy
Definition: MQTTAsync.h:1382
int MQTTAsync_create(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
unsigned int protos_len
Definition: MQTTAsync.h:1180
Definition: MQTTAsync.h:964
MQTTSubscribe_options * subscribeOptionsList
Definition: MQTTAsync.h:773
int struct_version
Definition: MQTTAsync.h:557
void MQTTAsync_onFailure5(void *context, MQTTAsync_failureData5 *response)
Definition: MQTTAsync.h:706
void * ssl_psk_context
Definition: MQTTAsync.h:1158
Definition: MQTTProperties.h:115
Definition: MQTTAsync.h:1724
int verify
Definition: MQTTAsync.h:1126
int restoreMessages
Definition: MQTTAsync.h:997
const void * data
Definition: MQTTAsync.h:489
MQTTAsync_token token
Definition: MQTTAsync.h:559
void MQTTAsync_onSuccess(void *context, MQTTAsync_successData *response)
Definition: MQTTAsync.h:660
MQTTProperties properties
Definition: MQTTAsync.h:613
void MQTTAsync_global_init(MQTTAsync_init_options *inits)
int do_openssl_init
Definition: MQTTAsync.h:243
MQTTReasonCodes
Definition: MQTTReasonCodes.h:23
Definition: MQTTAsync.h:540
int connectTimeout
Definition: MQTTAsync.h:1275
const unsigned char * protos
Definition: MQTTAsync.h:1174
Definition: MQTTAsync.h:552
int maxBufferedMessages
Definition: MQTTAsync.h:979
int maxInflight
Definition: MQTTAsync.h:1253
void MQTTAsync_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
Definition: MQTTAsync.h:448
MQTTAsync_message message
Definition: MQTTAsync.h:626
int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char *const *topic, const int *qos, MQTTAsync_responseOptions *response)
int MQTTAsync_subscribe(MQTTAsync handle, const char *topic, int qos, MQTTAsync_responseOptions *response)
Definition: MQTTAsync.h:1186
Definition: MQTTAsync.h:1718
int len
Definition: MQTTAsync.h:1346
const char * MQTTAsync_strerror(int code)
int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void *context, MQTTAsync_deliveryComplete *dc)
const void * data
Definition: MQTTAsync.h:1049
Definition: MQTTAsync.h:1719
int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl)
int serverURIcount
Definition: MQTTAsync.h:1310
const char * value
Definition: MQTTAsync.h:1189
void * MQTTAsync
Definition: MQTTAsync.h:258
int qos
Definition: MQTTAsync.h:584
int disableDefaultTrustStore
Definition: MQTTAsync.h:1165
const char * username
Definition: MQTTAsync.h:1265
int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void *context, MQTTPersistence_afterRead *co)
int enableServerCertAuth
Definition: MQTTAsync.h:1113
int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token)
void MQTTAsync_onFailure(void *context, MQTTAsync_failureData *response)
Definition: MQTTAsync.h:691
int code
Definition: MQTTAsync.h:565
const char * message
Definition: MQTTAsync.h:567
Definition: MQTTAsync.h:1433
int retained
Definition: MQTTAsync.h:1039
int timeout
Definition: MQTTAsync.h:1443
int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void *context, MQTTAsync_updateConnectOptions *co)
void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char *message)
Definition: MQTTAsync.h:1745
int struct_version
Definition: MQTTAsync.h:282
void * context
Definition: MQTTAsync.h:1306
int code
Definition: MQTTAsync.h:545
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1455
int MQTTPersistence_afterRead(void *context, char **buffer, int *buflen)
Definition: MQTTClientPersistence.h:275
Definition: MQTTAsync.h:236
const char * httpsProxy
Definition: MQTTAsync.h:1386
const char * privateKey
Definition: MQTTAsync.h:1097
int maxRetryInterval
Definition: MQTTAsync.h:1341
int MQTTAsync_sendMessage(MQTTAsync handle, const char *destinationName, const MQTTAsync_message *msg, MQTTAsync_responseOptions *response)
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1366
const char * enabledCipherSuites
Definition: MQTTAsync.h:1110
int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout)
int qos
Definition: MQTTAsync.h:1044
int MQTTAsync_setConnected(MQTTAsync handle, void *context, MQTTAsync_connected *co)
int cleansession
Definition: MQTTAsync.h:1249
enum MQTTReasonCodes * reasonCodes
Definition: MQTTAsync.h:621
const char * message
Definition: MQTTAsync.h:1035
int MQTTAsync_unsubscribe(MQTTAsync handle, const char *topic, MQTTAsync_responseOptions *response)
This structure represents a persistent data store, used to store outbound and inbound messages...
void MQTTAsync_destroy(MQTTAsync *handle)
Definition: MQTTAsync.h:606
int minRetryInterval
Definition: MQTTAsync.h:1337
int MQTTAsync_reconnect(MQTTAsync handle)
int retained
Definition: MQTTAsync.h:319
Definition: MQTTAsync.h:1720
int dup
Definition: MQTTAsync.h:326
MQTTAsync_nameValue * MQTTAsync_getVersionInfo(void)
MQTTProperties properties
Definition: MQTTAsync.h:336
Definition: MQTTAsync.h:575
void MQTTAsync_onSuccess5(void *context, MQTTAsync_successData5 *response)
Definition: MQTTAsync.h:676
int MQTTPersistence_beforeWrite(void *context, int bufcount, char *buffers[], int buflens[])
Definition: MQTTClientPersistence.h:264
char * serverURI
Definition: MQTTAsync.h:597
int sessionPresent
Definition: MQTTAsync.h:634
int MQTTAsync_setDisconnected(MQTTAsync handle, void *context, MQTTAsync_disconnected *co)
void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)