21#define CC_MQTT311_CLIENT_MAJOR_VERSION 1U
25#define CC_MQTT311_CLIENT_MINOR_VERSION 0U
29#define CC_MQTT311_CLIENT_PATCH_VERSION 4U
33#define CC_MQTT311_CLIENT_MAKE_VERSION(major_, minor_, patch_) \
34 ((static_cast<unsigned>(major_) << 24) | \
35 (static_cast<unsigned>(minor_) << 8) | \
36 (static_cast<unsigned>(patch_)))
40#define CC_MQTT311_CLIENT_VERSION CC_MQTT311_CLIENT_MAKE_VERSION(CC_MQTT311_CLIENT_MAJOR_VERSION, CC_MQTT311_CLIENT_MINOR_VERSION, CC_MQTT311_CLIENT_PATCH_VERSION)
133struct CC_Mqtt311Client;
142struct CC_Mqtt311Connect;
151struct CC_Mqtt311Disconnect;
160struct CC_Mqtt311Subscribe;
169struct CC_Mqtt311Unsubscribe;
178struct CC_Mqtt311Publish;
void(* CC_Mqtt311NextTickProgramCb)(void *data, unsigned duration)
Callback used to request time measurement.
Definition common.h:274
void(* CC_Mqtt311SendOutputDataCb)(void *data, const unsigned char *buf, unsigned bufLen)
Callback used to request to send data to the broker.
Definition common.h:298
void(* CC_Mqtt311MessageReceivedReportCb)(void *data, const CC_Mqtt311MessageInfo *info)
Callback used to report new message received of the broker.
Definition common.h:313
unsigned(* CC_Mqtt311CancelNextTickWaitCb)(void *data)
Callback used to request termination of existing time measurement.
Definition common.h:283
void(* CC_Mqtt311ErrorLogCb)(void *data, const char *msg)
Callback used to report discovered errors.
Definition common.h:320
struct CC_Mqtt311Client * CC_Mqtt311ClientHandle
Handle used to access client specific data structures.
Definition common.h:138
void(* CC_Mqtt311BrokerDisconnectReportCb)(void *data, CC_Mqtt311BrokerDisconnectReason reason)
Callback used to report unsolicited disconnection of the broker.
Definition common.h:305
CC_Mqtt311ConnectReturnCode
"Connect Return Code" as defined in MQTT v3.1.1 specification
Definition common.h:111
void(* CC_Mqtt311ConnectCompleteCb)(void *data, CC_Mqtt311AsyncOpStatus status, const CC_Mqtt311ConnectResponse *response)
Callback used to report completion of the "connect" operation.
Definition common.h:330
struct CC_Mqtt311Connect * CC_Mqtt311ConnectHandle
Handle for "connect" operation.
Definition common.h:147
@ CC_Mqtt311ConnectReturnCode_ServerUnavailable
value Server is Unavailable.
Definition common.h:115
@ CC_Mqtt311ConnectReturnCode_NotAuthorized
value No Subscription Existed.
Definition common.h:117
@ CC_Mqtt311ConnectReturnCode_ValuesLimit
Upper limit of the values.
Definition common.h:118
@ CC_Mqtt311ConnectReturnCode_IdRejected
value Client ID is rejected.
Definition common.h:114
@ CC_Mqtt311ConnectReturnCode_Accepted
value Connection Accepted.
Definition common.h:112
@ CC_Mqtt311ConnectReturnCode_BadAuth
value Bad authentication details.
Definition common.h:116
@ CC_Mqtt311ConnectReturnCode_InvalidProtocolVersion
value Invalid Protocol Version.
Definition common.h:113
struct CC_Mqtt311Disconnect * CC_Mqtt311DisconnectHandle
Handle for "disconnect" operation.
Definition common.h:156
CC_Mqtt311ErrorCode
Error code returned by various API functions.
Definition common.h:55
CC_Mqtt311BrokerDisconnectReason
Reason for reporting unsolicited broker disconnection.
Definition common.h:101
CC_Mqtt311QoS
Quality of Service.
Definition common.h:45
CC_Mqtt311AsyncOpStatus
Status of the asynchronous operation.
Definition common.h:77
@ CC_Mqtt311ErrorCode_RetryLater
Retry in next event loop iteration.
Definition common.h:67
@ CC_Mqtt311ErrorCode_BadParam
Bad parameter is passed to the function.
Definition common.h:62
@ CC_Mqtt311ErrorCode_AlreadyConnected
The client library is already connected to the broker, cannot perform connection operation.
Definition common.h:61
@ CC_Mqtt311ErrorCode_Success
The requested function executed successfully.
Definition common.h:56
@ CC_Mqtt311ErrorCode_Busy
The client library is in the middle of previous operation(s), cannot start a new one.
Definition common.h:59
@ CC_Mqtt311ErrorCode_ValuesLimit
Limit for the values.
Definition common.h:71
@ CC_Mqtt311ErrorCode_BufferOverflow
Output buffer is too short.
Definition common.h:65
@ CC_Mqtt311ErrorCode_PreparationLocked
Another operation is being prepared, cannot create a new one without performing "send" or "cancel".
Definition common.h:70
@ CC_Mqtt311ErrorCode_NetworkDisconnected
When network is disconnected issueing new ops is not accepted.
Definition common.h:69
@ CC_Mqtt311ErrorCode_NotIntitialized
The allocated client hasn't been initialized.
Definition common.h:58
@ CC_Mqtt311ErrorCode_InternalError
Internal library error, please submit bug report
Definition common.h:57
@ CC_Mqtt311ErrorCode_Disconnecting
The client is in "disconnecting" state, (re)connect is required in the next iteration loop.
Definition common.h:68
@ CC_Mqtt311ErrorCode_NotConnected
The client library is not connected to the broker. Returned by operations that require connection to ...
Definition common.h:60
@ CC_Mqtt311ErrorCode_OutOfMemory
Memory allocation failed.
Definition common.h:64
@ CC_Mqtt311ErrorCode_InsufficientConfig
The required configuration hasn't been performed.
Definition common.h:63
@ CC_Mqtt311ErrorCode_NotSupported
Feature is not supported.
Definition common.h:66
@ CC_Mqtt311BrokerDisconnectReason_InternalError
The library encountered internal error and there is a need to close network connection.
Definition common.h:103
@ CC_Mqtt311BrokerDisconnectReason_NoBrokerResponse
No messages from the broker and no response to PINGREQ.
Definition common.h:102
@ CC_Mqtt311BrokerDisconnectReason_ProtocolError
Protocol error was detected.
Definition common.h:104
@ CC_Mqtt311BrokerDisconnectReason_ValuesLimit
Limit for the values.
Definition common.h:105
@ CC_Mqtt311QoS_ExactlyOnceDelivery
QoS=2. Exactly once delivery.
Definition common.h:48
@ CC_Mqtt311QoS_AtMostOnceDelivery
QoS=0. At most once delivery.
Definition common.h:46
@ CC_Mqtt311QoS_ValuesLimit
Limit for the values.
Definition common.h:49
@ CC_Mqtt311QoS_AtLeastOnceDelivery
QoS=1. At least once delivery.
Definition common.h:47
@ CC_Mqtt311AsyncOpStatus_BrokerDisconnected
The operation has been aborted before completion due to broker's disconnection.
Definition common.h:83
@ CC_Mqtt311AsyncOpStatus_OutOfMemory
The client library wasn't able to allocate necessary memory.
Definition common.h:84
@ CC_Mqtt311AsyncOpStatus_Complete
The requested operation has been completed, refer to reported extra details for information.
Definition common.h:78
@ CC_Mqtt311AsyncOpStatus_Aborted
The operation has been aborted before completion due to client's side operation.
Definition common.h:82
@ CC_Mqtt311AsyncOpStatus_ProtocolError
The broker's response doesn't comply with MQTT311 specification.
Definition common.h:81
@ CC_Mqtt311AsyncOpStatus_Timeout
The required response from broker hasn't been received in time.
Definition common.h:80
@ CC_Mqtt311AsyncOpStatus_InternalError
Internal library error, please submit bug report
Definition common.h:79
@ CC_Mqtt311AsyncOpStatus_BadParam
Bad value has been returned from the relevant callback.
Definition common.h:85
@ CC_Mqtt311AsyncOpStatus_ValuesLimit
Limit for the values.
Definition common.h:86
struct CC_Mqtt311Publish * CC_Mqtt311PublishHandle
Handle for "publish" operation.
Definition common.h:183
void(* CC_Mqtt311PublishCompleteCb)(void *data, CC_Mqtt311PublishHandle handle, CC_Mqtt311AsyncOpStatus status)
Callback used to report completion of the "publish" operation.
Definition common.h:366
CC_Mqtt311PublishOrdering
Publish ordering configuration.
Definition common.h:92
@ CC_Mqtt311PublishOrdering_ValuesLimit
Limit for the values.
Definition common.h:95
@ CC_Mqtt311PublishOrdering_Full
Preserve strict order between all messages.
Definition common.h:94
@ CC_Mqtt311PublishOrdering_SameQos
Preserve strict order only between same QoS messages.
Definition common.h:93
CC_Mqtt311SubscribeReturnCode
"Subscribe Return Code" as defined in MQTT v3.1.1 specification
Definition common.h:124
void(* CC_Mqtt311SubscribeCompleteCb)(void *data, CC_Mqtt311SubscribeHandle handle, CC_Mqtt311AsyncOpStatus status, const CC_Mqtt311SubscribeResponse *response)
Callback used to report completion of the "subscribe" operation.
Definition common.h:344
struct CC_Mqtt311Subscribe * CC_Mqtt311SubscribeHandle
Handle for "subscribe" operation.
Definition common.h:165
@ CC_Mqtt311SubscribeReturnCode_Failure
value Failure.
Definition common.h:128
@ CC_Mqtt311SubscribeReturnCode_SuccessQos1
value Maximum QoS 1.
Definition common.h:126
@ CC_Mqtt311SubscribeReturnCode_SuccessQos0
value Maximum QoS 0.
Definition common.h:125
@ CC_Mqtt311SubscribeReturnCode_SuccessQos2
value Maximum QoS 2.
Definition common.h:127
struct CC_Mqtt311Unsubscribe * CC_Mqtt311UnsubscribeHandle
Handle for "unsubscribe" operation.
Definition common.h:174
void(* CC_Mqtt311UnsubscribeCompleteCb)(void *data, CC_Mqtt311UnsubscribeHandle handle, CC_Mqtt311AsyncOpStatus status)
Callback used to report completion of the "unsubscribe" operation.
Definition common.h:355
Configuration structure to be passed to the cc_mqtt311_client_connect_config().
Definition common.h:189
unsigned m_passwordLen
Number of password bytes. When 0 means no password value. Defaults to 0.
Definition common.h:193
bool m_cleanSession
Clean session flag, defaults to false.
Definition common.h:195
unsigned m_keepAlive
Keep alive seconds configuration, defaults to 60.
Definition common.h:194
const char * m_username
Zero terminated Username string, can be NULL. When NULL means no username value. Defaults to NULL.
Definition common.h:191
const unsigned char * m_password
Pointer to password buffer, can be NULL, defaults to NULL.
Definition common.h:192
const char * m_clientId
Zero terminated Client ID string, can be NULL. When NULL means empty "Client ID". Defaults to NULL.
Definition common.h:190
Response information from broker to "connect" request.
Definition common.h:213
CC_Mqtt311ConnectReturnCode m_returnCode
"Connection Return Code" reported by the broker
Definition common.h:214
bool m_sessionPresent
"Session Present" indication.
Definition common.h:215
Configuration structure to be passed to the cc_mqtt311_client_connect_config_will().
Definition common.h:202
bool m_retain
"Retain" flag, defaults to false.
Definition common.h:207
const unsigned char * m_data
Will message data, can be NULL. Defaults to NULL.
Definition common.h:204
unsigned m_dataLen
Number of will data bytes. When 0 means no data. Defaults to 0.
Definition common.h:205
CC_Mqtt311QoS m_qos
QoS value of the will message, defaults to CC_Mqtt311QoS_AtMostOnceDelivery.
Definition common.h:206
const char * m_topic
Will topic string, must NOT be NULL or empty. Defaults to NULL.
Definition common.h:203
Received message information.
Definition common.h:246
const char * m_topic
Topic used to publish the message.
Definition common.h:247
unsigned m_dataLen
Amount of data bytes.
Definition common.h:249
bool m_retained
Indication of whether the received message was "retained".
Definition common.h:251
const unsigned char * m_data
Pointer to the temporary buffer containin message data.
Definition common.h:248
CC_Mqtt311QoS m_qos
QoS value used by the broker to report the message.
Definition common.h:250
Configuration structure to be passed to the cc_mqtt311_client_publish_config().
Definition common.h:258
unsigned m_dataLen
Amount of bytes in the publish data buffer, defaults to 0.
Definition common.h:261
const unsigned char * m_data
Pointer to publish data buffer, defaults to NULL.
Definition common.h:260
CC_Mqtt311QoS m_qos
Publish QoS value, defaults to CC_Mqtt311QoS_AtMostOnceDelivery.
Definition common.h:262
const char * m_topic
Publish topic, cannot be NULL.
Definition common.h:259
bool m_retain
"Retain" flag, defaults to false.
Definition common.h:263
Response information from broker to "subscribe" request.
Definition common.h:230
unsigned m_returnCodesCount
Amount of return codes in the array.
Definition common.h:232
const CC_Mqtt311SubscribeReturnCode * m_returnCodes
Pointer to array contianing per-topic subscription return codes.
Definition common.h:231
Topic filter configuration structure of the "subscribe" operation.
Definition common.h:222
CC_Mqtt311QoS m_maxQos
"Maximum QoS" value, defaults to CC_Mqtt311QoS_ExactlyOnceDelivery.
Definition common.h:224
const char * m_topic
"Topic Filter" string, mustn't be NULL
Definition common.h:223
Topic filter configuration structure of the "unsubscribe" operation.
Definition common.h:239
const char * m_topic
"Topic Filter" string, mustn't be NULL
Definition common.h:240