天嵌二次封装库使用手册  V2.1.2
MQTTAsync.h
浏览该文件的文档.
1 /*******************************************************************************
2  * Copyright (c) 2009, 2021 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 
199 #define MQTTVERSION_DEFAULT 0
200 
203 #define MQTTVERSION_3_1 3
204 
207 #define MQTTVERSION_3_1_1 4
208 
211 #define MQTTVERSION_5 5
212 
215 #define MQTT_BAD_SUBSCRIBE 0x80
216 
217 
221 typedef struct
222 {
224  char struct_id[4];
230 
231 #define MQTTAsync_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 }
232 
238 
243 typedef void* MQTTAsync;
253 typedef int MQTTAsync_token;
254 
261 typedef struct
262 {
264  char struct_id[4];
271  void* payload;
285  int qos;
304  int retained;
311  int dup;
317  int msgid;
323 
324 #define MQTTAsync_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer }
325 
359 typedef int MQTTAsync_messageArrived(void* context, char* topicName, int topicLen, MQTTAsync_message* message);
360 
382 typedef void MQTTAsync_deliveryComplete(void* context, MQTTAsync_token token);
383 
402 typedef void MQTTAsync_connectionLost(void* context, char* cause);
403 
404 
420 typedef void MQTTAsync_connected(void* context, char* cause);
421 
434 typedef void MQTTAsync_disconnected(void* context, MQTTProperties* properties,
435  enum MQTTReasonCodes reasonCode);
436 
452 LIBMQTT_API int MQTTAsync_setDisconnected(MQTTAsync handle, void* context, MQTTAsync_disconnected* co);
453 
455 typedef struct
456 {
458  char struct_id[4];
467  const char* username;
473  struct {
474  int len;
475  const void* data;
476  } binarypwd;
478 
479 #define MQTTAsync_connectData_initializer {{'M', 'Q', 'C', 'D'}, 0, NULL, {0, NULL}}
480 
487 typedef int MQTTAsync_updateConnectOptions(void* context, MQTTAsync_connectData* data);
488 
498 LIBMQTT_API int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void* context, MQTTAsync_updateConnectOptions* co);
499 
509 LIBMQTT_API int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void* context, MQTTPersistence_beforeWrite* co);
510 
511 
521 LIBMQTT_API int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void* context, MQTTPersistence_afterRead* co);
522 
523 
525 typedef struct
526 {
528  MQTTAsync_token token;
530  int code;
532  const char *message;
534 
535 
537 typedef struct
538 {
540  char struct_id[4];
544  MQTTAsync_token token;
546  enum MQTTReasonCodes reasonCode;
550  int code;
552  const char *message;
556 
557 #define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, 0, NULL, 0}
558 
560 typedef struct
561 {
563  MQTTAsync_token token;
565  union
566  {
569  int qos;
572  int* qosList;
574  struct
575  {
578  } pub;
579  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
580  struct
581  {
582  char* serverURI;
585  } connect;
586  } alt;
588 
589 
591 typedef struct
592 {
593  char struct_id[4];
596  MQTTAsync_token token;
597  enum MQTTReasonCodes reasonCode;
600  union
601  {
603  struct
604  {
607  } sub;
609  struct
610  {
613  } pub;
614  /* For connect, the server connected to, MQTT version used, and sessionPresent flag */
615  struct
616  {
617  char* serverURI;
620  } connect;
622  struct
623  {
624  int reasonCodeCount;
625  enum MQTTReasonCodes* reasonCodes;
626  } unsub;
627  } alt;
629 
630 #define MQTTAsync_successData5_initializer {{'M', 'Q', 'S', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, {.sub={0,0}}}
631 
645 typedef void MQTTAsync_onSuccess(void* context, MQTTAsync_successData* response);
646 
661 typedef void MQTTAsync_onSuccess5(void* context, MQTTAsync_successData5* response);
662 
676 typedef void MQTTAsync_onFailure(void* context, MQTTAsync_failureData* response);
677 
691 typedef void MQTTAsync_onFailure5(void* context, MQTTAsync_failureData5* response);
692 
699 {
701  char struct_id[4];
722  void* context;
728  MQTTAsync_token token;
745  /*
746  * MQTT V5 subscribe options, when used with subscribe only.
747  */
749  /*
750  * MQTT V5 subscribe option count, when used with subscribeMany only.
751  * The number of entries in the subscribe_options_list array.
752  */
754  /*
755  * MQTT V5 subscribe option array, when used with subscribeMany only.
756  */
759 
760 #define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 1, NULL, NULL, 0, 0, NULL, NULL, MQTTProperties_initializer, MQTTSubscribe_options_initializer, 0, NULL}
761 
764 #define MQTTAsync_callOptions_initializer MQTTAsync_responseOptions_initializer
765 
795 LIBMQTT_API int MQTTAsync_setCallbacks(MQTTAsync handle, void* context, MQTTAsync_connectionLost* cl,
797 
818 LIBMQTT_API int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void* context,
820 
842 LIBMQTT_API int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void* context,
844 
864 LIBMQTT_API int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void* context,
866 
879 LIBMQTT_API int MQTTAsync_setConnected(MQTTAsync handle, void* context, MQTTAsync_connected* co);
880 
881 
890 LIBMQTT_API int MQTTAsync_reconnect(MQTTAsync handle);
891 
892 
937 LIBMQTT_API int MQTTAsync_create(MQTTAsync* handle, const char* serverURI, const char* clientId,
938  int persistence_type, void* persistence_context);
939 
941 typedef struct
942 {
944  char struct_id[4];
965  /*
966  * When the maximum number of buffered messages is reached, delete the oldest rather than the newest.
967  */
969  /*
970  * Restore messages from persistence on create - or clear it.
971  */
973  /*
974  * Persist QoS0 publish commands - an option to not persist them.
975  */
978 
979 #define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_DEFAULT, 0, 0, 1, 1}
980 
981 #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_5, 0, 0, 1, 1}
982 
983 
984 LIBMQTT_API int MQTTAsync_createWithOptions(MQTTAsync* handle, const char* serverURI, const char* clientId,
985  int persistence_type, void* persistence_context, MQTTAsync_createOptions* options);
986 
999 typedef struct
1000 {
1002  char struct_id[4];
1008  const char* topicName;
1010  const char* message;
1019  int qos;
1021  struct
1022  {
1023  int len;
1024  const void* data;
1025  } payload;
1027 
1028 #define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } }
1029 
1030 #define MQTT_SSL_VERSION_DEFAULT 0
1031 #define MQTT_SSL_VERSION_TLS_1_0 1
1032 #define MQTT_SSL_VERSION_TLS_1_1 2
1033 #define MQTT_SSL_VERSION_TLS_1_2 3
1034 
1047 typedef struct
1048 {
1050  char struct_id[4];
1051 
1060 
1062  const char* trustStore;
1063 
1067  const char* keyStore;
1068 
1072  const char* privateKey;
1073 
1075  const char* privateKeyPassword;
1076 
1085  const char* enabledCipherSuites;
1086 
1089 
1095 
1101  int verify;
1102 
1108  const char* CApath;
1109 
1114  int (*ssl_error_cb) (const char *str, size_t len, void *u);
1115 
1121 
1127  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);
1128 
1134 
1141 
1149  const unsigned char *protos;
1150 
1155  unsigned int protos_len;
1157 
1158 #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 }
1159 
1161 typedef struct
1162 {
1163  const char* name;
1164  const char* value;
1166 
1172 typedef struct
1173 {
1175  char struct_id[4];
1235  const char* username;
1241  const char* password;
1276  void* context;
1292  char* const* serverURIs;
1315  struct {
1316  int len;
1317  const void* data;
1318  } binarypwd;
1319  /*
1320  * MQTT V5 clean start flag. Only clears state at the beginning of the session.
1321  */
1350  const char* httpProxy;
1354  const char* httpsProxy;
1356 
1357 
1358 #define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 8, 60, 1, 65535, NULL, NULL, NULL, 30, 0,\
1359 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1360 
1361 #define MQTTAsync_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 8, 60, 0, 65535, NULL, NULL, NULL, 30, 0,\
1362 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1363 
1364 #define MQTTAsync_connectOptions_initializer_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 1, 65535, NULL, NULL, NULL, 30, 0,\
1365 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1366 
1367 #define MQTTAsync_connectOptions_initializer5_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 0, 65535, NULL, NULL, NULL, 30, 0,\
1368 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
1369 
1370 
1391 LIBMQTT_API int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options);
1392 
1394 typedef struct
1395 {
1397  char struct_id[4];
1404  int timeout;
1422  void* context;
1430  enum MQTTReasonCodes reasonCode;
1444 
1445 #define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 0, 0, NULL, NULL, NULL,\
1446  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1447 
1448 #define MQTTAsync_disconnectOptions_initializer5 { {'M', 'Q', 'T', 'D'}, 1, 0, NULL, NULL, NULL,\
1449  MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL }
1450 
1469 LIBMQTT_API int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions* options);
1470 
1471 
1479 LIBMQTT_API int MQTTAsync_isConnected(MQTTAsync handle);
1480 
1481 
1496 LIBMQTT_API int MQTTAsync_subscribe(MQTTAsync handle, const char* topic, int qos, MQTTAsync_responseOptions* response);
1497 
1498 
1516 LIBMQTT_API int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char* const* topic, const int* qos, MQTTAsync_responseOptions* response);
1517 
1530 LIBMQTT_API int MQTTAsync_unsubscribe(MQTTAsync handle, const char* topic, MQTTAsync_responseOptions* response);
1531 
1544 LIBMQTT_API int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const* topic, MQTTAsync_responseOptions* response);
1545 
1546 
1566 LIBMQTT_API int MQTTAsync_send(MQTTAsync handle, const char* destinationName, int payloadlen, const void* payload, int qos,
1567  int retained, MQTTAsync_responseOptions* response);
1568 
1585 LIBMQTT_API int MQTTAsync_sendMessage(MQTTAsync handle, const char* destinationName, const MQTTAsync_message* msg, MQTTAsync_responseOptions* response);
1586 
1587 
1606 LIBMQTT_API int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens);
1607 
1616 #define MQTTASYNC_TRUE 1
1617 LIBMQTT_API int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token);
1618 
1619 
1632 LIBMQTT_API int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout);
1633 
1634 
1646 
1655 LIBMQTT_API void MQTTAsync_free(void* ptr);
1656 
1664 LIBMQTT_API void* MQTTAsync_malloc(size_t size);
1665 
1673 LIBMQTT_API void MQTTAsync_destroy(MQTTAsync* handle);
1674 
1675 
1676 
1678 {
1686 };
1687 
1688 
1695 
1696 
1705 typedef void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char* message);
1706 
1714 
1722 
1729 LIBMQTT_API const char* MQTTAsync_strerror(int code);
1730 
1731 
2345 #if defined(__cplusplus)
2346  }
2347 #endif
2348 
2349 #endif
const MQTTAsync_nameValue * httpHeaders
Definition: MQTTAsync.h:1346
LIBMQTT_API int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions *options)
LIBMQTT_API void MQTTAsync_freeMessage(MQTTAsync_message **msg)
MQTTAsync_willOptions * will
Definition: MQTTAsync.h:1229
MQTTAsync_token token
Definition: MQTTAsync.h:596
MQTTProperties properties
Definition: MQTTAsync.h:548
const char * httpProxy
Definition: MQTTAsync.h:1350
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1436
int MQTTAsync_token
Definition: MQTTAsync.h:253
LIBMQTT_API int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void *context, MQTTPersistence_afterRead *co)
LIBMQTT_API int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token)
LIBMQTT_API int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout)
LIBMQTT_API void MQTTAsync_free(void *ptr)
const char * httpsProxy
Definition: MQTTAsync.h:1354
void MQTTAsync_connectionLost(void *context, char *cause)
Definition: MQTTAsync.h:402
MQTTProperties properties
Definition: MQTTAsync.h:1426
void MQTTAsync_connected(void *context, char *cause)
Definition: MQTTAsync.h:420
const char * message
Definition: MQTTAsync.h:552
MQTTProperties * connectProperties
Definition: MQTTAsync.h:1326
LIBMQTT_API int MQTTAsync_reconnect(MQTTAsync handle)
LIBMQTT_API int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions *options)
LIBMQTT_API int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl)
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:1336
LIBMQTT_API int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void *context, MQTTAsync_updateConnectOptions *co)
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1270
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:716
LIBMQTT_API int MQTTAsync_subscribe(MQTTAsync handle, const char *topic, int qos, MQTTAsync_responseOptions *response)
void MQTTAsync_deliveryComplete(void *context, MQTTAsync_token token)
Definition: MQTTAsync.h:382
const char * username
Definition: MQTTAsync.h:467
MQTTASYNC_TRACE_LEVELS
Definition: MQTTAsync.h:1677
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1410
LIBMQTT_API int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char *const *topic, MQTTAsync_responseOptions *response)
LIBMQTT_API void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)
char *const * serverURIs
Definition: MQTTAsync.h:1292
const void * data
Definition: MQTTAsync.h:475
MQTTProperties properties
Definition: MQTTAsync.h:598
MQTTProperties properties
Definition: MQTTAsync.h:321
MQTTAsync_token token
Definition: MQTTAsync.h:728
LIBMQTT_API MQTTAsync_nameValue * MQTTAsync_getVersionInfo(void)
LIBMQTT_API void MQTTAsync_global_init(MQTTAsync_init_options *inits)
LIBMQTT_API int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void *context, MQTTAsync_messageArrived *ma)
const char * topicName
Definition: MQTTAsync.h:1008
LIBMQTT_API int MQTTAsync_setDisconnected(MQTTAsync handle, void *context, MQTTAsync_disconnected *co)
struct MQTTAsync_responseOptions MQTTAsync_responseOptions
const char * privateKeyPassword
Definition: MQTTAsync.h:1075
LIBMQTT_API int MQTTAsync_isConnected(MQTTAsync handle)
int MQTTAsync_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
Definition: MQTTAsync.h:359
MQTTSubscribe_options subscribeOptions
Definition: MQTTAsync.h:748
LIBMQTT_API int MQTTAsync_setConnected(MQTTAsync handle, void *context, MQTTAsync_connected *co)
LIBMQTT_API void MQTTAsync_destroy(MQTTAsync *handle)
const char * message
Definition: MQTTAsync.h:532
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:740
LIBMQTT_API int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void *context, MQTTPersistence_beforeWrite *co)
const char * message
Definition: MQTTAsync.h:1010
int MQTTAsync_updateConnectOptions(void *context, MQTTAsync_connectData *data)
Definition: MQTTAsync.h:487
LIBMQTT_API int MQTTAsync_createWithOptions(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTAsync_createOptions *options)
const char * enabledCipherSuites
Definition: MQTTAsync.h:1085
void MQTTAsync_onFailure5(void *context, MQTTAsync_failureData5 *response)
Definition: MQTTAsync.h:691
LIBMQTT_API int MQTTAsync_sendMessage(MQTTAsync handle, const char *destinationName, const MQTTAsync_message *msg, MQTTAsync_responseOptions *response)
const unsigned char * protos
Definition: MQTTAsync.h:1149
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:1264
void MQTTAsync_onSuccess(void *context, MQTTAsync_successData *response)
Definition: MQTTAsync.h:645
MQTTReasonCodes
LIBMQTT_API void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback *callback)
MQTTAsync_onSuccess * onSuccess
Definition: MQTTAsync.h:710
MQTTAsync_message message
Definition: MQTTAsync.h:611
LIBMQTT_API int MQTTAsync_send(MQTTAsync handle, const char *destinationName, int payloadlen, const void *payload, int qos, int retained, MQTTAsync_responseOptions *response)
MQTTSubscribe_options * subscribeOptionsList
Definition: MQTTAsync.h:757
LIBMQTT_API const char * MQTTAsync_strerror(int code)
void MQTTAsync_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
Definition: MQTTAsync.h:434
LIBMQTT_API int MQTTAsync_setCallbacks(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl, MQTTAsync_messageArrived *ma, MQTTAsync_deliveryComplete *dc)
LIBMQTT_API int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens)
MQTTAsync_onSuccess5 * onSuccess5
Definition: MQTTAsync.h:734
const char * name
Definition: MQTTAsync.h:1163
const char * trustStore
Definition: MQTTAsync.h:1062
MQTTProperties properties
Definition: MQTTAsync.h:744
void * MQTTAsync
Definition: MQTTAsync.h:243
MQTTAsync_token token
Definition: MQTTAsync.h:563
#define LIBMQTT_API
MQTTAsync_token token
Definition: MQTTAsync.h:528
void MQTTAsync_onFailure(void *context, MQTTAsync_failureData *response)
Definition: MQTTAsync.h:676
void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char *message)
Definition: MQTTAsync.h:1705
enum MQTTReasonCodes * reasonCodes
Definition: MQTTAsync.h:606
unsigned int protos_len
Definition: MQTTAsync.h:1155
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1342
MQTTAsync_token token
Definition: MQTTAsync.h:544
const void * data
Definition: MQTTAsync.h:1024
int MQTTPersistence_afterRead(void *context, char **buffer, int *buflen)
MQTTAsync_onFailure5 * onFailure5
Definition: MQTTAsync.h:1442
MQTTAsync_message message
Definition: MQTTAsync.h:576
MQTTAsync_SSLOptions * ssl
Definition: MQTTAsync.h:1258
const char * value
Definition: MQTTAsync.h:1164
LIBMQTT_API int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void *context, MQTTAsync_deliveryComplete *dc)
LIBMQTT_API int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char *const *topic, const int *qos, MQTTAsync_responseOptions *response)
const char * privateKey
Definition: MQTTAsync.h:1072
LIBMQTT_API int MQTTAsync_unsubscribe(MQTTAsync handle, const char *topic, MQTTAsync_responseOptions *response)
const char * keyStore
Definition: MQTTAsync.h:1067
MQTTAsync_onFailure * onFailure
Definition: MQTTAsync.h:1416
This structure represents a persistent data store, used to store outbound and inbound messages...
LIBMQTT_API int MQTTAsync_create(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
const char * CApath
Definition: MQTTAsync.h:1108
LIBMQTT_API void * MQTTAsync_malloc(size_t size)
void MQTTAsync_onSuccess5(void *context, MQTTAsync_successData5 *response)
Definition: MQTTAsync.h:661
int MQTTPersistence_beforeWrite(void *context, int bufcount, char *buffers[], int buflens[])
MQTTProperties * willProperties
Definition: MQTTAsync.h:1330