106 #if !defined(MQTTCLIENT_H) 109 #if defined(__cplusplus) 123 #if !defined(NO_PERSISTENCE) 131 #define MQTTCLIENT_SUCCESS 0 136 #define MQTTCLIENT_FAILURE -1 143 #define MQTTCLIENT_DISCONNECTED -3 148 #define MQTTCLIENT_MAX_MESSAGES_INFLIGHT -4 152 #define MQTTCLIENT_BAD_UTF8_STRING -5 156 #define MQTTCLIENT_NULL_PARAMETER -6 162 #define MQTTCLIENT_TOPICNAME_TRUNCATED -7 167 #define MQTTCLIENT_BAD_STRUCTURE -8 171 #define MQTTCLIENT_BAD_QOS -9 175 #define MQTTCLIENT_SSL_NOT_SUPPORTED -10 179 #define MQTTCLIENT_BAD_MQTT_VERSION -11 185 #define MQTTCLIENT_BAD_PROTOCOL -14 189 #define MQTTCLIENT_BAD_MQTT_OPTION -15 193 #define MQTTCLIENT_WRONG_MQTT_VERSION -16 197 #define MQTTCLIENT_0_LEN_WILL_TOPIC -17 203 #define MQTTVERSION_DEFAULT 0 207 #define MQTTVERSION_3_1 3 211 #define MQTTVERSION_3_1_1 4 215 #define MQTTVERSION_5 5 219 #define MQTT_BAD_SUBSCRIBE 0x80 234 #define MQTTClient_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 } 327 #define MQTTClient_message_initializer { {'M', 'Q', 'T', 'M'}, 1, 0, NULL, 0, 0, 0, 0, MQTTProperties_initializer } 532 int persistence_type,
void* persistence_context);
549 #define MQTTClient_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 0, MQTTVERSION_DEFAULT } 639 #define MQTTClient_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, {0, NULL} } 641 #define MQTT_SSL_VERSION_DEFAULT 0 642 #define MQTT_SSL_VERSION_TLS_1_0 1 643 #define MQTT_SSL_VERSION_TLS_1_1 2 644 #define MQTT_SSL_VERSION_TLS_1_2 3 725 int (*ssl_error_cb) (
const char *str,
size_t len,
void *u);
738 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);
769 #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 } 953 #define MQTTClient_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 7, 60, 1, 1, NULL, NULL, NULL, 30, 0, NULL,\ 954 0, NULL, MQTTVERSION_DEFAULT, {NULL, 0, 0}, {0, NULL}, -1, 0, NULL} 956 #define MQTTClient_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 7, 60, 0, 1, NULL, NULL, NULL, 30, 0, NULL,\ 957 0, NULL, MQTTVERSION_5, {NULL, 0, 0}, {0, NULL}, -1, 1, NULL} 959 #define MQTTClient_connectOptions_initializer_ws { {'M', 'Q', 'T', 'C'}, 7, 45, 1, 1, NULL, NULL, NULL, 30, 0, NULL,\ 960 0, NULL, MQTTVERSION_DEFAULT, {NULL, 0, 0}, {0, NULL}, -1, 0, NULL} 962 #define MQTTClient_connectOptions_initializer5_ws { {'M', 'Q', 'T', 'C'}, 7, 45, 0, 1, NULL, NULL, NULL, 30, 0, NULL,\ 963 0, NULL, MQTTVERSION_5, {NULL, 0, 0}, {0, NULL}, -1, 1, NULL} 997 #define MQTTResponse_initializer {1, MQTTREASONCODE_SUCCESS, 0, NULL, NULL} 1196 MQTTClient_deliveryToken* dt);
1263 MQTTClient_deliveryToken* dt);
1343 unsigned long timeout);
LIBMQTT_API const char * MQTTClient_strerror(int code)
LIBMQTT_API void MQTTResponse_free(MQTTResponse response)
LIBMQTT_API void MQTTClient_setTraceCallback(MQTTClient_traceCallback *callback)
LIBMQTT_API int MQTTClient_createWithOptions(MQTTClient *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTClient_createOptions *options)
LIBMQTT_API int MQTTClient_isConnected(MQTTClient handle)
int MQTTClient_messageArrived(void *context, char *topicName, int topicLen, MQTTClient_message *message)
void MQTTClient_connectionLost(void *context, char *cause)
LIBMQTT_API int MQTTClient_waitForCompletion(MQTTClient handle, MQTTClient_deliveryToken dt, unsigned long timeout)
void MQTTClient_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
LIBMQTT_API int MQTTClient_unsubscribe(MQTTClient handle, const char *topic)
const char * enabledCipherSuites
LIBMQTT_API int MQTTClient_disconnect(MQTTClient handle, int timeout)
LIBMQTT_API int MQTTClient_connect(MQTTClient handle, MQTTClient_connectOptions *options)
LIBMQTT_API int MQTTClient_create(MQTTClient *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
enum MQTTReasonCodes * reasonCodes
LIBMQTT_API void MQTTClient_destroy(MQTTClient *handle)
LIBMQTT_API MQTTResponse MQTTClient_publishMessage5(MQTTClient handle, const char *topicName, MQTTClient_message *msg, MQTTClient_deliveryToken *dt)
enum MQTTReasonCodes reasonCode
LIBMQTT_API MQTTResponse MQTTClient_subscribe5(MQTTClient handle, const char *topic, int qos, MQTTSubscribe_options *opts, MQTTProperties *props)
int disableDefaultTrustStore
LIBMQTT_API void MQTTClient_yield(void)
LIBMQTT_API int MQTTClient_setDisconnected(MQTTClient handle, void *context, MQTTClient_disconnected *co)
LIBMQTT_API void MQTTClient_free(void *ptr)
LIBMQTT_API MQTTResponse MQTTClient_publish5(MQTTClient handle, const char *topicName, int payloadlen, const void *payload, int qos, int retained, MQTTProperties *properties, MQTTClient_deliveryToken *dt)
MQTTClient_SSLOptions * ssl
LIBMQTT_API MQTTResponse MQTTClient_connect5(MQTTClient handle, MQTTClient_connectOptions *options, MQTTProperties *connectProperties, MQTTProperties *willProperties)
LIBMQTT_API int MQTTClient_disconnect5(MQTTClient handle, int timeout, enum MQTTReasonCodes reason, MQTTProperties *props)
This structure represents a persistent data store, used to store outbound and inbound messages...
struct MQTTResponse MQTTResponse
LIBMQTT_API MQTTClient_nameValue * MQTTClient_getVersionInfo(void)
LIBMQTT_API void MQTTClient_freeMessage(MQTTClient_message **msg)
void MQTTClient_published(void *context, int dt, int packet_type, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
const unsigned char * protos
LIBMQTT_API int MQTTClient_subscribe(MQTTClient handle, const char *topic, int qos)
LIBMQTT_API MQTTResponse MQTTClient_unsubscribe5(MQTTClient handle, const char *topic, MQTTProperties *props)
LIBMQTT_API int MQTTClient_subscribeMany(MQTTClient handle, int count, char *const *topic, int *qos)
const MQTTClient_nameValue * httpHeaders
void MQTTClient_traceCallback(enum MQTTCLIENT_TRACE_LEVELS level, char *message)
MQTTProperties properties
void MQTTClient_deliveryComplete(void *context, MQTTClient_deliveryToken dt)
LIBMQTT_API int MQTTClient_getPendingDeliveryTokens(MQTTClient handle, MQTTClient_deliveryToken **tokens)
LIBMQTT_API void MQTTClient_setTraceLevel(enum MQTTCLIENT_TRACE_LEVELS level)
LIBMQTT_API int MQTTClient_unsubscribeMany(MQTTClient handle, int count, char *const *topic)
LIBMQTT_API int MQTTClient_setPublished(MQTTClient handle, void *context, MQTTClient_published *co)
int MQTTClient_deliveryToken
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_receive(MQTTClient handle, char **topicName, int *topicLen, MQTTClient_message **message, unsigned long timeout)
const char * privateKeyPassword
LIBMQTT_API int MQTTClient_setCallbacks(MQTTClient handle, void *context, MQTTClient_connectionLost *cl, MQTTClient_messageArrived *ma, MQTTClient_deliveryComplete *dc)
LIBMQTT_API MQTTResponse MQTTClient_subscribeMany5(MQTTClient handle, int count, char *const *topic, int *qos, MQTTSubscribe_options *opts, MQTTProperties *props)
LIBMQTT_API void MQTTClient_global_init(MQTTClient_init_options *inits)
LIBMQTT_API MQTTResponse MQTTClient_unsubscribeMany5(MQTTClient handle, int count, char *const *topic, MQTTProperties *props)
MQTTClient_willOptions * will
LIBMQTT_API int MQTTClient_publishMessage(MQTTClient handle, const char *topicName, MQTTClient_message *msg, MQTTClient_deliveryToken *dt)
MQTTProperties * properties