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;
313  int msgid;
319 
320 #define MQTTAsync_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer }
321 
355 typedef int MQTTAsync_messageArrived(void* context, char* topicName, int topicLen, MQTTAsync_message* message);
356 
378 typedef void MQTTAsync_deliveryComplete(void* context, MQTTAsync_token token);
379 
398 typedef void MQTTAsync_connectionLost(void* context, char* cause);
399 
400 
416 typedef void MQTTAsync_connected(void* context, char* cause);
417 
430 typedef void MQTTAsync_disconnected(void* context, MQTTProperties* properties,
431  enum MQTTReasonCodes reasonCode);
432 
448 LIBMQTT_API int MQTTAsync_setDisconnected(MQTTAsync handle, void* context, MQTTAsync_disconnected* co);
449 
451 typedef struct
452 {
454  char struct_id[4];
463  const char* username;
469  struct {
470  int len;
471  const void* data;
472  } binarypwd;
474 
475 #define MQTTAsync_connectData_initializer {{'M', 'Q', 'C', 'D'}, 0, NULL, {0, NULL}}
476 
483 typedef int MQTTAsync_updateConnectOptions(void* context, MQTTAsync_connectData* data);
484 
494 LIBMQTT_API int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void* context, MQTTAsync_updateConnectOptions* co);
495 
505 LIBMQTT_API int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void* context, MQTTPersistence_beforeWrite* co);
506 
507 
517 LIBMQTT_API int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void* context, MQTTPersistence_afterRead* co);
518 
519 
521 typedef struct
522 {
526  int code;
528  const char *message;
530 
531 
533 typedef struct
534 {
536  char struct_id[4];
542  enum MQTTReasonCodes reasonCode;
546  int code;
548  const char *message;
552 
553 #define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, 0, NULL}
554 
556 typedef struct
557 {
561  union
562  {
565  int qos;
568  int* qosList;
570  struct
571  {
574  } pub;
575  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
576  struct
577  {
578  char* serverURI;
581  } connect;
582  } alt;
584 
585 
587 typedef struct
588 {
589  char struct_id[4];
593  enum MQTTReasonCodes reasonCode;
596  union
597  {
599  struct
600  {
603  } sub;
605  struct
606  {
609  } pub;
610  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
611  struct
612  {
613  char* serverURI;
616  } connect;
618  struct
619  {
620  int reasonCodeCount;
621  enum MQTTReasonCodes* reasonCodes;
622  } unsub;
623  } alt;
625 
626 #define MQTTAsync_successData5_initializer {{'M', 'Q', 'S', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer}
627 
641 typedef void MQTTAsync_onSuccess(void* context, MQTTAsync_successData* response);
642 
657 typedef void MQTTAsync_onSuccess5(void* context, MQTTAsync_successData5* response);
658 
672 typedef void MQTTAsync_onFailure(void* context, MQTTAsync_failureData* response);
673 
687 typedef void MQTTAsync_onFailure5(void* context, MQTTAsync_failureData5* response);
688 
695 {
697  char struct_id[4];
718  void* context;
741  /*
742  * MQTT V5 subscribe options, when used with subscribe only.
743  */
745  /*
746  * MQTT V5 subscribe option count, when used with subscribeMany only.
747  * The number of entries in the subscribe_options_list array.
748  */
750  /*
751  * MQTT V5 subscribe option array, when used with subscribeMany only.
752  */
755 
756 #define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 1, NULL, NULL, 0, 0, NULL, NULL, MQTTProperties_initializer, MQTTSubscribe_options_initializer, 0, NULL}
757 
760 #define MQTTAsync_callOptions_initializer MQTTAsync_responseOptions_initializer
761 
791 LIBMQTT_API int MQTTAsync_setCallbacks(MQTTAsync handle, void* context, MQTTAsync_connectionLost* cl,
793 
814 LIBMQTT_API int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void* context,
816 
838 LIBMQTT_API int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void* context,
840 
860 LIBMQTT_API int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void* context,
862 
875 LIBMQTT_API int MQTTAsync_setConnected(MQTTAsync handle, void* context, MQTTAsync_connected* co);
876 
877 
886 LIBMQTT_API int MQTTAsync_reconnect(MQTTAsync handle);
887 
888 
933 LIBMQTT_API int MQTTAsync_create(MQTTAsync* handle, const char* serverURI, const char* clientId,
934  int persistence_type, void* persistence_context);
935 
937 typedef struct
938 {
940  char struct_id[4];
961  /*
962  * When the maximum number of buffered messages is reached, delete the oldest rather than the newest.
963  */
965  /*
966  * Restore messages from persistence on create - or clear it.
967  */
969  /*
970  * Persist QoS0 publish commands - an option to not persist them.
971  */
974 
975 #define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_DEFAULT, 0, 0, 1, 1}
976 
977 #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_5, 0, 0, 1, 1}
978 
979 
980 LIBMQTT_API int MQTTAsync_createWithOptions(MQTTAsync* handle, const char* serverURI, const char* clientId,
981  int persistence_type, void* persistence_context, MQTTAsync_createOptions* options);
982 
995 typedef struct
996 {
998  char struct_id[4];
1004  const char* topicName;
1006  const char* message;
1015  int qos;
1017  struct
1018  {
1019  int len;
1020  const void* data;
1021  } payload;
1023 
1024 #define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } }
1025 
1026 #define MQTT_SSL_VERSION_DEFAULT 0
1027 #define MQTT_SSL_VERSION_TLS_1_0 1
1028 #define MQTT_SSL_VERSION_TLS_1_1 2
1029 #define MQTT_SSL_VERSION_TLS_1_2 3
1030 
1043 typedef struct
1044 {
1046  char struct_id[4];
1047 
1056 
1058  const char* trustStore;
1059 
1063  const char* keyStore;
1064 
1068  const char* privateKey;
1069 
1071  const char* privateKeyPassword;
1072 
1081  const char* enabledCipherSuites;
1082 
1085 
1091 
1097  int verify;
1098 
1104  const char* CApath;
1105 
1110  int (*ssl_error_cb) (const char *str, size_t len, void *u);
1111 
1117 
1123  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);
1124 
1130 
1137 
1145  const unsigned char *protos;
1146 
1151  unsigned int protos_len;
1153 
1154 #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 }
1155 
1157 typedef struct
1158 {
1159  const char* name;
1160  const char* value;
1162 
1168 typedef struct
1169 {
1171  char struct_id[4];
1231  const char* username;
1237  const char* password;
1272  void* context;
1288  char* const* serverURIs;
1311  struct {
1312  int len;
1313  const void* data;
1314  } binarypwd;
1315  /*
1316  * MQTT V5 clean start flag. Only clears state at the beginning of the session.
1317  */
1346  const char* httpProxy;
1350  const char* httpsProxy;
1352 
1353 
1354 #define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 8, 60, 1, 65535, NULL, NULL, NULL, 30, 0,\
1355 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1356 
1357 #define MQTTAsync_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 8, 60, 0, 65535, NULL, NULL, NULL, 30, 0,\
1358 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1359 
1360 #define MQTTAsync_connectOptions_initializer_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 1, 65535, NULL, NULL, NULL, 30, 0,\
1361 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1362 
1363 #define MQTTAsync_connectOptions_initializer5_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 0, 65535, NULL, NULL, NULL, 30, 0,\
1364 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1365 
1366 
1387 LIBMQTT_API int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options);
1388 
1390 typedef struct
1391 {
1393  char struct_id[4];
1400  int timeout;
1418  void* context;
1426  enum MQTTReasonCodes reasonCode;
1440 
1441 #define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 0, 0, NULL, NULL, NULL,\
1442  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1443 
1444 #define MQTTAsync_disconnectOptions_initializer5 { {'M', 'Q', 'T', 'D'}, 1, 0, NULL, NULL, NULL,\
1445  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1446 
1465 LIBMQTT_API int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions* options);
1466 
1467 
1475 LIBMQTT_API int MQTTAsync_isConnected(MQTTAsync handle);
1476 
1477 
1492 LIBMQTT_API int MQTTAsync_subscribe(MQTTAsync handle, const char* topic, int qos, MQTTAsync_responseOptions* response);
1493 
1494 
1512 LIBMQTT_API int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char* const* topic, const int* qos, MQTTAsync_responseOptions* response);
1513 
1526 LIBMQTT_API int MQTTAsync_unsubscribe(MQTTAsync handle, const char* topic, MQTTAsync_responseOptions* response);
1527 
1540 LIBMQTT_API int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const* topic, MQTTAsync_responseOptions* response);
1541 
1542 
1562 LIBMQTT_API int MQTTAsync_send(MQTTAsync handle, const char* destinationName, int payloadlen, const void* payload, int qos,
1563  int retained, MQTTAsync_responseOptions* response);
1564 
1581 LIBMQTT_API int MQTTAsync_sendMessage(MQTTAsync handle, const char* destinationName, const MQTTAsync_message* msg, MQTTAsync_responseOptions* response);
1582 
1583 
1602 LIBMQTT_API int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens);
1603 
1612 #define MQTTASYNC_TRUE 1
1613 LIBMQTT_API int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token);
1614 
1615 
1628 LIBMQTT_API int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout);
1629 
1630 
1641 LIBMQTT_API void MQTTAsync_freeMessage(MQTTAsync_message** msg);
1642 
1651 LIBMQTT_API void MQTTAsync_free(void* ptr);
1652 
1660 LIBMQTT_API void* MQTTAsync_malloc(size_t size);
1661 
1669 LIBMQTT_API void MQTTAsync_destroy(MQTTAsync* handle);
1670 
1671 
1672 
1674 {
1682 };
1683 
1684 
1690 LIBMQTT_API void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level);
1691 
1692 
1701 typedef void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char* message);
1702 
1709 LIBMQTT_API void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback* callback);
1710 
1718 
1725 LIBMQTT_API const char* MQTTAsync_strerror(int code);
1726 
1727 
2341 #if defined(__cplusplus)
2342  }
2343 #endif
2344 
2345 #endif
MQTTAsync_isConnected
int MQTTAsync_isConnected(MQTTAsync handle)
MQTTAsync_SSLOptions::protos_len
unsigned int protos_len
Definition: MQTTAsync.h:1151
MQTTAsync_waitForCompletion
int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout)
MQTTAsync_successData::qosList
int * qosList
Definition: MQTTAsync.h:568
MQTTAsync_connectOptions::httpHeaders
const MQTTAsync_nameValue * httpHeaders
Definition: MQTTAsync.h:1342
MQTTAsync_responseOptions::context
void * context
Definition: MQTTAsync.h:718
MQTTProperties.h
MQTTAsync_successData5::sessionPresent
int sessionPresent
Definition: MQTTAsync.h:615
MQTTAsync_token
int MQTTAsync_token
Definition: MQTTAsync.h:249
MQTTAsync_successData::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:579
MQTTAsync_createOptions::allowDisconnectedSendAtAnyTime
int allowDisconnectedSendAtAnyTime
Definition: MQTTAsync.h:960
MQTTAsync_createOptions::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:956
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:946
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::httpProxy
const char * httpProxy
Definition: MQTTAsync.h:1346
MQTTAsync_connectOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1182
MQTTAsync_successData::serverURI
char * serverURI
Definition: MQTTAsync.h:578
MQTTAsync_successData::sessionPresent
int sessionPresent
Definition: MQTTAsync.h:580
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_successData5
Definition: MQTTAsync.h:587
MQTTAsync_deliveryComplete
void MQTTAsync_deliveryComplete(void *context, MQTTAsync_token token)
Definition: MQTTAsync.h:378
MQTTAsync_isComplete
int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token)
MQTTAsync_connectOptions::cleanstart
int cleanstart
Definition: MQTTAsync.h:1318
MQTTAsync_successData5::token
MQTTAsync_token token
Definition: MQTTAsync.h:592
MQTTAsync_message::retained
int retained
Definition: MQTTAsync.h:300
MQTTAsync_failureData5
Definition: MQTTAsync.h:533
MQTTAsync_failureData::message
const char * message
Definition: MQTTAsync.h:528
MQTTAsync_SSLOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1055
MQTTProperties
Definition: MQTTProperties.h:112
MQTTAsync_SSLOptions::trustStore
const char * trustStore
Definition: MQTTAsync.h:1058
MQTTAsync_responseOptions::properties
MQTTProperties properties
Definition: MQTTAsync.h:740
MQTTAsync_connectOptions::automaticReconnect
int automaticReconnect
Definition: MQTTAsync.h:1299
MQTTAsync_SSLOptions::privateKey
const char * privateKey
Definition: MQTTAsync.h:1068
MQTTAsync_successData5::struct_version
int struct_version
Definition: MQTTAsync.h:590
MQTTAsync_message::msgid
int msgid
Definition: MQTTAsync.h:313
MQTTAsync_failureData5::code
int code
Definition: MQTTAsync.h:546
MQTTAsync_connectOptions::serverURIs
char *const * serverURIs
Definition: MQTTAsync.h:1288
MQTTAsync_responseOptions::struct_id
char struct_id[4]
Definition: MQTTAsync.h:697
MQTTAsync_failureData5::packet_type
int packet_type
Definition: MQTTAsync.h:550
MQTTAsync_disconnectOptions::properties
MQTTProperties properties
Definition: MQTTAsync.h:1422
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:1225
MQTTAsync_SSLOptions::CApath
const char * CApath
Definition: MQTTAsync.h:1104
MQTTAsync_failureData::token
MQTTAsync_token token
Definition: MQTTAsync.h:524
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:1043
MQTTAsync_malloc
void * MQTTAsync_malloc(size_t size)
MQTTAsync_disconnect
int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions *options)
MQTTASYNC_TRACE_SEVERE
@ MQTTASYNC_TRACE_SEVERE
Definition: MQTTAsync.h:1680
MQTTAsync_subscribeMany
int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char *const *topic, const int *qos, MQTTAsync_responseOptions *response)
MQTTAsync_connectOptions::willProperties
MQTTProperties * willProperties
Definition: MQTTAsync.h:1326
MQTTAsync_connectOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1332
MQTTAsync_message::payloadlen
int payloadlen
Definition: MQTTAsync.h:265
MQTTAsync_SSLOptions::sslVersion
int sslVersion
Definition: MQTTAsync.h:1090
MQTTAsync_successData5::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:614
MQTTAsync_connectData::username
const char * username
Definition: MQTTAsync.h:463
MQTTAsync_SSLOptions::keyStore
const char * keyStore
Definition: MQTTAsync.h:1063
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:1276
MQTTAsync_disconnectOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1438
MQTTAsync_connectData::len
int len
Definition: MQTTAsync.h:470
MQTTAsync_successData5::message
MQTTAsync_message message
Definition: MQTTAsync.h:607
MQTTAsync_connectOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1338
MQTTAsync_connectOptions::connectTimeout
int connectTimeout
Definition: MQTTAsync.h:1241
MQTTAsync_failureData5::token
MQTTAsync_token token
Definition: MQTTAsync.h:540
MQTTAsync_setTraceLevel
void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)
MQTTAsync_connectOptions::httpsProxy
const char * httpsProxy
Definition: MQTTAsync.h:1350
MQTTAsync_connectOptions::connectProperties
MQTTProperties * connectProperties
Definition: MQTTAsync.h:1322
MQTTAsync_connectOptions::maxRetryInterval
int maxRetryInterval
Definition: MQTTAsync.h:1307
MQTTAsync_successData
Definition: MQTTAsync.h:556
MQTTAsync_setBeforePersistenceWrite
int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void *context, MQTTPersistence_beforeWrite *co)
MQTTAsync_setConnectionLostCallback
int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl)
MQTTAsync_disconnectOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1406
MQTTASYNC_TRACE_FATAL
@ MQTTASYNC_TRACE_FATAL
Definition: MQTTAsync.h:1681
MQTTSubscribeOpts.h
MQTTAsync_onFailure
void MQTTAsync_onFailure(void *context, MQTTAsync_failureData *response)
Definition: MQTTAsync.h:672
MQTTAsync_responseOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:736
MQTTAsync_setUpdateConnectOptions
int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void *context, MQTTAsync_updateConnectOptions *co)
MQTTAsync_traceCallback
void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char *message)
Definition: MQTTAsync.h:1701
MQTTAsync_getPendingTokens
int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens)
MQTTAsync_updateConnectOptions
int MQTTAsync_updateConnectOptions(void *context, MQTTAsync_connectData *data)
Definition: MQTTAsync.h:483
MQTTAsync_connectOptions::retryInterval
int retryInterval
Definition: MQTTAsync.h:1249
MQTTAsync_disconnectOptions::context
void * context
Definition: MQTTAsync.h:1418
MQTTAsync_successData::message
MQTTAsync_message message
Definition: MQTTAsync.h:572
MQTTAsync_connectOptions::minRetryInterval
int minRetryInterval
Definition: MQTTAsync.h:1303
MQTTAsync_failureData5::struct_version
int struct_version
Definition: MQTTAsync.h:538
MQTTAsync_responseOptions
Definition: MQTTAsync.h:694
MQTTAsync_connectData
Definition: MQTTAsync.h:451
MQTTAsync_SSLOptions::ssl_psk_context
void * ssl_psk_context
Definition: MQTTAsync.h:1129
MQTTAsync_successData5::properties
MQTTProperties properties
Definition: MQTTAsync.h:594
MQTTASYNC_TRACE_MAXIMUM
@ MQTTASYNC_TRACE_MAXIMUM
Definition: MQTTAsync.h:1675
MQTTPersistence_beforeWrite
int MQTTPersistence_beforeWrite(void *context, int bufcount, char *buffers[], int buflens[])
Definition: MQTTClientPersistence.h:264
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:1004
MQTTAsync_connectionLost
void MQTTAsync_connectionLost(void *context, char *cause)
Definition: MQTTAsync.h:398
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:687
MQTTAsync_connectOptions::keepAliveInterval
int keepAliveInterval
Definition: MQTTAsync.h:1193
MQTTAsync_successData5::destinationName
char * destinationName
Definition: MQTTAsync.h:608
MQTTAsync_disconnectOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1432
MQTTAsync_SSLOptions::enabledCipherSuites
const char * enabledCipherSuites
Definition: MQTTAsync.h:1081
MQTTAsync_message::qos
int qos
Definition: MQTTAsync.h:281
MQTTReasonCodes.h
MQTTAsync_disconnectOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1395
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:430
MQTTAsync_messageArrived
int MQTTAsync_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
Definition: MQTTAsync.h:355
MQTTAsync_willOptions
Definition: MQTTAsync.h:995
MQTTAsync_message::payload
void * payload
Definition: MQTTAsync.h:267
MQTTASYNC_TRACE_MINIMUM
@ MQTTASYNC_TRACE_MINIMUM
Definition: MQTTAsync.h:1677
MQTTAsync_responseOptions::token
MQTTAsync_token token
Definition: MQTTAsync.h:724
MQTTAsync_reconnect
int MQTTAsync_reconnect(MQTTAsync handle)
MQTTAsync_connectOptions::data
const void * data
Definition: MQTTAsync.h:1313
MQTTAsync_connectData::data
const void * data
Definition: MQTTAsync.h:471
MQTTASYNC_TRACE_LEVELS
MQTTASYNC_TRACE_LEVELS
Definition: MQTTAsync.h:1673
MQTTAsync_willOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1002
MQTTAsync_nameValue::name
const char * name
Definition: MQTTAsync.h:1159
MQTTAsync_setDeliveryCompleteCallback
int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void *context, MQTTAsync_deliveryComplete *dc)
MQTTAsync_successData::destinationName
char * destinationName
Definition: MQTTAsync.h:573
MQTTAsync_connect
int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions *options)
MQTTAsync_createOptions::sendWhileDisconnected
int sendWhileDisconnected
Definition: MQTTAsync.h:948
MQTTAsync_message
Definition: MQTTAsync.h:257
MQTTAsync_responseOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:712
MQTTAsync_connectOptions::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:1295
MQTTAsync_SSLOptions::protos
const unsigned char * protos
Definition: MQTTAsync.h:1145
MQTTAsync_connectData::struct_version
int struct_version
Definition: MQTTAsync.h:456
MQTTAsync_connectOptions::username
const char * username
Definition: MQTTAsync.h:1231
MQTTAsync_free
void MQTTAsync_free(void *ptr)
MQTTAsync_connectOptions
Definition: MQTTAsync.h:1168
MQTTAsync_responseOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:730
MQTTAsync_failureData5::properties
MQTTProperties properties
Definition: MQTTAsync.h:544
MQTTASYNC_TRACE_PROTOCOL
@ MQTTASYNC_TRACE_PROTOCOL
Definition: MQTTAsync.h:1678
MQTTAsync_strerror
const char * MQTTAsync_strerror(int code)
MQTTAsync_SSLOptions::verify
int verify
Definition: MQTTAsync.h:1097
MQTTAsync_successData5::serverURI
char * serverURI
Definition: MQTTAsync.h:613
MQTTAsync_nameValue
Definition: MQTTAsync.h:1157
MQTTAsync_SSLOptions::privateKeyPassword
const char * privateKeyPassword
Definition: MQTTAsync.h:1071
MQTTAsync_failureData
Definition: MQTTAsync.h:521
MQTTSubscribe_options
Definition: MQTTSubscribeOpts.h:21
MQTTAsync_SSLOptions::disableDefaultTrustStore
int disableDefaultTrustStore
Definition: MQTTAsync.h:1136
MQTTAsync_willOptions::data
const void * data
Definition: MQTTAsync.h:1020
MQTTAsync_connectOptions::maxInflight
int maxInflight
Definition: MQTTAsync.h:1219
MQTTAsync_responseOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:706
MQTTAsync_connectOptions::ssl
MQTTAsync_SSLOptions * ssl
Definition: MQTTAsync.h:1254
MQTTAsync_responseOptions
struct MQTTAsync_responseOptions MQTTAsync_responseOptions
MQTTAsync_createOptions::persistQoS0
int persistQoS0
Definition: MQTTAsync.h:972
MQTTAsync_willOptions::retained
int retained
Definition: MQTTAsync.h:1010
MQTTAsync_createOptions::maxBufferedMessages
int maxBufferedMessages
Definition: MQTTAsync.h:950
MQTTAsync_createOptions::deleteOldestMessages
int deleteOldestMessages
Definition: MQTTAsync.h:964
MQTTAsync_successData5::reasonCodes
enum MQTTReasonCodes * reasonCodes
Definition: MQTTAsync.h:602
MQTTAsync_connectOptions::password
const char * password
Definition: MQTTAsync.h:1237
MQTTAsync_failureData::code
int code
Definition: MQTTAsync.h:526
MQTTAsync_responseOptions::subscribeOptions
MQTTSubscribe_options subscribeOptions
Definition: MQTTAsync.h:744
MQTTAsync_willOptions::message
const char * message
Definition: MQTTAsync.h:1006
MQTTAsync_disconnectOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1412
MQTTAsync_nameValue::value
const char * value
Definition: MQTTAsync.h:1160
MQTTAsync_setConnected
int MQTTAsync_setConnected(MQTTAsync handle, void *context, MQTTAsync_connected *co)
MQTTAsync_failureData5::message
const char * message
Definition: MQTTAsync.h:548
MQTTAsync_disconnectOptions
Definition: MQTTAsync.h:1390
MQTTAsync_responseOptions::subscribeOptionsList
MQTTSubscribe_options * subscribeOptionsList
Definition: MQTTAsync.h:753
MQTTPersistence_afterRead
int MQTTPersistence_afterRead(void *context, char **buffer, int *buflen)
Definition: MQTTClientPersistence.h:275
MQTTAsync_responseOptions::subscribeOptionsCount
int subscribeOptionsCount
Definition: MQTTAsync.h:749
MQTTAsync_connectOptions::len
int len
Definition: MQTTAsync.h:1312
MQTTASYNC_TRACE_ERROR
@ MQTTASYNC_TRACE_ERROR
Definition: MQTTAsync.h:1679
MQTTAsync_init_options::struct_version
int struct_version
Definition: MQTTAsync.h:222
MQTTAsync_connected
void MQTTAsync_connected(void *context, char *cause)
Definition: MQTTAsync.h:416
MQTTAsync_SSLOptions::enableServerCertAuth
int enableServerCertAuth
Definition: MQTTAsync.h:1084
MQTTAsync_setAfterPersistenceRead
int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void *context, MQTTPersistence_afterRead *co)
MQTTAsync_onSuccess5
void MQTTAsync_onSuccess5(void *context, MQTTAsync_successData5 *response)
Definition: MQTTAsync.h:657
MQTTClientPersistence.h
This structure represents a persistent data store, used to store outbound and inbound messages,...
MQTTAsync_successData5::reasonCodeCount
int reasonCodeCount
Definition: MQTTAsync.h:601
MQTTAsync_successData::qos
int qos
Definition: MQTTAsync.h:565
MQTTAsync_disconnectOptions::timeout
int timeout
Definition: MQTTAsync.h:1400
MQTTAsync_message::dup
int dup
Definition: MQTTAsync.h:307
MQTTAsync_message::properties
MQTTProperties properties
Definition: MQTTAsync.h:317
MQTTAsync_message::struct_version
int struct_version
Definition: MQTTAsync.h:263
MQTTAsync_willOptions::len
int len
Definition: MQTTAsync.h:1019
MQTTAsync_SSLOptions::ssl_error_context
void * ssl_error_context
Definition: MQTTAsync.h:1116
MQTTAsync_responseOptions::struct_version
int struct_version
Definition: MQTTAsync.h:700
MQTTAsync_willOptions::qos
int qos
Definition: MQTTAsync.h:1015
MQTTAsync_successData::token
MQTTAsync_token token
Definition: MQTTAsync.h:559
MQTTAsync_connectOptions::cleansession
int cleansession
Definition: MQTTAsync.h:1215
MQTTAsync_createOptions::restoreMessages
int restoreMessages
Definition: MQTTAsync.h:968
MQTTASYNC_TRACE_MEDIUM
@ MQTTASYNC_TRACE_MEDIUM
Definition: MQTTAsync.h:1676
MQTTAsync_freeMessage
void MQTTAsync_freeMessage(MQTTAsync_message **msg)
MQTTReasonCodes
MQTTReasonCodes
Definition: MQTTReasonCodes.h:23
MQTTAsync_connectOptions::context
void * context
Definition: MQTTAsync.h:1272
MQTTAsync_onSuccess
void MQTTAsync_onSuccess(void *context, MQTTAsync_successData *response)
Definition: MQTTAsync.h:641
MQTTAsync_connectOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1266
MQTTAsync_createOptions
Definition: MQTTAsync.h:937
MQTTAsync_connectOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1260