88 #if !defined(MQTTASYNC_H) 91 #if defined(__cplusplus) 105 #if !defined(NO_PERSISTENCE) 113 #define MQTTASYNC_SUCCESS 0 118 #define MQTTASYNC_FAILURE -1 122 #define MQTTASYNC_PERSISTENCE_ERROR -2 127 #define MQTTASYNC_DISCONNECTED -3 132 #define MQTTASYNC_MAX_MESSAGES_INFLIGHT -4 136 #define MQTTASYNC_BAD_UTF8_STRING -5 140 #define MQTTASYNC_NULL_PARAMETER -6 146 #define MQTTASYNC_TOPICNAME_TRUNCATED -7 151 #define MQTTASYNC_BAD_STRUCTURE -8 155 #define MQTTASYNC_BAD_QOS -9 159 #define MQTTASYNC_NO_MORE_MSGIDS -10 163 #define MQTTASYNC_OPERATION_INCOMPLETE -11 167 #define MQTTASYNC_MAX_BUFFERED_MESSAGES -12 171 #define MQTTASYNC_SSL_NOT_SUPPORTED -13 177 #define MQTTASYNC_BAD_PROTOCOL -14 181 #define MQTTASYNC_BAD_MQTT_OPTION -15 185 #define MQTTASYNC_WRONG_MQTT_VERSION -16 189 #define MQTTASYNC_0_LEN_WILL_TOPIC -17 195 #define MQTTASYNC_COMMAND_IGNORED -18 199 #define MQTTVERSION_DEFAULT 0 203 #define MQTTVERSION_3_1 3 207 #define MQTTVERSION_3_1_1 4 211 #define MQTTVERSION_5 5 215 #define MQTT_BAD_SUBSCRIBE 0x80 231 #define MQTTAsync_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 } 324 #define MQTTAsync_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer } 479 #define MQTTAsync_connectData_initializer {{'M', 'Q', 'C', 'D'}, 0, NULL, {0, NULL}} 557 #define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, 0, NULL, 0} 630 #define MQTTAsync_successData5_initializer {{'M', 'Q', 'S', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, {.sub={0,0}}} 760 #define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 1, NULL, NULL, 0, 0, NULL, NULL, MQTTProperties_initializer, MQTTSubscribe_options_initializer, 0, NULL} 764 #define MQTTAsync_callOptions_initializer MQTTAsync_responseOptions_initializer 938 int persistence_type,
void* persistence_context);
979 #define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_DEFAULT, 0, 0, 1, 1} 981 #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_5, 0, 0, 1, 1} 1028 #define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } } 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 1114 int (*ssl_error_cb) (
const char *str,
size_t len,
void *u);
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);
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 } 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} 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} 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} 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} 1445 #define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 0, 0, NULL, NULL, NULL,\ 1446 MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL } 1448 #define MQTTAsync_disconnectOptions_initializer5 { {'M', 'Q', 'T', 'D'}, 1, 0, NULL, NULL, NULL,\ 1449 MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL } 1566 LIBMQTT_API int MQTTAsync_send(MQTTAsync handle,
const char* destinationName,
int payloadlen,
const void* payload,
int qos,
1616 #define MQTTASYNC_TRUE 1 2345 #if defined(__cplusplus)
const MQTTAsync_nameValue * httpHeaders
LIBMQTT_API int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions *options)
LIBMQTT_API void MQTTAsync_freeMessage(MQTTAsync_message **msg)
MQTTAsync_willOptions * will
MQTTProperties properties
int sendWhileDisconnected
MQTTAsync_onSuccess5 * onSuccess5
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)
void MQTTAsync_connectionLost(void *context, char *cause)
MQTTProperties properties
void MQTTAsync_connected(void *context, char *cause)
MQTTProperties * connectProperties
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
LIBMQTT_API int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void *context, MQTTAsync_updateConnectOptions *co)
MQTTAsync_onFailure * onFailure
MQTTAsync_onFailure * onFailure
LIBMQTT_API int MQTTAsync_subscribe(MQTTAsync handle, const char *topic, int qos, MQTTAsync_responseOptions *response)
void MQTTAsync_deliveryComplete(void *context, MQTTAsync_token token)
MQTTAsync_onSuccess * onSuccess
int allowDisconnectedSendAtAnyTime
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)
MQTTProperties properties
MQTTProperties properties
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)
LIBMQTT_API int MQTTAsync_setDisconnected(MQTTAsync handle, void *context, MQTTAsync_disconnected *co)
struct MQTTAsync_responseOptions MQTTAsync_responseOptions
const char * privateKeyPassword
LIBMQTT_API int MQTTAsync_isConnected(MQTTAsync handle)
int MQTTAsync_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
MQTTSubscribe_options subscribeOptions
LIBMQTT_API int MQTTAsync_setConnected(MQTTAsync handle, void *context, MQTTAsync_connected *co)
LIBMQTT_API void MQTTAsync_destroy(MQTTAsync *handle)
MQTTAsync_onFailure5 * onFailure5
LIBMQTT_API int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void *context, MQTTPersistence_beforeWrite *co)
int MQTTAsync_updateConnectOptions(void *context, MQTTAsync_connectData *data)
LIBMQTT_API int MQTTAsync_createWithOptions(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTAsync_createOptions *options)
int subscribeOptionsCount
const char * enabledCipherSuites
void MQTTAsync_onFailure5(void *context, MQTTAsync_failureData5 *response)
LIBMQTT_API int MQTTAsync_sendMessage(MQTTAsync handle, const char *destinationName, const MQTTAsync_message *msg, MQTTAsync_responseOptions *response)
const unsigned char * protos
MQTTAsync_onSuccess * onSuccess
void MQTTAsync_onSuccess(void *context, MQTTAsync_successData *response)
LIBMQTT_API void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback *callback)
MQTTAsync_onSuccess * onSuccess
MQTTAsync_message message
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
LIBMQTT_API const char * MQTTAsync_strerror(int code)
void MQTTAsync_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
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
MQTTProperties properties
int disableDefaultTrustStore
void MQTTAsync_onFailure(void *context, MQTTAsync_failureData *response)
void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char *message)
enum MQTTReasonCodes * reasonCodes
MQTTAsync_onFailure5 * onFailure5
int MQTTPersistence_afterRead(void *context, char **buffer, int *buflen)
MQTTAsync_onFailure5 * onFailure5
MQTTAsync_message message
MQTTAsync_SSLOptions * ssl
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)
LIBMQTT_API int MQTTAsync_unsubscribe(MQTTAsync handle, const char *topic, MQTTAsync_responseOptions *response)
MQTTAsync_onFailure * onFailure
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)
LIBMQTT_API void * MQTTAsync_malloc(size_t size)
void MQTTAsync_onSuccess5(void *context, MQTTAsync_successData5 *response)
int MQTTPersistence_beforeWrite(void *context, int bufcount, char *buffers[], int buflens[])
MQTTProperties * willProperties