107 #if !defined(MQTTCLIENT_H) 110 #if defined(__cplusplus) 124 #if !defined(NO_PERSISTENCE) 132 #define MQTTCLIENT_SUCCESS 0 137 #define MQTTCLIENT_FAILURE -1 144 #define MQTTCLIENT_DISCONNECTED -3 149 #define MQTTCLIENT_MAX_MESSAGES_INFLIGHT -4 153 #define MQTTCLIENT_BAD_UTF8_STRING -5 157 #define MQTTCLIENT_NULL_PARAMETER -6 163 #define MQTTCLIENT_TOPICNAME_TRUNCATED -7 168 #define MQTTCLIENT_BAD_STRUCTURE -8 172 #define MQTTCLIENT_BAD_QOS -9 176 #define MQTTCLIENT_SSL_NOT_SUPPORTED -10 180 #define MQTTCLIENT_BAD_MQTT_VERSION -11 186 #define MQTTCLIENT_BAD_PROTOCOL -14 190 #define MQTTCLIENT_BAD_MQTT_OPTION -15 194 #define MQTTCLIENT_WRONG_MQTT_VERSION -16 198 #define MQTTCLIENT_0_LEN_WILL_TOPIC -17 204 #define MQTTVERSION_DEFAULT 0 208 #define MQTTVERSION_3_1 3 212 #define MQTTVERSION_3_1_1 4 216 #define MQTTVERSION_5 5 220 #define MQTT_BAD_SUBSCRIBE 0x80 235 #define MQTTClient_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 } 328 #define MQTTClient_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer } 533 int persistence_type,
void* persistence_context);
550 #define MQTTClient_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 0, MQTTVERSION_DEFAULT } 640 #define MQTTClient_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, {0, NULL} } 642 #define MQTT_SSL_VERSION_DEFAULT 0 643 #define MQTT_SSL_VERSION_TLS_1_0 1 644 #define MQTT_SSL_VERSION_TLS_1_1 2 645 #define MQTT_SSL_VERSION_TLS_1_2 3 726 int (*ssl_error_cb) (
const char *str,
size_t len,
void *u);
739 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);
770 #define MQTTClient_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 } 963 #define MQTTClient_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 8, 60, 1, 1, NULL, NULL, NULL, 30, 0, NULL,\ 964 0, NULL, MQTTVERSION_DEFAULT, {NULL, 0, 0}, {0, NULL}, -1, 0, NULL, NULL, NULL} 966 #define MQTTClient_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 8, 60, 0, 1, NULL, NULL, NULL, 30, 0, NULL,\ 967 0, NULL, MQTTVERSION_5, {NULL, 0, 0}, {0, NULL}, -1, 1, NULL, NULL, NULL} 969 #define MQTTClient_connectOptions_initializer_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 1, 1, NULL, NULL, NULL, 30, 0, NULL,\ 970 0, NULL, MQTTVERSION_DEFAULT, {NULL, 0, 0}, {0, NULL}, -1, 0, NULL, NULL, NULL} 972 #define MQTTClient_connectOptions_initializer5_ws { {'M', 'Q', 'T', 'C'}, 8, 45, 0, 1, NULL, NULL, NULL, 30, 0, NULL,\ 973 0, NULL, MQTTVERSION_5, {NULL, 0, 0}, {0, NULL}, -1, 1, NULL, NULL, NULL} 1007 #define MQTTResponse_initializer {1, MQTTREASONCODE_SUCCESS, 0, NULL, NULL} 1207 MQTTClient_deliveryToken* dt);
1274 MQTTClient_deliveryToken* dt);
1354 unsigned long timeout);
1442 #if defined(__cplusplus)
LIBMQTT_API int MQTTClient_setCallbacks(MQTTClient handle, void *context, MQTTClient_connectionLost *cl, MQTTClient_messageArrived *ma, MQTTClient_deliveryComplete *dc)
void MQTTClient_connectionLost(void *context, char *cause)
LIBMQTT_API int MQTTClient_unsubscribeMany(MQTTClient handle, int count, char *const *topic)
LIBMQTT_API int MQTTClient_setCommandTimeout(MQTTClient handle, unsigned long milliSeconds)
LIBMQTT_API int MQTTClient_disconnect(MQTTClient handle, int timeout)
LIBMQTT_API void MQTTClient_freeMessage(MQTTClient_message **msg)
LIBMQTT_API MQTTResponse MQTTClient_publishMessage5(MQTTClient handle, const char *topicName, MQTTClient_message *msg, MQTTClient_deliveryToken *dt)
LIBMQTT_API void MQTTClient_yield(void)
void MQTTClient_traceCallback(enum MQTTCLIENT_TRACE_LEVELS level, char *message)
LIBMQTT_API MQTTResponse MQTTClient_unsubscribe5(MQTTClient handle, const char *topic, MQTTProperties *props)
LIBMQTT_API int MQTTClient_waitForCompletion(MQTTClient handle, MQTTClient_deliveryToken dt, unsigned long timeout)
LIBMQTT_API int MQTTClient_create(MQTTClient *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
enum MQTTReasonCodes reasonCode
const char * enabledCipherSuites
int disableDefaultTrustStore
const MQTTClient_nameValue * httpHeaders
LIBMQTT_API int MQTTClient_createWithOptions(MQTTClient *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTClient_createOptions *options)
MQTTClient_willOptions * will
LIBMQTT_API void MQTTClient_free(void *ptr)
LIBMQTT_API int MQTTClient_isConnected(MQTTClient handle)
MQTTProperties properties
LIBMQTT_API const char * MQTTClient_strerror(int code)
LIBMQTT_API void MQTTClient_setTraceLevel(enum MQTTCLIENT_TRACE_LEVELS level)
LIBMQTT_API void MQTTClient_setTraceCallback(MQTTClient_traceCallback *callback)
LIBMQTT_API void MQTTClient_global_init(MQTTClient_init_options *inits)
LIBMQTT_API int MQTTClient_disconnect5(MQTTClient handle, int timeout, enum MQTTReasonCodes reason, MQTTProperties *props)
enum MQTTReasonCodes * reasonCodes
LIBMQTT_API int MQTTClient_setDisconnected(MQTTClient handle, void *context, MQTTClient_disconnected *co)
LIBMQTT_API MQTTResponse MQTTClient_subscribeMany5(MQTTClient handle, int count, char *const *topic, int *qos, MQTTSubscribe_options *opts, MQTTProperties *props)
LIBMQTT_API int MQTTClient_publish(MQTTClient handle, const char *topicName, int payloadlen, const void *payload, int qos, int retained, MQTTClient_deliveryToken *dt)
LIBMQTT_API int MQTTClient_unsubscribe(MQTTClient handle, const char *topic)
void MQTTClient_deliveryComplete(void *context, MQTTClient_deliveryToken dt)
const char * privateKeyPassword
int MQTTClient_deliveryToken
LIBMQTT_API int MQTTClient_receive(MQTTClient handle, char **topicName, int *topicLen, MQTTClient_message **message, unsigned long timeout)
LIBMQTT_API int MQTTClient_setPublished(MQTTClient handle, void *context, MQTTClient_published *co)
LIBMQTT_API MQTTClient_nameValue * MQTTClient_getVersionInfo(void)
LIBMQTT_API MQTTResponse MQTTClient_connect5(MQTTClient handle, MQTTClient_connectOptions *options, MQTTProperties *connectProperties, MQTTProperties *willProperties)
LIBMQTT_API MQTTResponse MQTTClient_publish5(MQTTClient handle, const char *topicName, int payloadlen, const void *payload, int qos, int retained, MQTTProperties *properties, MQTTClient_deliveryToken *dt)
LIBMQTT_API MQTTResponse MQTTClient_unsubscribeMany5(MQTTClient handle, int count, char *const *topic, MQTTProperties *props)
LIBMQTT_API int MQTTClient_connect(MQTTClient handle, MQTTClient_connectOptions *options)
LIBMQTT_API void MQTTResponse_free(MQTTResponse response)
const unsigned char * protos
LIBMQTT_API MQTTResponse MQTTClient_subscribe5(MQTTClient handle, const char *topic, int qos, MQTTSubscribe_options *opts, MQTTProperties *props)
void MQTTClient_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
struct MQTTResponse MQTTResponse
LIBMQTT_API int MQTTClient_subscribeMany(MQTTClient handle, int count, char *const *topic, int *qos)
void MQTTClient_published(void *context, int dt, int packet_type, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
LIBMQTT_API int MQTTClient_publishMessage(MQTTClient handle, const char *topicName, MQTTClient_message *msg, MQTTClient_deliveryToken *dt)
This structure represents a persistent data store, used to store outbound and inbound messages...
LIBMQTT_API int MQTTClient_subscribe(MQTTClient handle, const char *topic, int qos)
LIBMQTT_API int MQTTClient_getPendingDeliveryTokens(MQTTClient handle, MQTTClient_deliveryToken **tokens)
int MQTTClient_messageArrived(void *context, char *topicName, int topicLen, MQTTClient_message *message)
MQTTClient_SSLOptions * ssl
MQTTProperties * properties
LIBMQTT_API void MQTTClient_destroy(MQTTClient *handle)