Paho Asynchronous MQTT C Client Library
MQTTAsync.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2009, 2022 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 
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  * Return code: connect or disconnect command ignored because there is already a connect or disconnect
192  * command at the head of the list waiting to be processed. Use the onSuccess/onFailure callbacks to wait
193  * for the previous connect or disconnect command to be complete.
194  */
195 #define MQTTASYNC_COMMAND_IGNORED -18
196  /*
197  * Return code: maxBufferedMessages in the connect options must be >= 0
198  */
199  #define MQTTASYNC_MAX_BUFFERED -19
200 
204 #define MQTTVERSION_DEFAULT 0
205 
208 #define MQTTVERSION_3_1 3
209 
212 #define MQTTVERSION_3_1_1 4
213 
216 #define MQTTVERSION_5 5
217 
220 #define MQTT_BAD_SUBSCRIBE 0x80
221 
222 
226 typedef struct
227 {
229  char struct_id[4];
235 
236 #define MQTTAsync_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 }
237 
242 LIBMQTT_API void MQTTAsync_global_init(MQTTAsync_init_options* inits);
243 
248 typedef void* MQTTAsync;
258 typedef int MQTTAsync_token;
259 
266 typedef struct
267 {
269  char struct_id[4];
276  void* payload;
290  int qos;
309  int retained;
316  int dup;
322  int msgid;
328 
329 #define MQTTAsync_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer }
330 
364 typedef int MQTTAsync_messageArrived(void* context, char* topicName, int topicLen, MQTTAsync_message* message);
365 
387 typedef void MQTTAsync_deliveryComplete(void* context, MQTTAsync_token token);
388 
407 typedef void MQTTAsync_connectionLost(void* context, char* cause);
408 
409 
425 typedef void MQTTAsync_connected(void* context, char* cause);
426 
439 typedef void MQTTAsync_disconnected(void* context, MQTTProperties* properties,
440  enum MQTTReasonCodes reasonCode);
441 
457 LIBMQTT_API int MQTTAsync_setDisconnected(MQTTAsync handle, void* context, MQTTAsync_disconnected* co);
458 
460 typedef struct
461 {
463  char struct_id[4];
472  const char* username;
478  struct {
479  int len;
480  const void* data;
481  } binarypwd;
483 
484 #define MQTTAsync_connectData_initializer {{'M', 'Q', 'C', 'D'}, 0, NULL, {0, NULL}}
485 
492 typedef int MQTTAsync_updateConnectOptions(void* context, MQTTAsync_connectData* data);
493 
503 LIBMQTT_API int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void* context, MQTTAsync_updateConnectOptions* co);
504 
514 LIBMQTT_API int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void* context, MQTTPersistence_beforeWrite* co);
515 
516 
526 LIBMQTT_API int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void* context, MQTTPersistence_afterRead* co);
527 
528 
530 typedef struct
531 {
535  int code;
537  const char *message;
539 
540 
542 typedef struct
543 {
545  char struct_id[4];
551  enum MQTTReasonCodes reasonCode;
555  int code;
557  const char *message;
561 
562 #define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, 0, NULL, 0}
563 
565 typedef struct
566 {
570  union
571  {
574  int qos;
577  int* qosList;
579  struct
580  {
583  } pub;
584  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
585  struct
586  {
587  char* serverURI;
590  } connect;
591  } alt;
593 
594 
596 typedef struct
597 {
598  char struct_id[4];
602  enum MQTTReasonCodes reasonCode;
605  union
606  {
608  struct
609  {
612  } sub;
614  struct
615  {
618  } pub;
619  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
620  struct
621  {
622  char* serverURI;
625  } connect;
627  struct
628  {
629  int reasonCodeCount;
630  enum MQTTReasonCodes* reasonCodes;
631  } unsub;
632  } alt;
634 
635 #define MQTTAsync_successData5_initializer {{'M', 'Q', 'S', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, {.sub={0,0}}}
636 
650 typedef void MQTTAsync_onSuccess(void* context, MQTTAsync_successData* response);
651 
666 typedef void MQTTAsync_onSuccess5(void* context, MQTTAsync_successData5* response);
667 
681 typedef void MQTTAsync_onFailure(void* context, MQTTAsync_failureData* response);
682 
696 typedef void MQTTAsync_onFailure5(void* context, MQTTAsync_failureData5* response);
697 
704 {
706  char struct_id[4];
727  void* context;
750  /*
751  * MQTT V5 subscribe options, when used with subscribe only.
752  */
754  /*
755  * MQTT V5 subscribe option count, when used with subscribeMany only.
756  * The number of entries in the subscribe_options_list array.
757  */
759  /*
760  * MQTT V5 subscribe option array, when used with subscribeMany only.
761  */
764 
765 #define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 1, NULL, NULL, 0, 0, NULL, NULL, MQTTProperties_initializer, MQTTSubscribe_options_initializer, 0, NULL}
766 
769 #define MQTTAsync_callOptions_initializer MQTTAsync_responseOptions_initializer
770 
800 LIBMQTT_API int MQTTAsync_setCallbacks(MQTTAsync handle, void* context, MQTTAsync_connectionLost* cl,
802 
823 LIBMQTT_API int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void* context,
825 
847 LIBMQTT_API int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void* context,
849 
869 LIBMQTT_API int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void* context,
871 
884 LIBMQTT_API int MQTTAsync_setConnected(MQTTAsync handle, void* context, MQTTAsync_connected* co);
885 
886 
895 LIBMQTT_API int MQTTAsync_reconnect(MQTTAsync handle);
896 
897 
942 LIBMQTT_API int MQTTAsync_create(MQTTAsync* handle, const char* serverURI, const char* clientId,
943  int persistence_type, void* persistence_context);
944 
946 typedef struct
947 {
949  char struct_id[4];
972  /*
973  * When the maximum number of buffered messages is reached, delete the oldest rather than the newest.
974  */
976  /*
977  * Restore messages from persistence on create - or clear it.
978  */
980  /*
981  * Persist QoS0 publish commands - an option to not persist them.
982  */
985 
986 #define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_DEFAULT, 0, 0, 1, 1}
987 
988 #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_5, 0, 0, 1, 1}
989 
990 
991 LIBMQTT_API int MQTTAsync_createWithOptions(MQTTAsync* handle, const char* serverURI, const char* clientId,
992  int persistence_type, void* persistence_context, MQTTAsync_createOptions* options);
993 
1006 typedef struct
1007 {
1009  char struct_id[4];
1015  const char* topicName;
1017  const char* message;
1026  int qos;
1028  struct
1029  {
1030  int len;
1031  const void* data;
1032  } payload;
1034 
1035 #define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } }
1036 
1037 #define MQTT_SSL_VERSION_DEFAULT 0
1038 #define MQTT_SSL_VERSION_TLS_1_0 1
1039 #define MQTT_SSL_VERSION_TLS_1_1 2
1040 #define MQTT_SSL_VERSION_TLS_1_2 3
1041 
1054 typedef struct
1055 {
1057  char struct_id[4];
1058 
1067 
1069  const char* trustStore;
1070 
1074  const char* keyStore;
1075 
1079  const char* privateKey;
1080 
1082  const char* privateKeyPassword;
1083 
1092  const char* enabledCipherSuites;
1093 
1096 
1102 
1108  int verify;
1109 
1115  const char* CApath;
1116 
1121  int (*ssl_error_cb) (const char *str, size_t len, void *u);
1122 
1128 
1134  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);
1135 
1141 
1148 
1156  const unsigned char *protos;
1157 
1162  unsigned int protos_len;
1164 
1165 #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 }
1166 
1168 typedef struct
1169 {
1170  const char* name;
1171  const char* value;
1173 
1179 typedef struct
1180 {
1182  char struct_id[4];
1242  const char* username;
1248  const char* password;
1283  void* context;
1299  char* const* serverURIs;
1322  struct {
1323  int len;
1324  const void* data;
1325  } binarypwd;
1326  /*
1327  * MQTT V5 clean start flag. Only clears state at the beginning of the session.
1328  */
1357  const char* httpProxy;
1361  const char* httpsProxy;
1363 
1364 
1365 #define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 8, 60, 1, 65535, NULL, NULL, NULL, 30, 0,\
1366 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1367 
1368 #define MQTTAsync_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 8, 60, 0, 65535, NULL, NULL, NULL, 30, 0,\
1369 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1370 
1371 #define MQTTAsync_connectOptions_initializer_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 1, 65535, NULL, NULL, NULL, 30, 0,\
1372 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1373 
1374 #define MQTTAsync_connectOptions_initializer5_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 0, 65535, NULL, NULL, NULL, 30, 0,\
1375 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1376 
1377 
1398 LIBMQTT_API int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options);
1399 
1401 typedef struct
1402 {
1404  char struct_id[4];
1411  int timeout;
1429  void* context;
1437  enum MQTTReasonCodes reasonCode;
1451 
1452 #define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 0, 0, NULL, NULL, NULL,\
1453  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1454 
1455 #define MQTTAsync_disconnectOptions_initializer5 { {'M', 'Q', 'T', 'D'}, 1, 0, NULL, NULL, NULL,\
1456  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1457 
1476 LIBMQTT_API int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions* options);
1477 
1478 
1486 LIBMQTT_API int MQTTAsync_isConnected(MQTTAsync handle);
1487 
1488 
1503 LIBMQTT_API int MQTTAsync_subscribe(MQTTAsync handle, const char* topic, int qos, MQTTAsync_responseOptions* response);
1504 
1505 
1523 LIBMQTT_API int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char* const* topic, const int* qos, MQTTAsync_responseOptions* response);
1524 
1537 LIBMQTT_API int MQTTAsync_unsubscribe(MQTTAsync handle, const char* topic, MQTTAsync_responseOptions* response);
1538 
1551 LIBMQTT_API int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const* topic, MQTTAsync_responseOptions* response);
1552 
1553 
1573 LIBMQTT_API int MQTTAsync_send(MQTTAsync handle, const char* destinationName, int payloadlen, const void* payload, int qos,
1574  int retained, MQTTAsync_responseOptions* response);
1575 
1592 LIBMQTT_API int MQTTAsync_sendMessage(MQTTAsync handle, const char* destinationName, const MQTTAsync_message* msg, MQTTAsync_responseOptions* response);
1593 
1594 
1613 LIBMQTT_API int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens);
1614 
1623 #define MQTTASYNC_TRUE 1
1624 LIBMQTT_API int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token);
1625 
1626 
1639 LIBMQTT_API int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout);
1640 
1641 
1652 LIBMQTT_API void MQTTAsync_freeMessage(MQTTAsync_message** msg);
1653 
1662 LIBMQTT_API void MQTTAsync_free(void* ptr);
1663 
1671 LIBMQTT_API void* MQTTAsync_malloc(size_t size);
1672 
1680 LIBMQTT_API void MQTTAsync_destroy(MQTTAsync* handle);
1681 
1682 
1683 
1685 {
1693 };
1694 
1695 
1701 LIBMQTT_API void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level);
1702 
1703 
1713 typedef void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char* message);
1714 
1721 LIBMQTT_API void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback* callback);
1722 
1730 
1737 LIBMQTT_API const char* MQTTAsync_strerror(int code);
1738 
1739 
2353 #if defined(__cplusplus)
2354  }
2355 #endif
2356 
2357 #endif
MQTTAsync_isConnected
int MQTTAsync_isConnected(MQTTAsync handle)
MQTTAsync_SSLOptions::protos_len
unsigned int protos_len
Definition: MQTTAsync.h:1162
MQTTAsync_waitForCompletion
int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout)
MQTTAsync_successData::qosList
int * qosList
Definition: MQTTAsync.h:577
MQTTAsync_connectOptions::httpHeaders
const MQTTAsync_nameValue * httpHeaders
Definition: MQTTAsync.h:1353
MQTTAsync_responseOptions::context
void * context
Definition: MQTTAsync.h:727
MQTTProperties.h
MQTTAsync_successData5::sessionPresent
int sessionPresent
Definition: MQTTAsync.h:624
MQTTAsync_token
int MQTTAsync_token
Definition: MQTTAsync.h:258
MQTTAsync_successData::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:588
MQTTAsync_createOptions::allowDisconnectedSendAtAnyTime
int allowDisconnectedSendAtAnyTime
Definition: MQTTAsync.h:971
MQTTAsync_createOptions::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:967
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:955
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:248
MQTTAsync_connectOptions::httpProxy
const char * httpProxy
Definition: MQTTAsync.h:1357
MQTTAsync_connectOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1193
MQTTAsync_successData::serverURI
char * serverURI
Definition: MQTTAsync.h:587
MQTTAsync_successData::sessionPresent
int sessionPresent
Definition: MQTTAsync.h:589
MQTTAsync_init_options::do_openssl_init
int do_openssl_init
Definition: MQTTAsync.h:233
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:596
MQTTAsync_deliveryComplete
void MQTTAsync_deliveryComplete(void *context, MQTTAsync_token token)
Definition: MQTTAsync.h:387
MQTTAsync_isComplete
int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token)
MQTTAsync_connectOptions::cleanstart
int cleanstart
Definition: MQTTAsync.h:1329
MQTTAsync_successData5::token
MQTTAsync_token token
Definition: MQTTAsync.h:601
MQTTAsync_message::retained
int retained
Definition: MQTTAsync.h:309
MQTTAsync_failureData5
Definition: MQTTAsync.h:542
MQTTAsync_failureData::message
const char * message
Definition: MQTTAsync.h:537
MQTTAsync_SSLOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1066
MQTTProperties
Definition: MQTTProperties.h:112
MQTTAsync_SSLOptions::trustStore
const char * trustStore
Definition: MQTTAsync.h:1069
MQTTAsync_responseOptions::properties
MQTTProperties properties
Definition: MQTTAsync.h:749
MQTTAsync_connectOptions::automaticReconnect
int automaticReconnect
Definition: MQTTAsync.h:1310
MQTTAsync_SSLOptions::privateKey
const char * privateKey
Definition: MQTTAsync.h:1079
MQTTAsync_successData5::struct_version
int struct_version
Definition: MQTTAsync.h:599
MQTTAsync_message::msgid
int msgid
Definition: MQTTAsync.h:322
MQTTAsync_failureData5::code
int code
Definition: MQTTAsync.h:555
MQTTAsync_connectOptions::serverURIs
char *const * serverURIs
Definition: MQTTAsync.h:1299
MQTTAsync_responseOptions::struct_id
char struct_id[4]
Definition: MQTTAsync.h:706
MQTTAsync_failureData5::packet_type
int packet_type
Definition: MQTTAsync.h:559
MQTTAsync_disconnectOptions::properties
MQTTProperties properties
Definition: MQTTAsync.h:1433
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:1236
MQTTAsync_SSLOptions::CApath
const char * CApath
Definition: MQTTAsync.h:1115
MQTTAsync_failureData::token
MQTTAsync_token token
Definition: MQTTAsync.h:533
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:1054
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:1691
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:1337
MQTTAsync_connectOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1343
MQTTAsync_message::payloadlen
int payloadlen
Definition: MQTTAsync.h:274
MQTTAsync_SSLOptions::sslVersion
int sslVersion
Definition: MQTTAsync.h:1101
MQTTAsync_successData5::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:623
MQTTAsync_connectData::username
const char * username
Definition: MQTTAsync.h:472
MQTTAsync_SSLOptions::keyStore
const char * keyStore
Definition: MQTTAsync.h:1074
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:1287
MQTTAsync_disconnectOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1449
MQTTAsync_connectData::len
int len
Definition: MQTTAsync.h:479
MQTTAsync_successData5::message
MQTTAsync_message message
Definition: MQTTAsync.h:616
MQTTAsync_connectOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1349
MQTTAsync_connectOptions::connectTimeout
int connectTimeout
Definition: MQTTAsync.h:1252
MQTTAsync_failureData5::token
MQTTAsync_token token
Definition: MQTTAsync.h:549
MQTTAsync_setTraceLevel
void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)
MQTTAsync_connectOptions::httpsProxy
const char * httpsProxy
Definition: MQTTAsync.h:1361
MQTTAsync_connectOptions::connectProperties
MQTTProperties * connectProperties
Definition: MQTTAsync.h:1333
MQTTAsync_connectOptions::maxRetryInterval
int maxRetryInterval
Definition: MQTTAsync.h:1318
MQTTAsync_successData
Definition: MQTTAsync.h:565
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:1417
MQTTASYNC_TRACE_FATAL
@ MQTTASYNC_TRACE_FATAL
Definition: MQTTAsync.h:1692
MQTTSubscribeOpts.h
MQTTAsync_onFailure
void MQTTAsync_onFailure(void *context, MQTTAsync_failureData *response)
Definition: MQTTAsync.h:681
MQTTAsync_responseOptions::onFailure5
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:745
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:1713
MQTTAsync_getPendingTokens
int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens)
MQTTAsync_updateConnectOptions
int MQTTAsync_updateConnectOptions(void *context, MQTTAsync_connectData *data)
Definition: MQTTAsync.h:492
MQTTAsync_connectOptions::retryInterval
int retryInterval
Definition: MQTTAsync.h:1260
MQTTAsync_disconnectOptions::context
void * context
Definition: MQTTAsync.h:1429
MQTTAsync_successData::message
MQTTAsync_message message
Definition: MQTTAsync.h:581
MQTTAsync_connectOptions::minRetryInterval
int minRetryInterval
Definition: MQTTAsync.h:1314
MQTTAsync_failureData5::struct_version
int struct_version
Definition: MQTTAsync.h:547
MQTTAsync_responseOptions
Definition: MQTTAsync.h:703
MQTTAsync_connectData
Definition: MQTTAsync.h:460
MQTTAsync_SSLOptions::ssl_psk_context
void * ssl_psk_context
Definition: MQTTAsync.h:1140
MQTTAsync_successData5::properties
MQTTProperties properties
Definition: MQTTAsync.h:603
MQTTASYNC_TRACE_MAXIMUM
@ MQTTASYNC_TRACE_MAXIMUM
Definition: MQTTAsync.h:1686
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:1015
MQTTAsync_connectionLost
void MQTTAsync_connectionLost(void *context, char *cause)
Definition: MQTTAsync.h:407
MQTTAsync_global_init
void MQTTAsync_global_init(MQTTAsync_init_options *inits)
MQTTAsync_init_options
Definition: MQTTAsync.h:226
MQTTAsync_onFailure5
void MQTTAsync_onFailure5(void *context, MQTTAsync_failureData5 *response)
Definition: MQTTAsync.h:696
MQTTAsync_connectOptions::keepAliveInterval
int keepAliveInterval
Definition: MQTTAsync.h:1204
MQTTAsync_successData5::destinationName
char * destinationName
Definition: MQTTAsync.h:617
MQTTAsync_disconnectOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1443
MQTTAsync_SSLOptions::enabledCipherSuites
const char * enabledCipherSuites
Definition: MQTTAsync.h:1092
MQTTAsync_message::qos
int qos
Definition: MQTTAsync.h:290
MQTTReasonCodes.h
MQTTAsync_disconnectOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1406
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:439
MQTTAsync_messageArrived
int MQTTAsync_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
Definition: MQTTAsync.h:364
MQTTAsync_willOptions
Definition: MQTTAsync.h:1006
MQTTAsync_message::payload
void * payload
Definition: MQTTAsync.h:276
MQTTASYNC_TRACE_MINIMUM
@ MQTTASYNC_TRACE_MINIMUM
Definition: MQTTAsync.h:1688
MQTTAsync_responseOptions::token
MQTTAsync_token token
Definition: MQTTAsync.h:733
MQTTAsync_reconnect
int MQTTAsync_reconnect(MQTTAsync handle)
MQTTAsync_connectOptions::data
const void * data
Definition: MQTTAsync.h:1324
MQTTAsync_connectData::data
const void * data
Definition: MQTTAsync.h:480
MQTTASYNC_TRACE_LEVELS
MQTTASYNC_TRACE_LEVELS
Definition: MQTTAsync.h:1684
MQTTAsync_willOptions::struct_version
int struct_version
Definition: MQTTAsync.h:1013
MQTTAsync_nameValue::name
const char * name
Definition: MQTTAsync.h:1170
MQTTAsync_setDeliveryCompleteCallback
int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void *context, MQTTAsync_deliveryComplete *dc)
MQTTAsync_successData::destinationName
char * destinationName
Definition: MQTTAsync.h:582
MQTTAsync_connect
int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions *options)
MQTTAsync_createOptions::sendWhileDisconnected
int sendWhileDisconnected
Definition: MQTTAsync.h:957
MQTTAsync_message
Definition: MQTTAsync.h:266
MQTTAsync_responseOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:721
MQTTAsync_connectOptions::MQTTVersion
int MQTTVersion
Definition: MQTTAsync.h:1306
MQTTAsync_SSLOptions::protos
const unsigned char * protos
Definition: MQTTAsync.h:1156
MQTTAsync_connectData::struct_version
int struct_version
Definition: MQTTAsync.h:465
MQTTAsync_connectOptions::username
const char * username
Definition: MQTTAsync.h:1242
MQTTAsync_free
void MQTTAsync_free(void *ptr)
MQTTAsync_connectOptions
Definition: MQTTAsync.h:1179
MQTTAsync_responseOptions::onSuccess5
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:739
MQTTAsync_failureData5::properties
MQTTProperties properties
Definition: MQTTAsync.h:553
MQTTASYNC_TRACE_PROTOCOL
@ MQTTASYNC_TRACE_PROTOCOL
Definition: MQTTAsync.h:1689
MQTTAsync_strerror
const char * MQTTAsync_strerror(int code)
MQTTAsync_SSLOptions::verify
int verify
Definition: MQTTAsync.h:1108
MQTTAsync_successData5::serverURI
char * serverURI
Definition: MQTTAsync.h:622
MQTTAsync_nameValue
Definition: MQTTAsync.h:1168
MQTTAsync_SSLOptions::privateKeyPassword
const char * privateKeyPassword
Definition: MQTTAsync.h:1082
MQTTAsync_failureData
Definition: MQTTAsync.h:530
MQTTSubscribe_options
Definition: MQTTSubscribeOpts.h:21
MQTTAsync_SSLOptions::disableDefaultTrustStore
int disableDefaultTrustStore
Definition: MQTTAsync.h:1147
MQTTAsync_willOptions::data
const void * data
Definition: MQTTAsync.h:1031
MQTTAsync_connectOptions::maxInflight
int maxInflight
Definition: MQTTAsync.h:1230
MQTTAsync_responseOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:715
MQTTAsync_connectOptions::ssl
MQTTAsync_SSLOptions * ssl
Definition: MQTTAsync.h:1265
MQTTAsync_responseOptions
struct MQTTAsync_responseOptions MQTTAsync_responseOptions
MQTTAsync_createOptions::persistQoS0
int persistQoS0
Definition: MQTTAsync.h:983
MQTTAsync_willOptions::retained
int retained
Definition: MQTTAsync.h:1021
MQTTAsync_createOptions::maxBufferedMessages
int maxBufferedMessages
Definition: MQTTAsync.h:961
MQTTAsync_createOptions::deleteOldestMessages
int deleteOldestMessages
Definition: MQTTAsync.h:975
MQTTAsync_successData5::reasonCodes
enum MQTTReasonCodes * reasonCodes
Definition: MQTTAsync.h:611
MQTTAsync_connectOptions::password
const char * password
Definition: MQTTAsync.h:1248
MQTTAsync_failureData::code
int code
Definition: MQTTAsync.h:535
MQTTAsync_responseOptions::subscribeOptions
MQTTSubscribe_options subscribeOptions
Definition: MQTTAsync.h:753
MQTTAsync_willOptions::message
const char * message
Definition: MQTTAsync.h:1017
MQTTAsync_disconnectOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1423
MQTTAsync_nameValue::value
const char * value
Definition: MQTTAsync.h:1171
MQTTAsync_setConnected
int MQTTAsync_setConnected(MQTTAsync handle, void *context, MQTTAsync_connected *co)
MQTTAsync_failureData5::message
const char * message
Definition: MQTTAsync.h:557
MQTTAsync_disconnectOptions
Definition: MQTTAsync.h:1401
MQTTAsync_responseOptions::subscribeOptionsList
MQTTSubscribe_options * subscribeOptionsList
Definition: MQTTAsync.h:762
MQTTPersistence_afterRead
int MQTTPersistence_afterRead(void *context, char **buffer, int *buflen)
Definition: MQTTClientPersistence.h:275
MQTTAsync_responseOptions::subscribeOptionsCount
int subscribeOptionsCount
Definition: MQTTAsync.h:758
MQTTAsync_connectOptions::len
int len
Definition: MQTTAsync.h:1323
MQTTASYNC_TRACE_ERROR
@ MQTTASYNC_TRACE_ERROR
Definition: MQTTAsync.h:1690
MQTTAsync_init_options::struct_version
int struct_version
Definition: MQTTAsync.h:231
MQTTAsync_connected
void MQTTAsync_connected(void *context, char *cause)
Definition: MQTTAsync.h:425
MQTTAsync_SSLOptions::enableServerCertAuth
int enableServerCertAuth
Definition: MQTTAsync.h:1095
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:666
MQTTClientPersistence.h
This structure represents a persistent data store, used to store outbound and inbound messages,...
MQTTAsync_successData5::reasonCodeCount
int reasonCodeCount
Definition: MQTTAsync.h:610
MQTTAsync_successData::qos
int qos
Definition: MQTTAsync.h:574
MQTTAsync_disconnectOptions::timeout
int timeout
Definition: MQTTAsync.h:1411
MQTTAsync_message::dup
int dup
Definition: MQTTAsync.h:316
MQTTAsync_message::properties
MQTTProperties properties
Definition: MQTTAsync.h:326
MQTTAsync_message::struct_version
int struct_version
Definition: MQTTAsync.h:272
MQTTAsync_willOptions::len
int len
Definition: MQTTAsync.h:1030
MQTTAsync_SSLOptions::ssl_error_context
void * ssl_error_context
Definition: MQTTAsync.h:1127
MQTTAsync_responseOptions::struct_version
int struct_version
Definition: MQTTAsync.h:709
MQTTAsync_willOptions::qos
int qos
Definition: MQTTAsync.h:1026
MQTTAsync_successData::token
MQTTAsync_token token
Definition: MQTTAsync.h:568
MQTTAsync_connectOptions::cleansession
int cleansession
Definition: MQTTAsync.h:1226
MQTTAsync_createOptions::restoreMessages
int restoreMessages
Definition: MQTTAsync.h:979
MQTTASYNC_TRACE_MEDIUM
@ MQTTASYNC_TRACE_MEDIUM
Definition: MQTTAsync.h:1687
MQTTAsync_freeMessage
void MQTTAsync_freeMessage(MQTTAsync_message **msg)
MQTTReasonCodes
MQTTReasonCodes
Definition: MQTTReasonCodes.h:23
MQTTAsync_connectOptions::context
void * context
Definition: MQTTAsync.h:1283
MQTTAsync_onSuccess
void MQTTAsync_onSuccess(void *context, MQTTAsync_successData *response)
Definition: MQTTAsync.h:650
MQTTAsync_connectOptions::onFailure
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1277
MQTTAsync_createOptions
Definition: MQTTAsync.h:946
MQTTAsync_connectOptions::onSuccess
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1271