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 MQTTVERSION_DEFAULT 0 199 #define MQTTVERSION_3_1 3 203 #define MQTTVERSION_3_1_1 4 207 #define MQTTVERSION_5 5 211 #define MQTT_BAD_SUBSCRIBE 0x80 227 #define MQTTAsync_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 } 319 #define MQTTAsync_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer } 471 #define MQTTAsync_connectData_initializer {{'M', 'Q', 'C', 'D'}, 0, NULL, {0, NULL}} 543 #define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer, 0, NULL} 616 #define MQTTAsync_successData5_initializer {{'M', 'Q', 'S', 'D'}, 0, 0, MQTTREASONCODE_SUCCESS, MQTTProperties_initializer} 746 #define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 1, NULL, NULL, 0, 0, NULL, NULL, MQTTProperties_initializer, MQTTSubscribe_options_initializer, 0, NULL} 750 #define MQTTAsync_callOptions_initializer MQTTAsync_responseOptions_initializer 924 int persistence_type,
void* persistence_context);
965 #define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_DEFAULT, 0, 0, 1, 1} 967 #define MQTTAsync_createOptions_initializer5 { {'M', 'Q', 'C', 'O'}, 2, 0, 100, MQTTVERSION_5, 0, 0, 1, 1} 1014 #define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } } 1016 #define MQTT_SSL_VERSION_DEFAULT 0 1017 #define MQTT_SSL_VERSION_TLS_1_0 1 1018 #define MQTT_SSL_VERSION_TLS_1_1 2 1019 #define MQTT_SSL_VERSION_TLS_1_2 3 1100 int (*ssl_error_cb) (
const char *str,
size_t len,
void *u);
1113 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);
1144 #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 } 1335 #define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 7, 60, 1, 65535, NULL, NULL, NULL, 30, 0,\ 1336 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL} 1338 #define MQTTAsync_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 7, 60, 0, 65535, NULL, NULL, NULL, 30, 0,\ 1339 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL} 1341 #define MQTTAsync_connectOptions_initializer_ws { {'M', 'Q', 'T', 'C'}, 7, 45, 1, 65535, NULL, NULL, NULL, 30, 0,\ 1342 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_DEFAULT, 0, 1, 60, {0, NULL}, 0, NULL, NULL, NULL, NULL, NULL} 1344 #define MQTTAsync_connectOptions_initializer5_ws { {'M', 'Q', 'T', 'C'}, 7, 45, 0, 65535, NULL, NULL, NULL, 30, 0,\ 1345 NULL, NULL, NULL, NULL, 0, NULL, MQTTVERSION_5, 0, 1, 60, {0, NULL}, 1, NULL, NULL, NULL, NULL, NULL} 1422 #define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 0, 0, NULL, NULL, NULL,\ 1423 MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL } 1425 #define MQTTAsync_disconnectOptions_initializer5 { {'M', 'Q', 'T', 'D'}, 1, 0, NULL, NULL, NULL,\ 1426 MQTTProperties_initializer, MQTTREASONCODE_SUCCESS, NULL, NULL } 1591 #define MQTTASYNC_TRUE 1 MQTTAsync_onFailure * onFailure
MQTTProperties properties
LIBMQTT_API int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions *options)
LIBMQTT_API int MQTTAsync_subscribe(MQTTAsync handle, const char *topic, int qos, MQTTAsync_responseOptions *response)
void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char *message)
LIBMQTT_API int MQTTAsync_isConnected(MQTTAsync handle)
MQTTAsync_onFailure5 * onFailure5
LIBMQTT_API int MQTTAsync_setAfterPersistenceRead(MQTTAsync handle, void *context, MQTTPersistence_afterRead *co)
LIBMQTT_API int MQTTAsync_send(MQTTAsync handle, const char *destinationName, int payloadlen, const void *payload, int qos, int retained, MQTTAsync_responseOptions *response)
LIBMQTT_API int MQTTAsync_setBeforePersistenceWrite(MQTTAsync handle, void *context, MQTTPersistence_beforeWrite *co)
int sendWhileDisconnected
MQTTProperties properties
LIBMQTT_API int MQTTAsync_setCallbacks(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl, MQTTAsync_messageArrived *ma, MQTTAsync_deliveryComplete *dc)
int disableDefaultTrustStore
MQTTProperties properties
MQTTSubscribe_options * subscribeOptionsList
LIBMQTT_API void MQTTAsync_destroy(MQTTAsync *handle)
void MQTTAsync_connectionLost(void *context, char *cause)
MQTTAsync_onSuccess5 * onSuccess5
LIBMQTT_API int MQTTAsync_setDeliveryCompleteCallback(MQTTAsync handle, void *context, MQTTAsync_deliveryComplete *dc)
LIBMQTT_API void * MQTTAsync_malloc(size_t size)
enum MQTTReasonCodes * reasonCodes
LIBMQTT_API void MQTTAsync_free(void *ptr)
int MQTTAsync_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
void MQTTAsync_onSuccess5(void *context, MQTTAsync_successData5 *response)
LIBMQTT_API int MQTTAsync_reconnect(MQTTAsync handle)
LIBMQTT_API int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char *const *topic, MQTTAsync_responseOptions *response)
LIBMQTT_API int MQTTAsync_setConnected(MQTTAsync handle, void *context, MQTTAsync_connected *co)
struct MQTTAsync_responseOptions MQTTAsync_responseOptions
int MQTTAsync_updateConnectOptions(void *context, MQTTAsync_connectData *data)
MQTTAsync_onFailure5 * onFailure5
This structure represents a persistent data store, used to store outbound and inbound messages...
LIBMQTT_API int MQTTAsync_setConnectionLostCallback(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl)
LIBMQTT_API int MQTTAsync_setMessageArrivedCallback(MQTTAsync handle, void *context, MQTTAsync_messageArrived *ma)
MQTTAsync_onFailure * onFailure
MQTTAsync_onFailure5 * onFailure5
LIBMQTT_API const char * MQTTAsync_strerror(int code)
MQTTAsync_onFailure * onFailure
MQTTAsync_message message
LIBMQTT_API int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char *const *topic, int *qos, MQTTAsync_responseOptions *response)
MQTTAsync_SSLOptions * ssl
MQTTAsync_onSuccess * onSuccess
LIBMQTT_API int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token)
int subscribeOptionsCount
MQTTAsync_willOptions * will
const char * privateKeyPassword
void MQTTAsync_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
const char * enabledCipherSuites
MQTTProperties properties
LIBMQTT_API MQTTAsync_nameValue * MQTTAsync_getVersionInfo(void)
LIBMQTT_API int MQTTAsync_unsubscribe(MQTTAsync handle, const char *topic, MQTTAsync_responseOptions *response)
MQTTProperties properties
void MQTTAsync_onSuccess(void *context, MQTTAsync_successData *response)
MQTTAsync_message message
void MQTTAsync_connected(void *context, char *cause)
LIBMQTT_API void MQTTAsync_global_init(MQTTAsync_init_options *inits)
LIBMQTT_API void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)
const MQTTAsync_nameValue * httpHeaders
LIBMQTT_API int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions *options)
LIBMQTT_API int MQTTAsync_setDisconnected(MQTTAsync handle, void *context, MQTTAsync_disconnected *co)
LIBMQTT_API int MQTTAsync_createWithOptions(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTAsync_createOptions *options)
LIBMQTT_API int MQTTAsync_create(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
MQTTProperties * willProperties
MQTTSubscribe_options subscribeOptions
void MQTTAsync_onFailure(void *context, MQTTAsync_failureData *response)
LIBMQTT_API void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback *callback)
void MQTTAsync_onFailure5(void *context, MQTTAsync_failureData5 *response)
MQTTAsync_onSuccess5 * onSuccess5
LIBMQTT_API int MQTTAsync_setUpdateConnectOptions(MQTTAsync handle, void *context, MQTTAsync_updateConnectOptions *co)
int allowDisconnectedSendAtAnyTime
LIBMQTT_API void MQTTAsync_freeMessage(MQTTAsync_message **msg)
LIBMQTT_API int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens)
int MQTTPersistence_afterRead(void *context, char **buffer, int *buflen)
MQTTAsync_onSuccess * onSuccess
void MQTTAsync_deliveryComplete(void *context, MQTTAsync_token token)
LIBMQTT_API int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout)
MQTTAsync_onSuccess5 * onSuccess5
LIBMQTT_API int MQTTAsync_sendMessage(MQTTAsync handle, const char *destinationName, const MQTTAsync_message *msg, MQTTAsync_responseOptions *response)
MQTTAsync_onSuccess * onSuccess
int MQTTPersistence_beforeWrite(void *context, int bufcount, char *buffers[], int buflens[])
MQTTProperties * connectProperties
const unsigned char * protos