Paho Asynchronous MQTT C Client Library
MQTTAsync.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2009, 2018 IBM Corp.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * and Eclipse Distribution License v1.0 which accompany this distribution.
7  *
8  * The Eclipse Public License is available at
9  * http://www.eclipse.org/legal/epl-v10.html
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 #if defined(WIN32) || defined(WIN64)
96  #define DLLImport __declspec(dllimport)
97  #define DLLExport __declspec(dllexport)
98 #else
99  #define DLLImport extern
100  #define DLLExport __attribute__ ((visibility ("default")))
101 #endif
102 
103 #include <stdio.h>
104 /*
106 */
107 
108 #include "MQTTProperties.h"
109 #include "MQTTReasonCodes.h"
110 #include "MQTTSubscribeOpts.h"
111 #if !defined(NO_PERSISTENCE)
112 #include "MQTTClientPersistence.h"
113 #endif
114 
119 #define MQTTASYNC_SUCCESS 0
120 
124 #define MQTTASYNC_FAILURE -1
125 
126 /* error code -2 is MQTTAsync_PERSISTENCE_ERROR */
127 
128 #define MQTTASYNC_PERSISTENCE_ERROR -2
129 
133 #define MQTTASYNC_DISCONNECTED -3
134 
138 #define MQTTASYNC_MAX_MESSAGES_INFLIGHT -4
139 
142 #define MQTTASYNC_BAD_UTF8_STRING -5
143 
146 #define MQTTASYNC_NULL_PARAMETER -6
147 
152 #define MQTTASYNC_TOPICNAME_TRUNCATED -7
153 
157 #define MQTTASYNC_BAD_STRUCTURE -8
158 
161 #define MQTTASYNC_BAD_QOS -9
162 
165 #define MQTTASYNC_NO_MORE_MSGIDS -10
166 
169 #define MQTTASYNC_OPERATION_INCOMPLETE -11
170 
173 #define MQTTASYNC_MAX_BUFFERED_MESSAGES -12
174 
177 #define MQTTASYNC_SSL_NOT_SUPPORTED -13
178 
181 #define MQTTASYNC_BAD_PROTOCOL -14
182 
185  #define MQTTASYNC_BAD_MQTT_OPTION -15
186 
189  #define MQTTASYNC_WRONG_MQTT_VERSION -16
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 
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 
346 typedef int MQTTAsync_messageArrived(void* context, char* topicName, int topicLen, MQTTAsync_message* message);
347 
366 typedef void MQTTAsync_deliveryComplete(void* context, MQTTAsync_token token);
367 
383 typedef void MQTTAsync_connectionLost(void* context, char* cause);
384 
385 
398 typedef void MQTTAsync_connected(void* context, char* cause);
399 
409 typedef void MQTTAsync_disconnected(void* context, MQTTProperties* properties,
410  enum MQTTReasonCodes reasonCode);
411 
425 
426 
428 typedef struct
429 {
433  int code;
435  const char *message;
437 
438 
440 typedef struct
441 {
443  char struct_id[4];
449  enum MQTTReasonCodes reasonCode;
453  int code;
455  const char *message;
459 
460 #define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, 0, NULL}
461 
463 typedef struct
464 {
468  union
469  {
471  int qos;
473  int* qosList;
475  struct
476  {
479  } pub;
480  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
481  struct
482  {
483  char* serverURI;
486  } connect;
487  } alt;
489 
490 
492 typedef struct
493 {
494  char struct_id[4];
498  enum MQTTReasonCodes reasonCode;
501  union
502  {
504  struct
505  {
508  } sub;
510  struct
511  {
514  } pub;
515  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
516  struct
517  {
518  char* serverURI;
521  } connect;
523  struct
524  {
525  int reasonCodeCount;
526  enum MQTTReasonCodes* reasonCodes;
527  } unsub;
528  } alt;
530 
531 #define MQTTAsync_successData5_initializer {{'M', 'Q', 'S', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer}
532 
543 typedef void MQTTAsync_onSuccess(void* context, MQTTAsync_successData* response);
544 
556 typedef void MQTTAsync_onSuccess5(void* context, MQTTAsync_successData5* response);
557 
568 typedef void MQTTAsync_onFailure(void* context, MQTTAsync_failureData* response);
569 
580 typedef void MQTTAsync_onFailure5(void* context, MQTTAsync_failureData5* response);
581 
583 {
585  char struct_id[4];
606  void* context;
629  /*
630  * MQTT V5 subscribe options, when used with subscribe only.
631  */
633  /*
634  * MQTT V5 subscribe option count, when used with subscribeMany only.
635  * The number of entries in the subscribe_options_list array.
636  */
638  /*
639  * MQTT V5 subscribe option array, when used with subscribeMany only.
640  */
643 
644 #define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 1, NULL, NULL, 0, 0, NULL, NULL, MQTTProperties_initializer, MQTTSubscribe_options_initializer, 0, NULL}
645 
647 #define MQTTAsync_callOptions_initializer MQTTAsync_responseOptions_initializer
648 
679 
702 
726 
748 
762 
763 
773 
774 
816 DLLExport int MQTTAsync_create(MQTTAsync* handle, const char* serverURI, const char* clientId,
817  int persistence_type, void* persistence_context);
818 
819 typedef struct
820 {
822  char struct_id[4];
838 
839 #define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 0, 0, 100, MQTTVERSION_DEFAULT }
840 
841 
842 DLLExport int MQTTAsync_createWithOptions(MQTTAsync* handle, const char* serverURI, const char* clientId,
843  int persistence_type, void* persistence_context, MQTTAsync_createOptions* options);
844 
857 typedef struct
858 {
860  char struct_id[4];
866  const char* topicName;
868  const char* message;
872  int retained;
877  int qos;
879  struct
880  {
881  int len;
882  const void* data;
883  } payload;
885 
886 #define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } }
887 
888 #define MQTT_SSL_VERSION_DEFAULT 0
889 #define MQTT_SSL_VERSION_TLS_1_0 1
890 #define MQTT_SSL_VERSION_TLS_1_1 2
891 #define MQTT_SSL_VERSION_TLS_1_2 3
892 
905 typedef struct
906 {
908  char struct_id[4];
911 
913  const char* trustStore;
914 
918  const char* keyStore;
919 
923  const char* privateKey;
925  const char* privateKeyPassword;
926 
935  const char* enabledCipherSuites;
936 
939 
945 
951  int verify;
952 
958  const char* CApath;
959 
964  int (*ssl_error_cb) (const char *str, size_t len, void *u);
965 
972 
973 #define MQTTAsync_SSLOptions_initializer { {'M', 'Q', 'T', 'S'}, 3, NULL, NULL, NULL, NULL, NULL, 1, MQTT_SSL_VERSION_DEFAULT, 0, NULL, NULL, NULL }
974 
980 typedef struct
981 {
983  char struct_id[4];
1041  const char* username;
1047  const char* password;
1082  void* context;
1095  char* const* serverURIs;
1118  struct {
1119  int len;
1120  const void* data;
1121  } binarypwd;
1122  /*
1123  * MQTT V5 clean start flag. Only clears state at the beginning of the session.
1124  */
1147 
1148 
1149 #define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 6, 60, 1, 65535, NULL, NULL, NULL, 30, 0,\
1150 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL}
1151 
1152 #define MQTTAsync_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 6, 60, 0, 65535, NULL, NULL, NULL, 30, 0,\
1153 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL}
1154 
1155 
1177 
1178 
1179 typedef struct
1180 {
1182  char struct_id[4];
1189  int timeout;
1207  void* context;
1215  enum MQTTReasonCodes reasonCode;
1229 
1230 #define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 1, 0, NULL, NULL, NULL, MQTTProperties_initializer, MQTTREASONCODE_SUCCESS }
1231 
1232 
1252 
1253 
1262 
1263 
1278 DLLExport int MQTTAsync_subscribe(MQTTAsync handle, const char* topic, int qos, MQTTAsync_responseOptions* response);
1279 
1280 
1298 DLLExport int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char* const* topic, int* qos, MQTTAsync_responseOptions* response);
1299 
1312 DLLExport int MQTTAsync_unsubscribe(MQTTAsync handle, const char* topic, MQTTAsync_responseOptions* response);
1313 
1326 DLLExport int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const* topic, MQTTAsync_responseOptions* response);
1327 
1328 
1347 DLLExport int MQTTAsync_send(MQTTAsync handle, const char* destinationName, int payloadlen, const void* payload, int qos,
1348  int retained, MQTTAsync_responseOptions* response);
1349 
1350 
1366 DLLExport int MQTTAsync_sendMessage(MQTTAsync handle, const char* destinationName, const MQTTAsync_message* msg, MQTTAsync_responseOptions* response);
1367 
1368 
1388 
1397 #define MQTTASYNC_TRUE 1
1399 
1400 
1411 DLLExport int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout);
1412 
1413 
1425 
1434 DLLExport void MQTTAsync_free(void* ptr);
1435 
1443 DLLExport void MQTTAsync_destroy(MQTTAsync* handle);
1444 
1445 
1446 
1448 {
1456 };
1457 
1458 
1465 
1466 
1475 typedef void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char* message);
1476 
1484 
1485 
1486 typedef struct
1487 {
1488  const char* name;
1489  const char* value;
1491 
1499 
1506 DLLExport const char* MQTTAsync_strerror(int code);
1507 
1508 
2064 #ifdef __cplusplus
2065  }
2066 #endif
2067 
2068 #endif
MQTTAsync_isConnected
int MQTTAsync_isConnected(MQTTAsync handle)
MQTTAsync_waitForCompletion
int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout)
MQTTAsync_successData::qosList
int * qosList
Definition: MQTTAsync.h:473
MQTTAsync_responseOptions::context
void * context
Definition: MQTTAsync.h:606
MQTTProperties.h
MQTTAsync_successData5::sessionPresent
int sessionPresent
Definition: MQTTAsync.h:520
MQTTAsync_token
int MQTTAsync_token
Definition: MQTTAsync.h:249
MQTTAsync_successData::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:484
MQTTAsync_createOptions::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:836
MQTTAsync_setDisconnected
int MQTTAsync_setDisconnected(MQTTAsync handle, void *context, MQTTAsync_disconnected *co)
MQTTAsync_createWithOptions
int MQTTAsync_createWithOptions(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTAsync_createOptions *options)
MQTTAsync_createOptions::struct_version
int struct_version
Definition: MQTTAsync.h:826
MQTTAsync_getVersionInfo
MQTTAsync_nameValue * MQTTAsync_getVersionInfo(void)
MQTTAsync_subscribe
int MQTTAsync_subscribe(MQTTAsync handle, const char *topic, int qos, MQTTAsync_responseOptions *response)
MQTTAsync
void * MQTTAsync
Definition: MQTTAsync.h:239
MQTTAsync_connectOptions::struct_version
int struct_version
Definition: MQTTAsync.h:992
MQTTAsync_successData::serverURI
char * serverURI
Definition: MQTTAsync.h:483
MQTTAsync_successData::sessionPresent
int sessionPresent
Definition: MQTTAsync.h:485
MQTTAsync_init_options::do_openssl_init
int do_openssl_init
Definition: MQTTAsync.h:224
MQTTAsync_setTraceCallback
void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback *callback)
MQTTAsync_setMessageArrivedCallback
int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void *context, MQTTAsync_messageArrived *ma)
MQTTAsync_subscribeMany
int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char *const *topic, int *qos, MQTTAsync_responseOptions *response)
MQTTAsync_successData5
Definition: MQTTAsync.h:492
MQTTAsync_deliveryComplete
void MQTTAsync_deliveryComplete(void *context, MQTTAsync_token token)
Definition: MQTTAsync.h:366
MQTTAsync_isComplete
int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token)
MQTTAsync_connectOptions::cleanstart
int cleanstart
Definition: MQTTAsync.h:1125
MQTTAsync_successData5::token
MQTTAsync_token token
Definition: MQTTAsync.h:497
MQTTAsync_message::retained
int retained
Definition: MQTTAsync.h:300
MQTTAsync_failureData5
Definition: MQTTAsync.h:440
MQTTAsync_failureData::message
const char * message
Definition: MQTTAsync.h:435
MQTTAsync_SSLOptions::struct_version
int struct_version
Definition: MQTTAsync.h:910
MQTTProperties
Definition: MQTTProperties.h:118
MQTTAsync_SSLOptions::trustStore
const char * trustStore
Definition: MQTTAsync.h:913
MQTTAsync_responseOptions::properties
MQTTProperties properties
Definition: MQTTAsync.h:628
MQTTAsync_connectOptions::automaticReconnect
int automaticReconnect
Definition: MQTTAsync.h:1106
MQTTAsync_SSLOptions::privateKey
const char * privateKey
Definition: MQTTAsync.h:923
MQTTAsync_successData5::struct_version
int struct_version
Definition: MQTTAsync.h:495
MQTTAsync_message::msgid
int msgid
Definition: MQTTAsync.h:311
MQTTAsync_failureData5::code
int code
Definition: MQTTAsync.h:453
MQTTAsync_connectOptions::serverURIs
char *const * serverURIs
Definition: MQTTAsync.h:1095
MQTTAsync_responseOptions::struct_id
char struct_id[4]
Definition: MQTTAsync.h:585
MQTTAsync_failureData5::packet_type
int packet_type
Definition: MQTTAsync.h:457
MQTTAsync_disconnectOptions::properties
MQTTProperties properties
Definition: MQTTAsync.h:1211
MQTTAsync_setCallbacks
int MQTTAsync_setCallbacks(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl, MQTTAsync_messageArrived *ma, MQTTAsync_deliveryComplete *dc)
MQTTAsync_sendMessage
int MQTTAsync_sendMessage(MQTTAsync handle, const char *destinationName, const MQTTAsync_message *msg, MQTTAsync_responseOptions *response)
MQTTAsync_connectOptions::will
MQTTAsync_willOptions * will
Definition: MQTTAsync.h:1035
MQTTAsync_SSLOptions::CApath
const char * CApath
Definition: MQTTAsync.h:958
MQTTAsync_failureData::token
MQTTAsync_token token
Definition: MQTTAsync.h:431
MQTTAsync_send
int MQTTAsync_send(MQTTAsync handle, const char *destinationName, int payloadlen, const void *payload, int qos, int retained, MQTTAsync_responseOptions *response)
MQTTAsync_SSLOptions
Definition: MQTTAsync.h:905
MQTTAsync_disconnect
int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions *options)
MQTTASYNC_TRACE_SEVERE
@ MQTTASYNC_TRACE_SEVERE
Definition: MQTTAsync.h:1454
MQTTAsync_connectOptions::willProperties
MQTTProperties * willProperties
Definition: MQTTAsync.h:1133
MQTTAsync_connectOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1139
MQTTAsync_message::payloadlen
int payloadlen
Definition: MQTTAsync.h:265
MQTTAsync_SSLOptions::sslVersion
int sslVersion
Definition: MQTTAsync.h:944
MQTTAsync_successData5::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:519
MQTTAsync_SSLOptions::keyStore
const char * keyStore
Definition: MQTTAsync.h:918
MQTTAsync_destroy
void MQTTAsync_destroy(MQTTAsync *handle)
MQTTAsync_unsubscribeMany
int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char *const *topic, MQTTAsync_responseOptions *response)
MQTTAsync_connectOptions::serverURIcount
int serverURIcount
Definition: MQTTAsync.h:1086
MQTTAsync_disconnectOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1227
MQTTAsync_successData5::message
MQTTAsync_message message
Definition: MQTTAsync.h:512
MQTTAsync_connectOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1145
MQTTAsync_connectOptions::connectTimeout
int connectTimeout
Definition: MQTTAsync.h:1051
MQTTAsync_failureData5::token
MQTTAsync_token token
Definition: MQTTAsync.h:447
MQTTAsync_setTraceLevel
void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)
MQTTAsync_connectOptions::connectProperties
MQTTProperties * connectProperties
Definition: MQTTAsync.h:1129
MQTTAsync_connectOptions::maxRetryInterval
int maxRetryInterval
Definition: MQTTAsync.h:1114
MQTTAsync_successData
Definition: MQTTAsync.h:463
MQTTAsync_setConnectionLostCallback
int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl)
MQTTAsync_disconnectOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1195
MQTTASYNC_TRACE_FATAL
@ MQTTASYNC_TRACE_FATAL
Definition: MQTTAsync.h:1455
MQTTSubscribeOpts.h
MQTTAsync_onFailure
void MQTTAsync_onFailure(void *context, MQTTAsync_failureData *response)
Definition: MQTTAsync.h:568
MQTTAsync_responseOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:624
MQTTAsync_traceCallback
void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char *message)
Definition: MQTTAsync.h:1475
MQTTAsync_getPendingTokens
int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens)
MQTTAsync_connectOptions::retryInterval
int retryInterval
Definition: MQTTAsync.h:1059
MQTTAsync_disconnectOptions::context
void * context
Definition: MQTTAsync.h:1207
MQTTAsync_successData::message
MQTTAsync_message message
Definition: MQTTAsync.h:477
MQTTAsync_connectOptions::minRetryInterval
int minRetryInterval
Definition: MQTTAsync.h:1110
MQTTAsync_failureData5::struct_version
int struct_version
Definition: MQTTAsync.h:445
MQTTAsync_responseOptions
Definition: MQTTAsync.h:582
MQTTAsync_successData5::properties
MQTTProperties properties
Definition: MQTTAsync.h:499
MQTTASYNC_TRACE_MAXIMUM
@ MQTTASYNC_TRACE_MAXIMUM
Definition: MQTTAsync.h:1449
MQTTAsync_create
int MQTTAsync_create(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
MQTTAsync_willOptions::topicName
const char * topicName
Definition: MQTTAsync.h:866
MQTTAsync_connectionLost
void MQTTAsync_connectionLost(void *context, char *cause)
Definition: MQTTAsync.h:383
MQTTAsync_global_init
void MQTTAsync_global_init(MQTTAsync_init_options *inits)
MQTTAsync_init_options
Definition: MQTTAsync.h:217
MQTTAsync_onFailure5
void MQTTAsync_onFailure5(void *context, MQTTAsync_failureData5 *response)
Definition: MQTTAsync.h:580
MQTTAsync_connectOptions::keepAliveInterval
int keepAliveInterval
Definition: MQTTAsync.h:1003
MQTTAsync_successData5::destinationName
char * destinationName
Definition: MQTTAsync.h:513
MQTTAsync_disconnectOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1221
MQTTAsync_SSLOptions::enabledCipherSuites
const char * enabledCipherSuites
Definition: MQTTAsync.h:935
MQTTAsync_message::qos
int qos
Definition: MQTTAsync.h:281
MQTTReasonCodes.h
MQTTAsync_disconnectOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1184
MQTTAsync_unsubscribe
int MQTTAsync_unsubscribe(MQTTAsync handle, const char *topic, MQTTAsync_responseOptions *response)
MQTTAsync_disconnected
void MQTTAsync_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
Definition: MQTTAsync.h:409
MQTTAsync_messageArrived
int MQTTAsync_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
Definition: MQTTAsync.h:346
MQTTAsync_willOptions
Definition: MQTTAsync.h:857
MQTTAsync_message::payload
void * payload
Definition: MQTTAsync.h:267
MQTTASYNC_TRACE_MINIMUM
@ MQTTASYNC_TRACE_MINIMUM
Definition: MQTTAsync.h:1451
MQTTAsync_responseOptions::token
MQTTAsync_token token
Definition: MQTTAsync.h:612
MQTTAsync_reconnect
int MQTTAsync_reconnect(MQTTAsync handle)
MQTTAsync_connectOptions::data
const void * data
Definition: MQTTAsync.h:1120
MQTTASYNC_TRACE_LEVELS
MQTTASYNC_TRACE_LEVELS
Definition: MQTTAsync.h:1447
MQTTAsync_willOptions::struct_version
int struct_version
Definition: MQTTAsync.h:864
MQTTAsync_nameValue::name
const char * name
Definition: MQTTAsync.h:1488
MQTTAsync_setDeliveryCompleteCallback
int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void *context, MQTTAsync_deliveryComplete *dc)
MQTTAsync_successData::destinationName
char * destinationName
Definition: MQTTAsync.h:478
MQTTAsync_connect
int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions *options)
MQTTAsync_createOptions::sendWhileDisconnected
int sendWhileDisconnected
Definition: MQTTAsync.h:828
MQTTAsync_message
Definition: MQTTAsync.h:257
MQTTAsync_responseOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:600
MQTTAsync_connectOptions::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:1102
MQTTAsync_connectOptions::username
const char * username
Definition: MQTTAsync.h:1041
MQTTAsync_free
void MQTTAsync_free(void *ptr)
MQTTAsync_connectOptions
Definition: MQTTAsync.h:980
MQTTAsync_responseOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:618
MQTTAsync_failureData5::properties
MQTTProperties properties
Definition: MQTTAsync.h:451
MQTTASYNC_TRACE_PROTOCOL
@ MQTTASYNC_TRACE_PROTOCOL
Definition: MQTTAsync.h:1452
MQTTAsync_strerror
const char * MQTTAsync_strerror(int code)
MQTTAsync_SSLOptions::verify
int verify
Definition: MQTTAsync.h:951
MQTTAsync_successData5::serverURI
char * serverURI
Definition: MQTTAsync.h:518
MQTTAsync_nameValue
Definition: MQTTAsync.h:1486
MQTTAsync_SSLOptions::privateKeyPassword
const char * privateKeyPassword
Definition: MQTTAsync.h:925
MQTTAsync_failureData
Definition: MQTTAsync.h:428
MQTTSubscribe_options
Definition: MQTTSubscribeOpts.h:21
MQTTAsync_willOptions::data
const void * data
Definition: MQTTAsync.h:882
MQTTAsync_connectOptions::maxInflight
int maxInflight
Definition: MQTTAsync.h:1029
MQTTAsync_responseOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:594
MQTTAsync_connectOptions::ssl
MQTTAsync_SSLOptions * ssl
Definition: MQTTAsync.h:1064
MQTTAsync_responseOptions
struct MQTTAsync_responseOptions MQTTAsync_responseOptions
MQTTAsync_willOptions::retained
int retained
Definition: MQTTAsync.h:872
MQTTAsync_createOptions::maxBufferedMessages
int maxBufferedMessages
Definition: MQTTAsync.h:830
MQTTAsync_successData5::reasonCodes
enum MQTTReasonCodes * reasonCodes
Definition: MQTTAsync.h:507
MQTTAsync_connectOptions::password
const char * password
Definition: MQTTAsync.h:1047
MQTTAsync_failureData::code
int code
Definition: MQTTAsync.h:433
MQTTAsync_responseOptions::subscribeOptions
MQTTSubscribe_options subscribeOptions
Definition: MQTTAsync.h:632
MQTTAsync_willOptions::message
const char * message
Definition: MQTTAsync.h:868
MQTTAsync_disconnectOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1201
MQTTAsync_nameValue::value
const char * value
Definition: MQTTAsync.h:1489
MQTTAsync_setConnected
int MQTTAsync_setConnected(MQTTAsync handle, void *context, MQTTAsync_connected *co)
MQTTAsync_failureData5::message
const char * message
Definition: MQTTAsync.h:455
MQTTAsync_disconnectOptions
Definition: MQTTAsync.h:1179
MQTTAsync_responseOptions::subscribeOptionsList
MQTTSubscribe_options * subscribeOptionsList
Definition: MQTTAsync.h:641
DLLExport
#define DLLExport
Definition: MQTTProperties.h:58
MQTTAsync_responseOptions::subscribeOptionsCount
int subscribeOptionsCount
Definition: MQTTAsync.h:637
MQTTAsync_connectOptions::len
int len
Definition: MQTTAsync.h:1119
MQTTASYNC_TRACE_ERROR
@ MQTTASYNC_TRACE_ERROR
Definition: MQTTAsync.h:1453
MQTTAsync_init_options::struct_version
int struct_version
Definition: MQTTAsync.h:222
MQTTAsync_connected
void MQTTAsync_connected(void *context, char *cause)
Definition: MQTTAsync.h:398
MQTTAsync_SSLOptions::enableServerCertAuth
int enableServerCertAuth
Definition: MQTTAsync.h:938
MQTTAsync_onSuccess5
void MQTTAsync_onSuccess5(void *context, MQTTAsync_successData5 *response)
Definition: MQTTAsync.h:556
MQTTClientPersistence.h
This structure represents a persistent data store, used to store outbound and inbound messages,...
MQTTAsync_successData5::reasonCodeCount
int reasonCodeCount
Definition: MQTTAsync.h:506
MQTTAsync_successData::qos
int qos
Definition: MQTTAsync.h:471
MQTTAsync_disconnectOptions::timeout
int timeout
Definition: MQTTAsync.h:1189
MQTTAsync_message::dup
int dup
Definition: MQTTAsync.h:307
MQTTAsync_message::properties
MQTTProperties properties
Definition: MQTTAsync.h:315
MQTTAsync_message::struct_version
int struct_version
Definition: MQTTAsync.h:263
MQTTAsync_willOptions::len
int len
Definition: MQTTAsync.h:881
MQTTAsync_SSLOptions::ssl_error_context
void * ssl_error_context
Definition: MQTTAsync.h:970
MQTTAsync_responseOptions::struct_version
int struct_version
Definition: MQTTAsync.h:588
MQTTAsync_willOptions::qos
int qos
Definition: MQTTAsync.h:877
MQTTAsync_successData::token
MQTTAsync_token token
Definition: MQTTAsync.h:466
MQTTAsync_connectOptions::cleansession
int cleansession
Definition: MQTTAsync.h:1025
MQTTASYNC_TRACE_MEDIUM
@ MQTTASYNC_TRACE_MEDIUM
Definition: MQTTAsync.h:1450
MQTTAsync_freeMessage
void MQTTAsync_freeMessage(MQTTAsync_message **msg)
MQTTReasonCodes
MQTTReasonCodes
Definition: MQTTReasonCodes.h:21
MQTTAsync_connectOptions::context
void * context
Definition: MQTTAsync.h:1082
MQTTAsync_onSuccess
void MQTTAsync_onSuccess(void *context, MQTTAsync_successData *response)
Definition: MQTTAsync.h:543
MQTTAsync_connectOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1076
MQTTAsync_createOptions
Definition: MQTTAsync.h:819
MQTTAsync_connectOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1070