23#define CC_MQTT311_CLIENT_MAJOR_VERSION 1U
27#define CC_MQTT311_CLIENT_MINOR_VERSION 0U
31#define CC_MQTT311_CLIENT_PATCH_VERSION 8U
35#define CC_MQTT311_CLIENT_MAKE_VERSION(major_, minor_, patch_) \
36 ((static_cast<unsigned>(major_) << 24) | \
37 (static_cast<unsigned>(minor_) << 8) | \
38 (static_cast<unsigned>(patch_)))
42#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)
135struct CC_Mqtt311Client;
144struct CC_Mqtt311Connect;
153struct CC_Mqtt311Disconnect;
162struct CC_Mqtt311Subscribe;
171struct CC_Mqtt311Unsubscribe;
180struct CC_Mqtt311Publish;
void(* CC_Mqtt311NextTickProgramCb)(void *data, unsigned duration)
Callback used to request time measurement.
Definition common.h:276
void(* CC_Mqtt311SendOutputDataCb)(void *data, const unsigned char *buf, unsigned bufLen)
Callback used to request to send data to the broker.
Definition common.h:300
void(* CC_Mqtt311MessageReceivedReportCb)(void *data, const CC_Mqtt311MessageInfo *info)
Callback used to report new message received of the broker.
Definition common.h:315
unsigned(* CC_Mqtt311CancelNextTickWaitCb)(void *data)
Callback used to request termination of existing time measurement.
Definition common.h:285
void(* CC_Mqtt311ErrorLogCb)(void *data, const char *msg)
Callback used to report discovered errors.
Definition common.h:322
struct CC_Mqtt311Client * CC_Mqtt311ClientHandle
Handle used to access client specific data structures.
Definition common.h:140
void(* CC_Mqtt311BrokerDisconnectReportCb)(void *data, CC_Mqtt311BrokerDisconnectReason reason)
Callback used to report unsolicited disconnection of the broker.
Definition common.h:307
CC_Mqtt311ConnectReturnCode
"Connect Return Code" as defined in MQTT v3.1.1 specification
Definition common.h:113
void(* CC_Mqtt311ConnectCompleteCb)(void *data, CC_Mqtt311AsyncOpStatus status, const CC_Mqtt311ConnectResponse *response)
Callback used to report completion of the "connect" operation.
Definition common.h:332
struct CC_Mqtt311Connect * CC_Mqtt311ConnectHandle
Handle for "connect" operation.
Definition common.h:149
@ CC_Mqtt311ConnectReturnCode_ServerUnavailable
value Server is Unavailable.
Definition common.h:117
@ CC_Mqtt311ConnectReturnCode_NotAuthorized
value No Subscription Existed.
Definition common.h:119
@ CC_Mqtt311ConnectReturnCode_ValuesLimit
Upper limit of the values.
Definition common.h:120
@ CC_Mqtt311ConnectReturnCode_IdRejected
value Client ID is rejected.
Definition common.h:116
@ CC_Mqtt311ConnectReturnCode_Accepted
value Connection Accepted.
Definition common.h:114
@ CC_Mqtt311ConnectReturnCode_BadAuth
value Bad authentication details.
Definition common.h:118
@ CC_Mqtt311ConnectReturnCode_InvalidProtocolVersion
value Invalid Protocol Version.
Definition common.h:115
struct CC_Mqtt311Disconnect * CC_Mqtt311DisconnectHandle
Handle for "disconnect" operation.
Definition common.h:158
CC_Mqtt311ErrorCode
Error code returned by various API functions.
Definition common.h:57
CC_Mqtt311BrokerDisconnectReason
Reason for reporting unsolicited broker disconnection.
Definition common.h:103
CC_Mqtt311QoS
Quality of Service.
Definition common.h:47
CC_Mqtt311AsyncOpStatus
Status of the asynchronous operation.
Definition common.h:79
@ CC_Mqtt311ErrorCode_RetryLater
Retry in next event loop iteration.
Definition common.h:69
@ CC_Mqtt311ErrorCode_BadParam
Bad parameter is passed to the function.
Definition common.h:64
@ CC_Mqtt311ErrorCode_AlreadyConnected
The client library is already connected to the broker, cannot perform connection operation.
Definition common.h:63
@ CC_Mqtt311ErrorCode_Success
The requested function executed successfully.
Definition common.h:58
@ CC_Mqtt311ErrorCode_Busy
The client library is in the middle of previous operation(s), cannot start a new one.
Definition common.h:61
@ CC_Mqtt311ErrorCode_ValuesLimit
Limit for the values.
Definition common.h:73
@ CC_Mqtt311ErrorCode_BufferOverflow
Output buffer is too short.
Definition common.h:67
@ CC_Mqtt311ErrorCode_PreparationLocked
Another operation is being prepared, cannot create a new one without performing "send" or "cancel".
Definition common.h:72
@ CC_Mqtt311ErrorCode_NetworkDisconnected
When network is disconnected issueing new ops is not accepted.
Definition common.h:71
@ CC_Mqtt311ErrorCode_NotIntitialized
The allocated client hasn't been initialized.
Definition common.h:60
@ CC_Mqtt311ErrorCode_InternalError
Internal library error, please submit bug report.
Definition common.h:59
@ CC_Mqtt311ErrorCode_Disconnecting
The client is in "disconnecting" state, (re)connect is required in the next iteration loop.
Definition common.h:70
@ CC_Mqtt311ErrorCode_NotConnected
The client library is not connected to the broker. Returned by operations that require connection to ...
Definition common.h:62
@ CC_Mqtt311ErrorCode_OutOfMemory
Memory allocation failed.
Definition common.h:66
@ CC_Mqtt311ErrorCode_InsufficientConfig
The required configuration hasn't been performed.
Definition common.h:65
@ CC_Mqtt311ErrorCode_NotSupported
Feature is not supported.
Definition common.h:68
@ CC_Mqtt311BrokerDisconnectReason_InternalError
The library encountered internal error and there is a need to close network connection.
Definition common.h:105
@ CC_Mqtt311BrokerDisconnectReason_NoBrokerResponse
No messages from the broker and no response to PINGREQ.
Definition common.h:104
@ CC_Mqtt311BrokerDisconnectReason_ProtocolError
Protocol error was detected.
Definition common.h:106
@ CC_Mqtt311BrokerDisconnectReason_ValuesLimit
Limit for the values.
Definition common.h:107
@ CC_Mqtt311QoS_ExactlyOnceDelivery
QoS=2. Exactly once delivery.
Definition common.h:50
@ CC_Mqtt311QoS_AtMostOnceDelivery
QoS=0. At most once delivery.
Definition common.h:48
@ CC_Mqtt311QoS_ValuesLimit
Limit for the values.
Definition common.h:51
@ CC_Mqtt311QoS_AtLeastOnceDelivery
QoS=1. At least once delivery.
Definition common.h:49
@ CC_Mqtt311AsyncOpStatus_BrokerDisconnected
The operation has been aborted before completion due to broker's disconnection.
Definition common.h:85
@ CC_Mqtt311AsyncOpStatus_OutOfMemory
The client library wasn't able to allocate necessary memory.
Definition common.h:86
@ CC_Mqtt311AsyncOpStatus_Complete
The requested operation has been completed, refer to reported extra details for information.
Definition common.h:80
@ CC_Mqtt311AsyncOpStatus_Aborted
The operation has been aborted before completion due to client's side operation.
Definition common.h:84
@ CC_Mqtt311AsyncOpStatus_ProtocolError
The broker's response doesn't comply with MQTT311 specification.
Definition common.h:83
@ CC_Mqtt311AsyncOpStatus_Timeout
The required response from broker hasn't been received in time.
Definition common.h:82
@ CC_Mqtt311AsyncOpStatus_InternalError
Internal library error, please submit bug report.
Definition common.h:81
@ CC_Mqtt311AsyncOpStatus_BadParam
Bad value has been returned from the relevant callback.
Definition common.h:87
@ CC_Mqtt311AsyncOpStatus_ValuesLimit
Limit for the values.
Definition common.h:88
struct CC_Mqtt311Publish * CC_Mqtt311PublishHandle
Handle for "publish" operation.
Definition common.h:185
void(* CC_Mqtt311PublishCompleteCb)(void *data, CC_Mqtt311PublishHandle handle, CC_Mqtt311AsyncOpStatus status)
Callback used to report completion of the "publish" operation.
Definition common.h:368
CC_Mqtt311PublishOrdering
Publish ordering configuration.
Definition common.h:94
@ CC_Mqtt311PublishOrdering_ValuesLimit
Limit for the values.
Definition common.h:97
@ CC_Mqtt311PublishOrdering_Full
Preserve strict order between all messages.
Definition common.h:96
@ CC_Mqtt311PublishOrdering_SameQos
Preserve strict order only between same QoS messages.
Definition common.h:95
CC_Mqtt311SubscribeReturnCode
"Subscribe Return Code" as defined in MQTT v3.1.1 specification
Definition common.h:126
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:346
struct CC_Mqtt311Subscribe * CC_Mqtt311SubscribeHandle
Handle for "subscribe" operation.
Definition common.h:167
@ CC_Mqtt311SubscribeReturnCode_Failure
value Failure.
Definition common.h:130
@ CC_Mqtt311SubscribeReturnCode_SuccessQos1
value Maximum QoS 1.
Definition common.h:128
@ CC_Mqtt311SubscribeReturnCode_SuccessQos0
value Maximum QoS 0.
Definition common.h:127
@ CC_Mqtt311SubscribeReturnCode_SuccessQos2
value Maximum QoS 2.
Definition common.h:129
struct CC_Mqtt311Unsubscribe * CC_Mqtt311UnsubscribeHandle
Handle for "unsubscribe" operation.
Definition common.h:176
void(* CC_Mqtt311UnsubscribeCompleteCb)(void *data, CC_Mqtt311UnsubscribeHandle handle, CC_Mqtt311AsyncOpStatus status)
Callback used to report completion of the "unsubscribe" operation.
Definition common.h:357
Configuration structure to be passed to the cc_mqtt311_client_connect_config().
Definition common.h:191
unsigned m_passwordLen
Number of password bytes. When 0 means no password value. Defaults to 0.
Definition common.h:195
bool m_cleanSession
Clean session flag, defaults to false.
Definition common.h:197
unsigned m_keepAlive
Keep alive seconds configuration, defaults to 60.
Definition common.h:196
const char * m_username
Zero terminated Username string, can be NULL. When NULL means no username value. Defaults to NULL.
Definition common.h:193
const unsigned char * m_password
Pointer to password buffer, can be NULL, defaults to NULL.
Definition common.h:194
const char * m_clientId
Zero terminated Client ID string, can be NULL. When NULL means empty "Client ID". Defaults to NULL.
Definition common.h:192
Response information from broker to "connect" request.
Definition common.h:215
CC_Mqtt311ConnectReturnCode m_returnCode
"Connection Return Code" reported by the broker
Definition common.h:216
bool m_sessionPresent
"Session Present" indication.
Definition common.h:217
Configuration structure to be passed to the cc_mqtt311_client_connect_config_will().
Definition common.h:204
bool m_retain
"Retain" flag, defaults to false.
Definition common.h:209
const unsigned char * m_data
Will message data, can be NULL. Defaults to NULL.
Definition common.h:206
unsigned m_dataLen
Number of will data bytes. When 0 means no data. Defaults to 0.
Definition common.h:207
CC_Mqtt311QoS m_qos
QoS value of the will message, defaults to CC_Mqtt311QoS_AtMostOnceDelivery.
Definition common.h:208
const char * m_topic
Will topic string, must NOT be NULL or empty. Defaults to NULL.
Definition common.h:205
Received message information.
Definition common.h:248
const char * m_topic
Topic used to publish the message.
Definition common.h:249
unsigned m_dataLen
Amount of data bytes.
Definition common.h:251
bool m_retained
Indication of whether the received message was "retained".
Definition common.h:253
const unsigned char * m_data
Pointer to the temporary buffer containin message data.
Definition common.h:250
CC_Mqtt311QoS m_qos
QoS value used by the broker to report the message.
Definition common.h:252
Configuration structure to be passed to the cc_mqtt311_client_publish_config().
Definition common.h:260
unsigned m_dataLen
Amount of bytes in the publish data buffer, defaults to 0.
Definition common.h:263
const unsigned char * m_data
Pointer to publish data buffer, defaults to NULL.
Definition common.h:262
CC_Mqtt311QoS m_qos
Publish QoS value, defaults to CC_Mqtt311QoS_AtMostOnceDelivery.
Definition common.h:264
const char * m_topic
Publish topic, cannot be NULL.
Definition common.h:261
bool m_retain
"Retain" flag, defaults to false.
Definition common.h:265
Response information from broker to "subscribe" request.
Definition common.h:232
unsigned m_returnCodesCount
Amount of return codes in the array.
Definition common.h:234
const CC_Mqtt311SubscribeReturnCode * m_returnCodes
Pointer to array contianing per-topic subscription return codes.
Definition common.h:233
Topic filter configuration structure of the "subscribe" operation.
Definition common.h:224
CC_Mqtt311QoS m_maxQos
"Maximum QoS" value, defaults to CC_Mqtt311QoS_ExactlyOnceDelivery.
Definition common.h:226
const char * m_topic
"Topic Filter" string, mustn't be NULL
Definition common.h:225
Topic filter configuration structure of the "unsubscribe" operation.
Definition common.h:241
const char * m_topic
"Topic Filter" string, mustn't be NULL
Definition common.h:242