Paho Asynchronous MQTT C Client Library
MQTTAsync.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2009, 2020 IBM Corp. 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 
85 /*
87 */
88 #if !defined(MQTTASYNC_H)
89 #define MQTTASYNC_H
90 
91 #if defined(__cplusplus)
92  extern "C" {
93 #endif
94 
95 #include <stdio.h>
96 /*
98 */
99 
100 #include "MQTTExportDeclarations.h"
101 
102 #include "MQTTProperties.h"
103 #include "MQTTReasonCodes.h"
104 #include "MQTTSubscribeOpts.h"
105 #if !defined(NO_PERSISTENCE)
106 #include "MQTTClientPersistence.h"
107 #endif
108 
113 #define MQTTASYNC_SUCCESS 0
114 
118 #define MQTTASYNC_FAILURE -1
119 
120 /* error code -2 is MQTTAsync_PERSISTENCE_ERROR */
121 
122 #define MQTTASYNC_PERSISTENCE_ERROR -2
123 
127 #define MQTTASYNC_DISCONNECTED -3
128 
132 #define MQTTASYNC_MAX_MESSAGES_INFLIGHT -4
133 
136 #define MQTTASYNC_BAD_UTF8_STRING -5
137 
140 #define MQTTASYNC_NULL_PARAMETER -6
141 
146 #define MQTTASYNC_TOPICNAME_TRUNCATED -7
147 
151 #define MQTTASYNC_BAD_STRUCTURE -8
152 
155 #define MQTTASYNC_BAD_QOS -9
156 
159 #define MQTTASYNC_NO_MORE_MSGIDS -10
160 
163 #define MQTTASYNC_OPERATION_INCOMPLETE -11
164 
167 #define MQTTASYNC_MAX_BUFFERED_MESSAGES -12
168 
171 #define MQTTASYNC_SSL_NOT_SUPPORTED -13
172 
177 #define MQTTASYNC_BAD_PROTOCOL -14
178 
181  #define MQTTASYNC_BAD_MQTT_OPTION -15
182 
185  #define MQTTASYNC_WRONG_MQTT_VERSION -16
186 
189  #define MQTTASYNC_0_LEN_WILL_TOPIC -17
190 
191 
195 #define MQTTVERSION_DEFAULT 0
196 
199 #define MQTTVERSION_3_1 3
200 
203 #define MQTTVERSION_3_1_1 4
204 
207 #define MQTTVERSION_5 5
208 
211 #define MQTT_BAD_SUBSCRIBE 0x80
212 
213 
217 typedef struct
218 {
220  char struct_id[4];
226 
227 #define MQTTAsync_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 }
228 
233 LIBMQTT_API void MQTTAsync_global_init(MQTTAsync_init_options* inits);
234 
239 typedef void* MQTTAsync;
249 typedef int MQTTAsync_token;
250 
257 typedef struct
258 {
260  char struct_id[4];
267  void* payload;
281  int qos;
300  int retained;
307  int dup;
311  int msgid;
317 
318 #define MQTTAsync_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer }
319 
353 typedef int MQTTAsync_messageArrived(void* context, char* topicName, int topicLen, MQTTAsync_message* message);
354 
376 typedef void MQTTAsync_deliveryComplete(void* context, MQTTAsync_token token);
377 
396 typedef void MQTTAsync_connectionLost(void* context, char* cause);
397 
398 
414 typedef void MQTTAsync_connected(void* context, char* cause);
415 
428 typedef void MQTTAsync_disconnected(void* context, MQTTProperties* properties,
429  enum MQTTReasonCodes reasonCode);
430 
446 LIBMQTT_API int MQTTAsync_setDisconnected(MQTTAsync handle, void* context, MQTTAsync_disconnected* co);
447 
448 
450 typedef struct
451 {
455  int code;
457  const char *message;
459 
460 
462 typedef struct
463 {
465  char struct_id[4];
471  enum MQTTReasonCodes reasonCode;
475  int code;
477  const char *message;
481 
482 #define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, 0, NULL}
483 
485 typedef struct
486 {
490  union
491  {
494  int qos;
497  int* qosList;
499  struct
500  {
503  } pub;
504  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
505  struct
506  {
507  char* serverURI;
510  } connect;
511  } alt;
513 
514 
516 typedef struct
517 {
518  char struct_id[4];
522  enum MQTTReasonCodes reasonCode;
525  union
526  {
528  struct
529  {
532  } sub;
534  struct
535  {
538  } pub;
539  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
540  struct
541  {
542  char* serverURI;
545  } connect;
547  struct
548  {
549  int reasonCodeCount;
550  enum MQTTReasonCodes* reasonCodes;
551  } unsub;
552  } alt;
554 
555 #define MQTTAsync_successData5_initializer {{'M', 'Q', 'S', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer}
556 
570 typedef void MQTTAsync_onSuccess(void* context, MQTTAsync_successData* response);
571 
586 typedef void MQTTAsync_onSuccess5(void* context, MQTTAsync_successData5* response);
587 
601 typedef void MQTTAsync_onFailure(void* context, MQTTAsync_failureData* response);
602 
616 typedef void MQTTAsync_onFailure5(void* context, MQTTAsync_failureData5* response);
617 
624 {
626  char struct_id[4];
647  void* context;
670  /*
671  * MQTT V5 subscribe options, when used with subscribe only.
672  */
674  /*
675  * MQTT V5 subscribe option count, when used with subscribeMany only.
676  * The number of entries in the subscribe_options_list array.
677  */
679  /*
680  * MQTT V5 subscribe option array, when used with subscribeMany only.
681  */
684 
685 #define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 1, NULL, NULL, 0, 0, NULL, NULL, MQTTProperties_initializer, MQTTSubscribe_options_initializer, 0, NULL}
686 
689 #define MQTTAsync_callOptions_initializer MQTTAsync_responseOptions_initializer
690 
719 LIBMQTT_API int MQTTAsync_setCallbacks(MQTTAsync handle, void* context, MQTTAsync_connectionLost* cl,
721 
742 LIBMQTT_API int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void* context,
744 
766 LIBMQTT_API int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void* context,
768 
788 LIBMQTT_API int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void* context,
790 
803 LIBMQTT_API int MQTTAsync_setConnected(MQTTAsync handle, void* context, MQTTAsync_connected* co);
804 
805 
814 LIBMQTT_API int MQTTAsync_reconnect(MQTTAsync handle);
815 
816 
858 LIBMQTT_API int MQTTAsync_create(MQTTAsync* handle, const char* serverURI, const char* clientId,
859  int persistence_type, void* persistence_context);
860 
862 typedef struct
863 {
865  char struct_id[4];
881 
882 #define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 1, 0, 100, MQTTVERSION_DEFAULT }
883 
884 #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 1, 0, 100, MQTTVERSION_5 }
885 
886 
887 LIBMQTT_API int MQTTAsync_createWithOptions(MQTTAsync* handle, const char* serverURI, const char* clientId,
888  int persistence_type, void* persistence_context, MQTTAsync_createOptions* options);
889 
902 typedef struct
903 {
905  char struct_id[4];
911  const char* topicName;
913  const char* message;
917  int retained;
922  int qos;
924  struct
925  {
926  int len;
927  const void* data;
928  } payload;
930 
931 #define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } }
932 
933 #define MQTT_SSL_VERSION_DEFAULT 0
934 #define MQTT_SSL_VERSION_TLS_1_0 1
935 #define MQTT_SSL_VERSION_TLS_1_1 2
936 #define MQTT_SSL_VERSION_TLS_1_2 3
937 
950 typedef struct
951 {
953  char struct_id[4];
956 
958  const char* trustStore;
959 
963  const char* keyStore;
964 
968  const char* privateKey;
970  const char* privateKeyPassword;
971 
980  const char* enabledCipherSuites;
981 
984 
990 
996  int verify;
997 
1003  const char* CApath;
1004 
1009  int (*ssl_error_cb) (const char *str, size_t len, void *u);
1010 
1016 
1022  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);
1023 
1029 
1036 
1038 
1039 #define MQTTAsync_SSLOptions_initializer { {'M', 'Q', 'T', 'S'}, 4, NULL, NULL, NULL, NULL, NULL, 1, MQTT_SSL_VERSION_DEFAULT, 0, NULL, NULL, NULL, NULL, NULL, 0}
1040 
1042 typedef struct
1043 {
1044  const char* name;
1045  const char* value;
1047 
1053 typedef struct
1054 {
1056  char struct_id[4];
1115  const char* username;
1121  const char* password;
1156  void* context;
1169  char* const* serverURIs;
1192  struct {
1193  int len;
1194  const void* data;
1195  } binarypwd;
1200  /*
1201  * MQTT V5 clean start flag. Only clears state at the beginning of the session.
1202  */
1225 
1226 
1227 #define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 7, 60, 1, 65535, NULL, NULL, NULL, 30, 0,\
1228 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, NULL, 0, NULL, NULL, NULL, NULL}
1229 
1230 #define MQTTAsync_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 7, 60, 0, 65535, NULL, NULL, NULL, 30, 0,\
1231 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, NULL, 1, NULL, NULL, NULL, NULL}
1232 
1233 
1254 LIBMQTT_API int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options);
1255 
1257 typedef struct
1258 {
1260  char struct_id[4];
1267  int timeout;
1285  void* context;
1293  enum MQTTReasonCodes reasonCode;
1307 
1308 #define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 0, 0, NULL, NULL, NULL,\
1309  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1310 
1311 #define MQTTAsync_disconnectOptions_initializer5 { {'M', 'Q', 'T', 'D'}, 1, 0, NULL, NULL, NULL,\
1312  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1313 
1332 LIBMQTT_API int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions* options);
1333 
1334 
1342 LIBMQTT_API int MQTTAsync_isConnected(MQTTAsync handle);
1343 
1344 
1359 LIBMQTT_API int MQTTAsync_subscribe(MQTTAsync handle, const char* topic, int qos, MQTTAsync_responseOptions* response);
1360 
1361 
1379 LIBMQTT_API int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char* const* topic, int* qos, MQTTAsync_responseOptions* response);
1380 
1393 LIBMQTT_API int MQTTAsync_unsubscribe(MQTTAsync handle, const char* topic, MQTTAsync_responseOptions* response);
1394 
1407 LIBMQTT_API int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const* topic, MQTTAsync_responseOptions* response);
1408 
1409 
1428 LIBMQTT_API int MQTTAsync_send(MQTTAsync handle, const char* destinationName, int payloadlen, const void* payload, int qos,
1429  int retained, MQTTAsync_responseOptions* response);
1430 
1446 LIBMQTT_API int MQTTAsync_sendMessage(MQTTAsync handle, const char* destinationName, const MQTTAsync_message* msg, MQTTAsync_responseOptions* response);
1447 
1448 
1467 LIBMQTT_API int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens);
1468 
1477 #define MQTTASYNC_TRUE 1
1478 LIBMQTT_API int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token);
1479 
1480 
1491 LIBMQTT_API int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout);
1492 
1493 
1504 LIBMQTT_API void MQTTAsync_freeMessage(MQTTAsync_message** msg);
1505 
1514 LIBMQTT_API void MQTTAsync_free(void* ptr);
1515 
1523 LIBMQTT_API void MQTTAsync_destroy(MQTTAsync* handle);
1524 
1525 
1526 
1528 {
1536 };
1537 
1538 
1544 LIBMQTT_API void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level);
1545 
1546 
1555 typedef void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char* message);
1556 
1563 LIBMQTT_API void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback* callback);
1564 
1572 
1579 LIBMQTT_API const char* MQTTAsync_strerror(int code);
1580 
1581 
2185 #ifdef __cplusplus
2186  }
2187 #endif
2188 
2189 #endif
int sendWhileDisconnected
Definition: MQTTAsync.h:871
MQTTAsync_token token
Definition: MQTTAsync.h:488
int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char *const *topic, int *qos, MQTTAsync_responseOptions *response)
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:659
Definition: MQTTAsync.h:1533
int struct_version
Definition: MQTTAsync.h:519
int len
Definition: MQTTAsync.h:926
void * ssl_error_context
Definition: MQTTAsync.h:1015
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:457
int MQTTAsync_token
Definition: MQTTAsync.h:249
int * qosList
Definition: MQTTAsync.h:497
MQTTProperties properties
Definition: MQTTAsync.h:669
char *const * serverURIs
Definition: MQTTAsync.h:1169
char * serverURI
Definition: MQTTAsync.h:542
int struct_version
Definition: MQTTAsync.h:1066
char * destinationName
Definition: MQTTAsync.h:537
MQTTAsync_token token
Definition: MQTTAsync.h:521
MQTTAsync_token token
Definition: MQTTAsync.h:453
Definition: MQTTAsync.h:902
void MQTTAsync_connectionLost(void *context, char *cause)
Definition: MQTTAsync.h:396
int MQTTVersion
Definition: MQTTAsync.h:508
MQTTProperties properties
Definition: MQTTAsync.h:1289
MQTTAsync_willOptions * will
Definition: MQTTAsync.h:1109
MQTTAsync_token token
Definition: MQTTAsync.h:653
void MQTTAsync_connected(void *context, char *cause)
Definition: MQTTAsync.h:414
int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions *options)
int struct_version
Definition: MQTTAsync.h:222
const char * keyStore
Definition: MQTTAsync.h:963
const void * data
Definition: MQTTAsync.h:1194
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:879
int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void *context, MQTTAsync_messageArrived *ma)
int sessionPresent
Definition: MQTTAsync.h:509
Definition: MQTTAsync.h:257
int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char *const *topic, MQTTAsync_responseOptions *response)
int MQTTVersion
Definition: MQTTAsync.h:1176
int struct_version
Definition: MQTTAsync.h:629
const char * password
Definition: MQTTAsync.h:1121
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:665
int cleanstart
Definition: MQTTAsync.h:1203
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:641
int keepAliveInterval
Definition: MQTTAsync.h:1077
void MQTTAsync_deliveryComplete(void *context, MQTTAsync_token token)
Definition: MQTTAsync.h:376
int qos
Definition: MQTTAsync.h:281
int MQTTVersion
Definition: MQTTAsync.h:543
MQTTProperties * willProperties
Definition: MQTTAsync.h:1211
Definition: MQTTSubscribeOpts.h:21
MQTTASYNC_TRACE_LEVELS
Definition: MQTTAsync.h:1527
int automaticReconnect
Definition: MQTTAsync.h:1180
void * payload
Definition: MQTTAsync.h:267
int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions *options)
const char * trustStore
Definition: MQTTAsync.h:958
const MQTTAsync_nameValue * httpHeaders
Definition: MQTTAsync.h:1199
void * context
Definition: MQTTAsync.h:647
char struct_id[4]
Definition: MQTTAsync.h:626
int MQTTAsync_setCallbacks(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl, MQTTAsync_messageArrived *ma, MQTTAsync_deliveryComplete *dc)
const char * CApath
Definition: MQTTAsync.h:1003
int payloadlen
Definition: MQTTAsync.h:265
MQTTAsync_message message
Definition: MQTTAsync.h:501
MQTTSubscribe_options subscribeOptions
Definition: MQTTAsync.h:673
int packet_type
Definition: MQTTAsync.h:479
Definition: MQTTAsync.h:623
int MQTTAsync_send(MQTTAsync handle, const char *destinationName, int payloadlen, const void *payload, int qos, int retained, MQTTAsync_responseOptions *response)
int msgid
Definition: MQTTAsync.h:311
MQTTProperties * connectProperties
Definition: MQTTAsync.h:1207
int struct_version
Definition: MQTTAsync.h:955
int struct_version
Definition: MQTTAsync.h:869
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1305
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1299
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1150
int struct_version
Definition: MQTTAsync.h:1262
struct MQTTAsync_responseOptions MQTTAsync_responseOptions
MQTTAsync_SSLOptions * ssl
Definition: MQTTAsync.h:1138
const char * privateKeyPassword
Definition: MQTTAsync.h:970
int sslVersion
Definition: MQTTAsync.h:989
const char * topicName
Definition: MQTTAsync.h:911
Definition: MQTTAsync.h:1532
int MQTTAsync_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
Definition: MQTTAsync.h:353
int subscribeOptionsCount
Definition: MQTTAsync.h:678
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1273
Definition: MQTTAsync.h:1053
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1223
const char * name
Definition: MQTTAsync.h:1044
Definition: MQTTAsync.h:1534
Definition: MQTTAsync.h:950
void * context
Definition: MQTTAsync.h:1285
MQTTProperties properties
Definition: MQTTAsync.h:473
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:635
int reasonCodeCount
Definition: MQTTAsync.h:530
void MQTTAsync_free(void *ptr)
int struct_version
Definition: MQTTAsync.h:909
char * destinationName
Definition: MQTTAsync.h:502
int retryInterval
Definition: MQTTAsync.h:1133
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1144
void MQTTAsync_freeMessage(MQTTAsync_message **msg)
int MQTTAsync_create(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
Definition: MQTTAsync.h:862
MQTTSubscribe_options * subscribeOptionsList
Definition: MQTTAsync.h:682
int struct_version
Definition: MQTTAsync.h:467
void MQTTAsync_onFailure5(void *context, MQTTAsync_failureData5 *response)
Definition: MQTTAsync.h:616
void * ssl_psk_context
Definition: MQTTAsync.h:1028
Definition: MQTTProperties.h:112
Definition: MQTTAsync.h:1535
int verify
Definition: MQTTAsync.h:996
MQTTAsync_token token
Definition: MQTTAsync.h:469
void MQTTAsync_onSuccess(void *context, MQTTAsync_successData *response)
Definition: MQTTAsync.h:570
MQTTProperties properties
Definition: MQTTAsync.h:523
void MQTTAsync_global_init(MQTTAsync_init_options *inits)
int do_openssl_init
Definition: MQTTAsync.h:224
MQTTReasonCodes
Definition: MQTTReasonCodes.h:23
Definition: MQTTAsync.h:450
int connectTimeout
Definition: MQTTAsync.h:1125
Definition: MQTTAsync.h:462
int maxBufferedMessages
Definition: MQTTAsync.h:873
int maxInflight
Definition: MQTTAsync.h:1103
void MQTTAsync_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
Definition: MQTTAsync.h:428
MQTTAsync_message message
Definition: MQTTAsync.h:536
int MQTTAsync_subscribe(MQTTAsync handle, const char *topic, int qos, MQTTAsync_responseOptions *response)
Definition: MQTTAsync.h:1042
Definition: MQTTAsync.h:1529
int len
Definition: MQTTAsync.h:1193
const char * MQTTAsync_strerror(int code)
int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void *context, MQTTAsync_deliveryComplete *dc)
const void * data
Definition: MQTTAsync.h:927
Definition: MQTTAsync.h:1530
int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl)
int serverURIcount
Definition: MQTTAsync.h:1160
const char * value
Definition: MQTTAsync.h:1045
void * MQTTAsync
Definition: MQTTAsync.h:239
int qos
Definition: MQTTAsync.h:494
int disableDefaultTrustStore
Definition: MQTTAsync.h:1035
const char * username
Definition: MQTTAsync.h:1115
int enableServerCertAuth
Definition: MQTTAsync.h:983
int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token)
void MQTTAsync_onFailure(void *context, MQTTAsync_failureData *response)
Definition: MQTTAsync.h:601
int code
Definition: MQTTAsync.h:475
const char * message
Definition: MQTTAsync.h:477
Definition: MQTTAsync.h:1257
int retained
Definition: MQTTAsync.h:917
int timeout
Definition: MQTTAsync.h:1267
void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char *message)
Definition: MQTTAsync.h:1555
int struct_version
Definition: MQTTAsync.h:263
void * context
Definition: MQTTAsync.h:1156
int code
Definition: MQTTAsync.h:455
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1279
Definition: MQTTAsync.h:217
const char * privateKey
Definition: MQTTAsync.h:968
int maxRetryInterval
Definition: MQTTAsync.h:1188
int MQTTAsync_sendMessage(MQTTAsync handle, const char *destinationName, const MQTTAsync_message *msg, MQTTAsync_responseOptions *response)
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1217
const char * enabledCipherSuites
Definition: MQTTAsync.h:980
int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout)
int qos
Definition: MQTTAsync.h:922
int MQTTAsync_setConnected(MQTTAsync handle, void *context, MQTTAsync_connected *co)
int cleansession
Definition: MQTTAsync.h:1099
enum MQTTReasonCodes * reasonCodes
Definition: MQTTAsync.h:531
const char * message
Definition: MQTTAsync.h:913
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:516
int minRetryInterval
Definition: MQTTAsync.h:1184
int MQTTAsync_reconnect(MQTTAsync handle)
int retained
Definition: MQTTAsync.h:300
Definition: MQTTAsync.h:1531
int dup
Definition: MQTTAsync.h:307
MQTTAsync_nameValue * MQTTAsync_getVersionInfo(void)
MQTTProperties properties
Definition: MQTTAsync.h:315
Definition: MQTTAsync.h:485
void MQTTAsync_onSuccess5(void *context, MQTTAsync_successData5 *response)
Definition: MQTTAsync.h:586
char * serverURI
Definition: MQTTAsync.h:507
int sessionPresent
Definition: MQTTAsync.h:544
int MQTTAsync_setDisconnected(MQTTAsync handle, void *context, MQTTAsync_disconnected *co)
void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)