106 #if !defined(MQTTCLIENT_H) 109 #if defined(__cplusplus) 113 #if defined(WIN32) || defined(WIN64) 114 #define DLLImport __declspec(dllimport) 115 #define DLLExport __declspec(dllexport) 117 #define DLLImport extern 118 #define DLLExport __attribute__ ((visibility ("default"))) 129 #if !defined(NO_PERSISTENCE) 137 #define MQTTCLIENT_SUCCESS 0 142 #define MQTTCLIENT_FAILURE -1 149 #define MQTTCLIENT_DISCONNECTED -3 154 #define MQTTCLIENT_MAX_MESSAGES_INFLIGHT -4 158 #define MQTTCLIENT_BAD_UTF8_STRING -5 162 #define MQTTCLIENT_NULL_PARAMETER -6 168 #define MQTTCLIENT_TOPICNAME_TRUNCATED -7 173 #define MQTTCLIENT_BAD_STRUCTURE -8 177 #define MQTTCLIENT_BAD_QOS -9 181 #define MQTTCLIENT_SSL_NOT_SUPPORTED -10 185 #define MQTTCLIENT_BAD_MQTT_VERSION -11 189 #define MQTTCLIENT_BAD_PROTOCOL -14 193 #define MQTTCLIENT_BAD_MQTT_OPTION -15 197 #define MQTTCLIENT_WRONG_MQTT_VERSION -16 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 } 525 int persistence_type,
void* persistence_context);
541 #define MQTTClient_createOptions_initializer { {'M', 'Q', 'C', 'O'}, MQTTVERSION_DEFAULT } 631 #define MQTTClient_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, {0, NULL} } 633 #define MQTT_SSL_VERSION_DEFAULT 0 634 #define MQTT_SSL_VERSION_TLS_1_0 1 635 #define MQTT_SSL_VERSION_TLS_1_1 2 636 #define MQTT_SSL_VERSION_TLS_1_2 3 709 int (*ssl_error_cb) (
const char *str,
size_t len,
void *u);
719 #define MQTTClient_SSLOptions_initializer { {'M', 'Q', 'T', 'S'}, 3, NULL, NULL, NULL, NULL, NULL, 1, MQTT_SSL_VERSION_DEFAULT, 0, NULL, NULL, NULL } 875 #define MQTTClient_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 6, 60, 1, 1, NULL, NULL, NULL, 30, 0, NULL, 0, NULL, MQTTVERSION_DEFAULT, {NULL, 0, 0}, {0, NULL}, -1, 0} 877 #define MQTTClient_connectOptions_initializer5 { {'M', 'Q', 'T', 'C'}, 6, 60, 0, 1, NULL, NULL, NULL, 30, 0, NULL, 0, NULL, MQTTVERSION_5, {NULL, 0, 0}, {0, NULL}, -1, 1} 931 #define MQTTResponse_initializer {1, MQTTREASONCODE_SUCCESS, 0, NULL, NULL} 1172 unsigned long timeout);
int MQTTVersion
Definition: MQTTClient.h:538
Definition: MQTTClient.h:1210
void MQTTClient_free(void *ptr)
int MQTTVersion
Definition: MQTTClient.h:847
int MQTTClient_getPendingDeliveryTokens(MQTTClient handle, MQTTClient_deliveryToken **tokens)
void * MQTTClient
Definition: MQTTClient.h:246
int MQTTClient_publish(MQTTClient handle, const char *topicName, int payloadlen, const void *payload, int qos, int retained, MQTTClient_deliveryToken *dt)
int struct_version
Definition: MQTTClient.h:532
const char * MQTTClient_strerror(int code)
void MQTTClient_yield(void)
const char * message
Definition: MQTTClient.h:613
int struct_version
Definition: MQTTClient.h:747
const char * username
Definition: MQTTClient.h:801
void MQTTClient_connectionLost(void *context, char *cause)
Definition: MQTTClient.h:394
int dup
Definition: MQTTClient.h:316
int MQTTClient_unsubscribe(MQTTClient handle, const char *topic)
const char * enabledCipherSuites
Definition: MQTTClient.h:680
int MQTTClient_subscribeMany(MQTTClient handle, int count, char *const *topic, int *qos)
int struct_version
Definition: MQTTClient.h:272
int qos
Definition: MQTTClient.h:290
const char * password
Definition: MQTTClient.h:807
const char * serverURI
Definition: MQTTClient.h:853
Definition: MQTTClient.h:1212
int msgid
Definition: MQTTClient.h:320
MQTTProperties * properties
Definition: MQTTClient.h:928
int retained
Definition: MQTTClient.h:617
const void * data
Definition: MQTTClient.h:627
int retryInterval
Definition: MQTTClient.h:819
int maxInflightMessages
Definition: MQTTClient.h:868
int reliable
Definition: MQTTClient.h:789
Definition: MQTTClient.h:266
int MQTTClient_receive(MQTTClient handle, char **topicName, int *topicLen, MQTTClient_message **message, unsigned long timeout)
MQTTProperties properties
Definition: MQTTClient.h:324
int cleanstart
Definition: MQTTClient.h:872
MQTTResponse MQTTClient_unsubscribeMany5(MQTTClient handle, int count, char *const *topic, MQTTProperties *props)
void MQTTClient_global_init(MQTTClient_init_options *inits)
int keepAliveInterval
Definition: MQTTClient.h:757
int payloadlen
Definition: MQTTClient.h:274
int verify
Definition: MQTTClient.h:696
const char * topicName
Definition: MQTTClient.h:611
int MQTTClient_connect(MQTTClient handle, MQTTClient_connectOptions *options)
int connectTimeout
Definition: MQTTClient.h:811
Definition: MQTTSubscribeOpts.h:21
Definition: MQTTClient.h:224
int struct_version
Definition: MQTTClient.h:655
int MQTTClient_disconnect(MQTTClient handle, int timeout)
void MQTTClient_traceCallback(enum MQTTCLIENT_TRACE_LEVELS level, char *message)
Definition: MQTTClient.h:1234
int MQTTClient_disconnect5(MQTTClient handle, int timeout, enum MQTTReasonCodes reason, MQTTProperties *props)
Definition: MQTTClient.h:1209
void MQTTClient_setTraceCallback(MQTTClient_traceCallback *callback)
int MQTTClient_publishMessage(MQTTClient handle, const char *topicName, MQTTClient_message *msg, MQTTClient_deliveryToken *dt)
#define DLLExport
Definition: MQTTProperties.h:58
MQTTResponse MQTTClient_subscribe5(MQTTClient handle, const char *topic, int qos, MQTTSubscribe_options *opts, MQTTProperties *props)
const void * data
Definition: MQTTClient.h:863
MQTTResponse MQTTClient_connect5(MQTTClient handle, MQTTClient_connectOptions *options, MQTTProperties *connectProperties, MQTTProperties *willProperties)
int MQTTClient_setPublished(MQTTClient handle, void *context, MQTTClient_published *co)
Definition: MQTTClient.h:650
enum MQTTReasonCodes * reasonCodes
Definition: MQTTClient.h:927
Definition: MQTTClient.h:922
int struct_version
Definition: MQTTClient.h:229
int qos
Definition: MQTTClient.h:622
Definition: MQTTClient.h:1214
int sslVersion
Definition: MQTTClient.h:689
int len
Definition: MQTTClient.h:862
Definition: MQTTClient.h:602
void * ssl_error_context
Definition: MQTTClient.h:715
int version
Definition: MQTTClient.h:924
int reasonCodeCount
Definition: MQTTClient.h:926
const char * trustStore
Definition: MQTTClient.h:658
Definition: MQTTClient.h:1211
int MQTTClient_unsubscribeMany(MQTTClient handle, int count, char *const *topic)
int sessionPresent
Definition: MQTTClient.h:855
enum MQTTReasonCodes reasonCode
Definition: MQTTClient.h:925
int MQTTClient_setCallbacks(MQTTClient handle, void *context, MQTTClient_connectionLost *cl, MQTTClient_messageArrived *ma, MQTTClient_deliveryComplete *dc)
Definition: MQTTClient.h:735
void MQTTClient_destroy(MQTTClient *handle)
int MQTTClient_createWithOptions(MQTTClient *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context, MQTTClient_createOptions *options)
int MQTTClient_subscribe(MQTTClient handle, const char *topic, int qos)
MQTTResponse MQTTClient_unsubscribe5(MQTTClient handle, const char *topic, MQTTProperties *props)
MQTTResponse MQTTClient_subscribeMany5(MQTTClient handle, int count, char *const *topic, int *qos, MQTTSubscribe_options *opts, MQTTProperties *props)
const char * name
Definition: MQTTClient.h:888
MQTTClient_willOptions * will
Definition: MQTTClient.h:795
void MQTTClient_deliveryComplete(void *context, MQTTClient_deliveryToken dt)
Definition: MQTTClient.h:377
const char * privateKeyPassword
Definition: MQTTClient.h:670
int MQTTClient_deliveryToken
Definition: MQTTClient.h:257
char *const * serverURIs
Definition: MQTTClient.h:839
int MQTTClient_waitForCompletion(MQTTClient handle, MQTTClient_deliveryToken dt, unsigned long timeout)
const char * privateKey
Definition: MQTTClient.h:668
void MQTTClient_setTraceLevel(enum MQTTCLIENT_TRACE_LEVELS level)
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
Definition: MQTTClient.h:824
Definition: MQTTProperties.h:118
Definition: MQTTClient.h:1208
MQTTReasonCodes
Definition: MQTTReasonCodes.h:21
int MQTTClient_isConnected(MQTTClient handle)
int MQTTClient_token
Definition: MQTTClient.h:258
int MQTTClient_setDisconnected(MQTTClient handle, void *context, MQTTClient_disconnected *co)
int serverURIcount
Definition: MQTTClient.h:828
Definition: MQTTClient.h:1213
int MQTTClient_create(MQTTClient *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
const char * keyStore
Definition: MQTTClient.h:663
void MQTTResponse_free(MQTTResponse response)
MQTTResponse MQTTClient_publishMessage5(MQTTClient handle, const char *topicName, MQTTClient_message *msg, MQTTClient_deliveryToken *dt)
int retained
Definition: MQTTClient.h:309
int enableServerCertAuth
Definition: MQTTClient.h:683
int len
Definition: MQTTClient.h:626
void MQTTClient_disconnected(void *context, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
Definition: MQTTClient.h:436
struct MQTTResponse MQTTResponse
MQTTClient_nameValue * MQTTClient_getVersionInfo(void)
const char * value
Definition: MQTTClient.h:889
void MQTTClient_published(void *context, int dt, int packet_type, MQTTProperties *properties, enum MQTTReasonCodes reasonCode)
Definition: MQTTClient.h:477
int cleansession
Definition: MQTTClient.h:779
int do_openssl_init
Definition: MQTTClient.h:231
This structure represents a persistent data store, used to store outbound and inbound messages...
Definition: MQTTClient.h:527
int struct_version
Definition: MQTTClient.h:609
void * payload
Definition: MQTTClient.h:276
int MQTTClient_messageArrived(void *context, char *topicName, int topicLen, MQTTClient_message *message)
Definition: MQTTClient.h:355
void MQTTClient_freeMessage(MQTTClient_message **msg)
Definition: MQTTClient.h:886
const char * CApath
Definition: MQTTClient.h:703
MQTTCLIENT_TRACE_LEVELS
Definition: MQTTClient.h:1206