CommsChampion Ecosystem MQTT v5 Client
MQTT v5 Client Library.
common.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 - 2024 (C). Alex Robenko. All rights reserved.
3 //
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 
10 
11 #pragma once
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #else // #ifdef __cplusplus
16 #include <stdbool.h>
17 #endif // #ifdef __cplusplus
18 
21 #define CC_MQTT5_CLIENT_MAJOR_VERSION 1U
22 
25 #define CC_MQTT5_CLIENT_MINOR_VERSION 0U
26 
29 #define CC_MQTT5_CLIENT_PATCH_VERSION 0U
30 
33 #define CC_MQTT5_CLIENT_MAKE_VERSION(major_, minor_, patch_) \
34  ((static_cast<unsigned>(major_) << 24) | \
35  (static_cast<unsigned>(minor_) << 8) | \
36  (static_cast<unsigned>(patch_)))
37 
40 #define CC_MQTT5_CLIENT_VERSION CC_MQTT5_CLIENT_MAKE_VERSION(CC_MQTT5_CLIENT_MAJOR_VERSION, CC_MQTT5_CLIENT_MINOR_VERSION, CC_MQTT5_CLIENT_PATCH_VERSION)
41 
46 #define CC_MQTT5_SESSION_NEVER_EXPIRES 0xffffffff
47 
51 #define CC_MQTT5_MAX_TOPIC_ALIASES_LIMIT 0xffff
52 
55 typedef enum
56 {
62 
65 typedef enum
66 {
85 
88 typedef enum
89 {
94 
97 typedef enum
98 {
109 
112 typedef enum
113 {
118 
121 typedef enum
122 {
169 
173 typedef enum
174 {
180 
183 typedef enum
184 {
191 
194 typedef enum
195 {
200 
203 typedef enum
204 {
211 
214 struct CC_Mqtt5Client;
215 
219 typedef struct CC_Mqtt5Client* CC_Mqtt5ClientHandle;
220 
223 struct CC_Mqtt5Connect;
224 
228 typedef struct CC_Mqtt5Connect* CC_Mqtt5ConnectHandle;
229 
232 struct CC_Mqtt5Disconnect;
233 
237 typedef struct CC_Mqtt5Disconnect* CC_Mqtt5DisconnectHandle;
238 
241 struct CC_Mqtt5Subscribe;
242 
246 typedef struct CC_Mqtt5Subscribe* CC_Mqtt5SubscribeHandle;
247 
250 struct CC_Mqtt5Unsubscribe;
251 
255 typedef struct CC_Mqtt5Unsubscribe* CC_Mqtt5UnsubscribeHandle;
256 
259 struct CC_Mqtt5Publish;
260 
264 typedef struct CC_Mqtt5Publish* CC_Mqtt5PublishHandle;
265 
268 struct CC_Mqtt5Reauth;
269 
273 typedef struct CC_Mqtt5Reauth* CC_Mqtt5ReauthHandle;
274 
278 typedef struct
279 {
280  const char* m_key;
281  const char* m_value;
283 
287 typedef struct
288 {
289  const char* m_clientId;
290  const char* m_username;
291  const unsigned char* m_password;
292  unsigned m_passwordLen;
293  unsigned m_keepAlive;
296 
300 typedef struct
301 {
302  const char* m_topic;
303  const unsigned char* m_data;
304  unsigned m_dataLen;
305  const char* m_contentType;
306  const char* m_responseTopic;
307  const unsigned char* m_correlationData;
309  unsigned m_delayInterval;
313  bool m_retain;
315 
319 typedef struct
320 {
322  unsigned m_receiveMaximum;
324  unsigned m_maxPacketSize;
329 
332 typedef struct
333 {
335  const char* m_assignedClientId;
336  const char* m_responseInfo;
337  const char* m_reasonStr;
338  const char* m_serverRef;
339  const unsigned char* m_authData;
340  unsigned m_authDataLen;
342  unsigned m_userPropsCount;
345  unsigned m_maxPacketSize;
346  unsigned m_topicAliasMax;
354 
358 typedef struct
359 {
360  const unsigned char* m_authData;
361  unsigned m_authDataLen;
362  const char* m_reasonStr;
364  unsigned m_userPropsCount;
366 
369 typedef struct
370 {
372  const char* m_reasonStr;
373  const char* m_serverRef;
375  unsigned m_userPropsCount;
377 
381 typedef struct
382 {
384  const char* m_reasonStr;
387 
391 typedef struct
392 {
393  const char* m_topic;
396  bool m_noLocal;
399 
403 typedef struct
404 {
405  unsigned m_subId;
407 
410 typedef struct
411 {
414  const char* m_reasonStr;
416  unsigned m_userPropsCount;
418 
422 typedef struct
423 {
424  const char* m_topic;
426 
429 typedef struct
430 {
433  const char* m_reasonStr;
435  unsigned m_userPropsCount;
437 
440 typedef struct
441 {
442  const char* m_topic;
443  const unsigned char* m_data;
444  unsigned m_dataLen;
445  const char* m_responseTopic;
446  const unsigned char* m_correlationData;
449  unsigned m_userPropsCount;
450  const char* m_contentType;
451  const unsigned* m_subIds;
452  unsigned m_subIdsCount;
456  bool m_retained;
458 
462 typedef struct
463 {
464  const char* m_topic;
465  const unsigned char* m_data;
466  unsigned m_dataLen;
469  bool m_retain;
471 
475 typedef struct
476 {
477  const char* m_contentType;
478  const char* m_responseTopic;
479  const unsigned char* m_correlationData;
484 
487 typedef struct
488 {
490  const char* m_reasonStr;
492  unsigned m_userPropsCount;
494 
503 typedef void (*CC_Mqtt5NextTickProgramCb)(void* data, unsigned duration);
504 
512 typedef unsigned (*CC_Mqtt5CancelNextTickWaitCb)(void* data);
513 
527 typedef void (*CC_Mqtt5SendOutputDataCb)(void* data, const unsigned char* buf, unsigned bufLen);
528 
541 
548 typedef void (*CC_Mqtt5MessageReceivedReportCb)(void* data, const CC_Mqtt5MessageInfo* info);
549 
555 typedef void (*CC_Mqtt5ErrorLogCb)(void* data, const char* msg);
556 
565 typedef void (*CC_Mqtt5ConnectCompleteCb)(void* data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5ConnectResponse* response);
566 
571 typedef CC_Mqtt5AuthErrorCode (*CC_Mqtt5AuthCb)(void* data, const CC_Mqtt5AuthInfo* authInfoIn, CC_Mqtt5AuthInfo* authInfoOut);
572 
585 typedef void (*CC_Mqtt5SubscribeCompleteCb)(void* data, CC_Mqtt5SubscribeHandle handle, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5SubscribeResponse* response);
586 
600 
613 typedef void (*CC_Mqtt5PublishCompleteCb)(void* data, CC_Mqtt5PublishHandle handle, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5PublishResponse* response);
614 
623 typedef void (*CC_Mqtt5ReauthCompleteCb)(void* data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5AuthInfo* response);
624 
628 typedef struct
629 {
630  const char* m_authMethod;
631  const unsigned char* m_authData;
632  unsigned m_authDataLen;
634  void* m_authCbData;
635 
637 
638 #ifdef __cplusplus
639 }
640 #endif
CC_Mqtt5AuthErrorCode(* CC_Mqtt5AuthCb)(void *data, const CC_Mqtt5AuthInfo *authInfoIn, CC_Mqtt5AuthInfo *authInfoOut)
Callback used to report incoming authentication data.
Definition: common.h:571
void(* CC_Mqtt5MessageReceivedReportCb)(void *data, const CC_Mqtt5MessageInfo *info)
Callback used to report new message received of the broker.
Definition: common.h:548
void(* CC_Mqtt5NextTickProgramCb)(void *data, unsigned duration)
Callback used to request time measurement.
Definition: common.h:503
struct CC_Mqtt5Client * CC_Mqtt5ClientHandle
Handle used to access client specific data structures.
Definition: common.h:219
void(* CC_Mqtt5BrokerDisconnectReportCb)(void *data, CC_Mqtt5BrokerDisconnectReason reason, const CC_Mqtt5DisconnectInfo *info)
Callback used to report unsolicited disconnection of the broker.
Definition: common.h:540
void(* CC_Mqtt5SendOutputDataCb)(void *data, const unsigned char *buf, unsigned bufLen)
Callback used to request to send data to the broker.
Definition: common.h:527
unsigned(* CC_Mqtt5CancelNextTickWaitCb)(void *data)
Callback used to request termination of existing time measurement.
Definition: common.h:512
void(* CC_Mqtt5ErrorLogCb)(void *data, const char *msg)
Callback used to report discovered errors.
Definition: common.h:555
struct CC_Mqtt5Connect * CC_Mqtt5ConnectHandle
Handle for "connect" operation.
Definition: common.h:228
void(* CC_Mqtt5ConnectCompleteCb)(void *data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5ConnectResponse *response)
Callback used to report completion of the "connect" operation.
Definition: common.h:565
struct CC_Mqtt5Disconnect * CC_Mqtt5DisconnectHandle
Handle for "disconnect" operation.
Definition: common.h:237
CC_Mqtt5PayloadFormat
Payload Format Indicator values as defined by the MQTT v5 protocol.
Definition: common.h:89
CC_Mqtt5ReasonCode
"Reason Code" as defined in MQTT v5 specification
Definition: common.h:122
CC_Mqtt5AuthErrorCode
Error code returned by the CC_Mqtt5AuthCb callback.
Definition: common.h:113
CC_Mqtt5AsyncOpStatus
Status of the asynchronous operation.
Definition: common.h:98
CC_Mqtt5ErrorCode
Error code returned by various API functions.
Definition: common.h:66
CC_Mqtt5QoS
Quality of Service.
Definition: common.h:56
CC_Mqtt5BrokerDisconnectReason
Reason for reporting unsolicited broker disconnection.
Definition: common.h:204
@ CC_Mqtt5PayloadFormat_Unspecified
Unspecified format.
Definition: common.h:90
@ CC_Mqtt5PayloadFormat_Utf8
UTF-8 string.
Definition: common.h:91
@ CC_Mqtt5PayloadFormat_ValuesLimit
Limit of the values.
Definition: common.h:92
@ CC_Mqtt5ReasonCode_SessionTakenOver
value Session taken over.
Definition: common.h:147
@ CC_Mqtt5ReasonCode_NoMatchingSubscribers
value No Matching Subscribers.
Definition: common.h:129
@ CC_Mqtt5ReasonCode_GrantedQos2
value Granted QoS2.
Definition: common.h:127
@ CC_Mqtt5ReasonCode_ImplSpecificError
value Impl. Specific Error.
Definition: common.h:136
@ CC_Mqtt5ReasonCode_UnsupportedVersion
value Unsupported Version.
Definition: common.h:137
@ CC_Mqtt5ReasonCode_ServerMoved
value Server moved.
Definition: common.h:162
@ CC_Mqtt5ReasonCode_SubIdsNotSupported
value Sub IDs not supported.
Definition: common.h:166
@ CC_Mqtt5ReasonCode_ReAuth
value Re-authenticate.
Definition: common.h:132
@ CC_Mqtt5ReasonCode_NormalDisconnection
value Normal Disconnection.
Definition: common.h:124
@ CC_Mqtt5ReasonCode_QuotaExceeded
value Quota exceeded.
Definition: common.h:156
@ CC_Mqtt5ReasonCode_ServerBusy
value Server busy.
Definition: common.h:142
@ CC_Mqtt5ReasonCode_TopicNameInvalid
value Topic Name invalid.
Definition: common.h:149
@ CC_Mqtt5ReasonCode_PayloadFormatInvalid
value Payload format invalid.
Definition: common.h:158
@ CC_Mqtt5ReasonCode_NoSubscriptionExisted
value No Subscription Existed.
Definition: common.h:130
@ CC_Mqtt5ReasonCode_QosNotSupported
value QoS not supported.
Definition: common.h:160
@ CC_Mqtt5ReasonCode_MaxConnectTime
value Maximum connect time.
Definition: common.h:165
@ CC_Mqtt5ReasonCode_ConnectionRateExceeded
value Connection rate exceeded.
Definition: common.h:164
@ CC_Mqtt5ReasonCode_RetainNotSupported
value Retain not supported.
Definition: common.h:159
@ CC_Mqtt5ReasonCode_KeepAliveTimeout
value Keep Alive timeout.
Definition: common.h:146
@ CC_Mqtt5ReasonCode_ServerUnavailable
value Server unavailable.
Definition: common.h:141
@ CC_Mqtt5ReasonCode_ReceiveMaxExceeded
value Receive Max exceeded.
Definition: common.h:152
@ CC_Mqtt5ReasonCode_GrantedQos0
value Granted QoS0.
Definition: common.h:125
@ CC_Mqtt5ReasonCode_PacketTooLarge
value Packet too large.
Definition: common.h:154
@ CC_Mqtt5ReasonCode_UseAnotherServer
value Use another server.
Definition: common.h:161
@ CC_Mqtt5ReasonCode_TopicFilterInvalid
value Topic Filter invalid.
Definition: common.h:148
@ CC_Mqtt5ReasonCode_MalformedPacket
value Malformed Packet.
Definition: common.h:134
@ CC_Mqtt5ReasonCode_PacketIdInUse
value Packet ID in use.
Definition: common.h:150
@ CC_Mqtt5ReasonCode_Success
value Success.
Definition: common.h:123
@ CC_Mqtt5ReasonCode_NotAuthorized
value Not authorized.
Definition: common.h:140
@ CC_Mqtt5ReasonCode_SharedSubNotSuppored
value Shared Sub not supported.
Definition: common.h:163
@ CC_Mqtt5ReasonCode_ServerShuttingDown
value Server shutting down.
Definition: common.h:144
@ CC_Mqtt5ReasonCode_AdministrativeAction
value Administrative action.
Definition: common.h:157
@ CC_Mqtt5ReasonCode_BadAuthMethod
value Bad auth method.
Definition: common.h:145
@ CC_Mqtt5ReasonCode_Banned
value Banned.
Definition: common.h:143
@ CC_Mqtt5ReasonCode_PacketIdNotFound
value Packet ID not found.
Definition: common.h:151
@ CC_Mqtt5ReasonCode_GrantedQos1
value Granted QoS1.
Definition: common.h:126
@ CC_Mqtt5ReasonCode_DisconnectWithWill
value Disconnect w/ Will.
Definition: common.h:128
@ CC_Mqtt5ReasonCode_WildcardSubsNotSupported
value Wildcard Subs not supported.
Definition: common.h:167
@ CC_Mqtt5ReasonCode_BadUserPassword
value Bad Username/Password.
Definition: common.h:139
@ CC_Mqtt5ReasonCode_TopicAliasInvalid
value Topic Alias invalid.
Definition: common.h:153
@ CC_Mqtt5ReasonCode_MsgRateTooHigh
value Message rate too high.
Definition: common.h:155
@ CC_Mqtt5ReasonCode_ClientIdInvalid
value Client ID Invalid.
Definition: common.h:138
@ CC_Mqtt5ReasonCode_UnspecifiedError
value Unspecified error.
Definition: common.h:133
@ CC_Mqtt5ReasonCode_ContinueAuth
value Continue authentication.
Definition: common.h:131
@ CC_Mqtt5ReasonCode_ProtocolError
value Protocol Error.
Definition: common.h:135
@ CC_Mqtt5AuthErrorCode_Continue
Continue the authentication process.
Definition: common.h:114
@ CC_Mqtt5AuthErrorCode_Disconnect
Stop the authentication, send DISCONNECT to broker.
Definition: common.h:115
@ CC_Mqtt5AuthErrorCode_ValuesLimit
Limit for the values.
Definition: common.h:116
@ CC_Mqtt5AsyncOpStatus_ProtocolError
The broker's response doesn't comply with MQTT5 specification.
Definition: common.h:102
@ CC_Mqtt5AsyncOpStatus_BrokerDisconnected
The operation has been aborted before completion due to broker's disconnection.
Definition: common.h:104
@ CC_Mqtt5AsyncOpStatus_BadParam
Bad value has been returned from the relevant callback.
Definition: common.h:106
@ CC_Mqtt5AsyncOpStatus_Complete
The requested operation has been completed, refer to reported extra details for information.
Definition: common.h:99
@ CC_Mqtt5AsyncOpStatus_Timeout
The required response from broker hasn't been received in time.
Definition: common.h:101
@ CC_Mqtt5AsyncOpStatus_InternalError
Internal library error, please submit bug report
Definition: common.h:100
@ CC_Mqtt5AsyncOpStatus_Aborted
The operation has been aborted before completion due to client's side operation.
Definition: common.h:103
@ CC_Mqtt5AsyncOpStatus_ValuesLimit
Limit for the values.
Definition: common.h:107
@ CC_Mqtt5AsyncOpStatus_OutOfMemory
The client library wasn't able to allocate necessary memory.
Definition: common.h:105
@ CC_Mqtt5ErrorCode_InsufficientConfig
The required configuration hasn't been performed.
Definition: common.h:74
@ CC_Mqtt5ErrorCode_Disconnecting
The client is in "disconnecting" state, (re)connect is required in the next iteration loop.
Definition: common.h:79
@ CC_Mqtt5ErrorCode_OutOfMemory
Memory allocation failed.
Definition: common.h:75
@ CC_Mqtt5ErrorCode_NotConnected
The client library is not connected to the broker. Returned by operations that require connection to ...
Definition: common.h:71
@ CC_Mqtt5ErrorCode_AlreadyConnected
The client library is already connected to the broker, cannot perform connection operation.
Definition: common.h:72
@ CC_Mqtt5ErrorCode_BadParam
Bad parameter is passed to the function.
Definition: common.h:73
@ CC_Mqtt5ErrorCode_Success
The requested function executed successfully.
Definition: common.h:67
@ CC_Mqtt5ErrorCode_NotAuthenticated
The client not authenticated.
Definition: common.h:81
@ CC_Mqtt5ErrorCode_ValuesLimit
Limit for the values.
Definition: common.h:83
@ CC_Mqtt5ErrorCode_NotSupported
Feature is not supported.
Definition: common.h:77
@ CC_Mqtt5ErrorCode_NetworkDisconnected
When network is disconnected issueing new ops is not accepted.
Definition: common.h:80
@ CC_Mqtt5ErrorCode_BufferOverflow
Output buffer is too short.
Definition: common.h:76
@ CC_Mqtt5ErrorCode_NotIntitialized
The allocated client hasn't been initialized.
Definition: common.h:69
@ CC_Mqtt5ErrorCode_RetryLater
Retry in next event loop iteration.
Definition: common.h:78
@ CC_Mqtt5ErrorCode_InternalError
Internal library error, please submit bug report
Definition: common.h:68
@ CC_Mqtt5ErrorCode_Busy
The client library is in the middle of previous operation(s), cannot start a new one.
Definition: common.h:70
@ CC_Mqtt5ErrorCode_PreparationLocked
Another operation is being prepared, cannot create a new one without performing "send" or "cancel".
Definition: common.h:82
@ CC_Mqtt5QoS_ExactlyOnceDelivery
QoS=2. Exactly once delivery.
Definition: common.h:59
@ CC_Mqtt5QoS_ValuesLimit
Limit for the values.
Definition: common.h:60
@ CC_Mqtt5QoS_AtMostOnceDelivery
QoS=0. At most once delivery.
Definition: common.h:57
@ CC_Mqtt5QoS_AtLeastOnceDelivery
QoS=1. At least once delivery.
Definition: common.h:58
@ CC_Mqtt5BrokerDisconnectReason_DisconnectMsg
The broker sent DISCONNECT message.
Definition: common.h:205
@ CC_Mqtt5BrokerDisconnectReason_ProtocolError
Protocol error was detected.
Definition: common.h:208
@ CC_Mqtt5BrokerDisconnectReason_ValuesLimit
Limit for the values.
Definition: common.h:209
@ CC_Mqtt5BrokerDisconnectReason_InternalError
The library encountered internal error and there is a need to close network connection.
Definition: common.h:206
@ CC_Mqtt5BrokerDisconnectReason_NoBrokerResponse
No messages from the broker and no response to PINGREQ.
Definition: common.h:207
CC_Mqtt5TopicAliasPreference
Preference of whether to use numeric "Topic Alias" instead of string topic during publish operation.
Definition: common.h:184
void(* CC_Mqtt5PublishCompleteCb)(void *data, CC_Mqtt5PublishHandle handle, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5PublishResponse *response)
Callback used to report completion of the "publish" operation.
Definition: common.h:613
struct CC_Mqtt5Publish * CC_Mqtt5PublishHandle
Handle for "publish" operation.
Definition: common.h:264
CC_Mqtt5PublishOrdering
Publish ordering configuration.
Definition: common.h:195
@ CC_Mqtt5TopicAliasPreference_UseAliasIfAvailable
Use topic alias if such is available.
Definition: common.h:185
@ CC_Mqtt5TopicAliasPreference_ForceAliasOnly
Force sending topic alias, requires topic alias to be allocated.
Definition: common.h:186
@ CC_Mqtt5TopicAliasPreference_ForceTopicWithAlias
Force sending both topic string and its numeric alias.
Definition: common.h:188
@ CC_Mqtt5TopicAliasPreference_ForceTopicOnly
Force sending topic string even if topic alias is available.
Definition: common.h:187
@ CC_Mqtt5TopicAliasPreference_ValuesLimit
Limit for the values.
Definition: common.h:189
@ CC_Mqtt5PublishOrdering_Full
Preserve strict order between all messages.
Definition: common.h:197
@ CC_Mqtt5PublishOrdering_SameQos
Preserve strict order only between same QoS messages.
Definition: common.h:196
@ CC_Mqtt5PublishOrdering_ValuesLimit
Limit for the values.
Definition: common.h:198
void(* CC_Mqtt5ReauthCompleteCb)(void *data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5AuthInfo *response)
Callback used to report completion of the "reauth" operation.
Definition: common.h:623
struct CC_Mqtt5Reauth * CC_Mqtt5ReauthHandle
Handle for "reauth" operation.
Definition: common.h:273
void(* CC_Mqtt5SubscribeCompleteCb)(void *data, CC_Mqtt5SubscribeHandle handle, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5SubscribeResponse *response)
Callback used to report completion of the "subscribe" operation.
Definition: common.h:585
struct CC_Mqtt5Subscribe * CC_Mqtt5SubscribeHandle
Handle for "subscribe" operation.
Definition: common.h:246
CC_Mqtt5RetainHandling
"Retain Handling" option as defined by the MQTT v5 specification.
Definition: common.h:174
@ CC_Mqtt5RetainHandling_Send
Send retained messages at the time of the subscribe.
Definition: common.h:175
@ CC_Mqtt5RetainHandling_DoNotSend
Do not send retained messages at the time of the subscribe.
Definition: common.h:177
@ CC_Mqtt5RetainHandling_SendIfDoesNotExist
Send retained messages at subscribe only if the subscription does not currently exist.
Definition: common.h:176
@ CC_Mqtt5RetainHandling_ValuesLimit
Limit for the values.
Definition: common.h:178
void(* CC_Mqtt5UnsubscribeCompleteCb)(void *data, CC_Mqtt5UnsubscribeHandle handle, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5UnsubscribeResponse *response)
Callback used to report completion of the "unsubscribe" operation.
Definition: common.h:599
struct CC_Mqtt5Unsubscribe * CC_Mqtt5UnsubscribeHandle
Handle for "unsubscribe" operation.
Definition: common.h:255
Authentication Configuration.
Definition: common.h:629
void * m_authCbData
Pointer to user data object, passed as first parameter to the "m_authCb" callback.
Definition: common.h:634
unsigned m_authDataLen
Amount of bytes in the authentication data buffer.
Definition: common.h:632
CC_Mqtt5AuthCb m_authCb
Callback to be invoked during the authentication handshake.
Definition: common.h:633
const unsigned char * m_authData
Pointer to the authentication data buffer, can be NULL.
Definition: common.h:631
const char * m_authMethod
Authentication method string, must NOT be NULL.
Definition: common.h:630
Authentication handshake information.
Definition: common.h:359
const unsigned char * m_authData
Pointer to the authentication data buffer, can be NULL.
Definition: common.h:360
unsigned m_userPropsCount
Amount of elements in the "User Properties" array, defaults to 0, not added when 0.
Definition: common.h:364
const char * m_reasonStr
"Reason String" property, defaults to NULL, not added when NULL.
Definition: common.h:362
unsigned m_authDataLen
Amount of bytes in the authentication data buffer, defaults to 0, not added when 0.
Definition: common.h:361
const CC_Mqtt5UserProp * m_userProps
Pointer to "User Properties" array, can be NULL.
Definition: common.h:363
Configuration structure to be passed to the cc_mqtt5_client_connect_config_basic().
Definition: common.h:288
const char * m_clientId
Zero terminated Client ID string, can be NULL. When NULL means empty "Client ID". Defaults to NULL.
Definition: common.h:289
bool m_cleanStart
Clean start flag, defaults to false.
Definition: common.h:294
const unsigned char * m_password
Pointer to password buffer, can be NULL, defaults to NULL.
Definition: common.h:291
unsigned m_keepAlive
Keep alive seconds configuration, defaults to 60.
Definition: common.h:293
const char * m_username
Zero terminated Username string, can be NULL. When NULL means no username value. Defaults to NULL.
Definition: common.h:290
unsigned m_passwordLen
Number of password bytes. When 0 means no password value. Defaults to 0.
Definition: common.h:292
Extra properties configuration of the "connect" operation.
Definition: common.h:320
bool m_requestResponseInfo
"Request Response Information" property, defaults to false, not added when false.
Definition: common.h:326
unsigned m_receiveMaximum
Definition: common.h:322
unsigned m_topicAliasMaximum
"Topic Alias Maximum" property, defaults to 0, not added when 0.
Definition: common.h:325
unsigned m_maxPacketSize
"Maximum Packet Size" property, defaults to 0, not added when 0, which means "no limit".
Definition: common.h:324
bool m_requestProblemInfo
"Request Problem Information" property, defaults to false, not added when false.
Definition: common.h:327
unsigned m_sessionExpiryInterval
"Session Expiry Interval" property, defaults to 0, not added when 0.
Definition: common.h:321
Response information from broker to "connect" request.
Definition: common.h:333
bool m_retainAvailable
"Retain Available" indication.
Definition: common.h:349
unsigned m_userPropsCount
Amount of "User Properties" in the array.
Definition: common.h:342
CC_Mqtt5ReasonCode m_reasonCode
"Reason Code" reported by the broker
Definition: common.h:334
unsigned m_authDataLen
Amount of bytes in the "Authentication Data" property buffer.
Definition: common.h:340
const char * m_serverRef
"Server Reference" property, NULL if not reported
Definition: common.h:338
const char * m_reasonStr
"Reason String" property, NULL if not reported
Definition: common.h:337
const char * m_assignedClientId
"Assigned Client Identifier" property, NULL if not reported
Definition: common.h:335
unsigned m_topicAliasMax
"Topic Alias Maximum" property, 0 if not reported.
Definition: common.h:346
unsigned m_sessionExpiryInterval
"Session Expiry Interval" property, 0 if not reported.
Definition: common.h:343
unsigned m_maxPacketSize
"Maximum Packet Size" property, 0 if not reported.
Definition: common.h:345
bool m_sharedSubsAvailable
"Shared Subscription Available" indication.
Definition: common.h:352
bool m_sessionPresent
"Session Present" indication.
Definition: common.h:348
const char * m_responseInfo
"Response Information" property, NULL if not reported
Definition: common.h:336
const CC_Mqtt5UserProp * m_userProps
Pointer to array containing "User Properties", NULL if none.
Definition: common.h:341
const unsigned char * m_authData
Final "Authentication Data" property buffer, NULL if not reported.
Definition: common.h:339
CC_Mqtt5QoS m_maxQos
"Maximum QoS" property,
Definition: common.h:347
unsigned m_highQosSendLimit
"Receive Maximum" property.
Definition: common.h:344
bool m_subIdsAvailable
"Subscription Identifiers Available" indication.
Definition: common.h:351
bool m_wildcardSubAvailable
"Wildcard Subscription Available" indication.
Definition: common.h:350
Configuration structure to be passed to the cc_mqtt5_client_connect_config_will().
Definition: common.h:301
const unsigned char * m_data
Will message data, can be NULL. Defaults to NULL.
Definition: common.h:303
CC_Mqtt5PayloadFormat m_format
"Payload Format Indicator" will property, defaults to CC_Mqtt5PayloadFormat_Unspecified,...
Definition: common.h:312
bool m_retain
"Retain" flag, defaults to false.
Definition: common.h:313
unsigned m_delayInterval
"Will Delay Interval" will property, not added when 0. Defaults to 0.
Definition: common.h:309
CC_Mqtt5QoS m_qos
QoS value of the will message, defaults to CC_Mqtt5QoS_AtMostOnceDelivery.
Definition: common.h:311
unsigned m_correlationDataLen
Number of bytes in the "Correlation Data" buffer. Not added when 0. Defaults to 0.
Definition: common.h:308
const char * m_contentType
"Content Type" will property, not added when NULL. Defaults to NULL.
Definition: common.h:305
unsigned m_messageExpiryInterval
"Message Expiry Interval" will property, not added when 0. Defaults to 0.
Definition: common.h:310
const unsigned char * m_correlationData
"Correlation Data" will property, can be NULL. Defaults to NULL.
Definition: common.h:307
const char * m_topic
Will topic string, must NOT be NULL or empty. Defaults to NULL.
Definition: common.h:302
const char * m_responseTopic
"Response Topic" will property, not added when NULL. Defaults to NULL.
Definition: common.h:306
unsigned m_dataLen
Number of will data bytes. When 0 means no data. Defaults to 0.
Definition: common.h:304
Configuration structure of the "disconnect" operation.
Definition: common.h:382
unsigned * m_sessionExpiryInterval
Pointer to "Session Expiry Interval" property value, defaults to NULL, not added when NULL.
Definition: common.h:385
const char * m_reasonStr
"Reason String" property, defaults to NULL, not added when NULL.
Definition: common.h:384
CC_Mqtt5ReasonCode m_reasonCode
"Reason Code" to report to the broker
Definition: common.h:383
Broker disconnection information.
Definition: common.h:370
const char * m_reasonStr
"Reason String" property, NULL if not reported
Definition: common.h:372
const CC_Mqtt5UserProp * m_userProps
Pointer to "User Properties" array, can be NULL.
Definition: common.h:374
CC_Mqtt5ReasonCode m_reasonCode
"Reason Code" reported by the broker
Definition: common.h:371
unsigned m_userPropsCount
Amount of elements in the "User Properties" array, defaults to 0, not added when 0.
Definition: common.h:375
const char * m_serverRef
"Server Reference" property, NULL if not reported
Definition: common.h:373
Received message information.
Definition: common.h:441
const char * m_topic
Topic used to publish the message.
Definition: common.h:442
CC_Mqtt5PayloadFormat m_format
"Payload Format Indicator" property, defaults to CC_Mqtt5PayloadFormat_Unspecified when not reported.
Definition: common.h:455
CC_Mqtt5QoS m_qos
QoS value used by the broker to report the message.
Definition: common.h:454
unsigned m_messageExpiryInterval
"Message Expiry Interval" property, defaults to 0 when not reported.
Definition: common.h:453
unsigned m_correlationDataLen
Amount of "Correlation Data" bytes;.
Definition: common.h:447
const char * m_responseTopic
"Response Topic" property when provided, NULL if not.
Definition: common.h:445
const unsigned char * m_data
Pointer to the temporary buffer containin message data.
Definition: common.h:443
const CC_Mqtt5UserProp * m_userProps
Pointer to the "User Property" properties array when provided, NULL if not.
Definition: common.h:448
unsigned m_subIdsCount
Amount of "Subscription Identifiers" in array.
Definition: common.h:452
const char * m_contentType
"Content Type" property if provided, NULL if not.
Definition: common.h:450
unsigned m_userPropsCount
Amount of "User Property" properties.
Definition: common.h:449
const unsigned * m_subIds
Pointer to array containing "Subscription Identifier" properties list when provided,...
Definition: common.h:451
bool m_retained
Indication of whether the received message was "retained".
Definition: common.h:456
const unsigned char * m_correlationData
Pointer to the "Correlation Data" property value when provided, NULL if not.
Definition: common.h:446
unsigned m_dataLen
Amount of data bytes.
Definition: common.h:444
Configuration structure to be passed to the cc_mqtt5_client_publish_config_basic().
Definition: common.h:463
CC_Mqtt5TopicAliasPreference m_topicAliasPref
Topic alias usage preference, defaults to CC_Mqtt5TopicAliasPreference_UseAliasIfAvailable.
Definition: common.h:468
bool m_retain
"Retain" flag, defaults to false.
Definition: common.h:469
const unsigned char * m_data
Pointer to publish data buffer, defaults to NULL.
Definition: common.h:465
CC_Mqtt5QoS m_qos
Publish QoS value, defaults to CC_Mqtt5QoS_AtMostOnceDelivery.
Definition: common.h:467
unsigned m_dataLen
Amount of bytes in the publish data buffer, defaults to 0.
Definition: common.h:466
const char * m_topic
Publish topic, cannot be NULL.
Definition: common.h:464
Configuration structure to be passed to the cc_mqtt5_client_publish_config_extra().
Definition: common.h:476
const char * m_responseTopic
"Response Topic" property, defaults to NULL, not added when NULL.
Definition: common.h:478
unsigned m_messageExpiryInterval
"Message Expiry Interval" property, defaults to 0, not added when 0.
Definition: common.h:481
const char * m_contentType
"Content Type" property, defaults to NULL, not added when NULL.
Definition: common.h:477
const unsigned char * m_correlationData
"Correlation Data" property, can be NULL.
Definition: common.h:479
unsigned m_correlationDataLen
Length of the "Correlation Data", not added when 0.
Definition: common.h:480
CC_Mqtt5PayloadFormat m_format
"Payload Format Indicator" property, defaults to CC_Mqtt5PayloadFormat_Unspecified,...
Definition: common.h:482
Response information from broker to "publish" request.
Definition: common.h:488
unsigned m_userPropsCount
Number of elements in "User Properties" array.
Definition: common.h:492
const CC_Mqtt5UserProp * m_userProps
Pointer to array of "User Properties", can be NULL.
Definition: common.h:491
const char * m_reasonStr
"Reason String" property, can be NULL.
Definition: common.h:490
CC_Mqtt5ReasonCode m_reasonCode
"Reason Code" of the operation
Definition: common.h:489
Extra subscription properties configuration structure.
Definition: common.h:404
unsigned m_subId
"Subscription Identifier" property, defaults to invalid value of 0.
Definition: common.h:405
Response information from broker to "subscribe" request.
Definition: common.h:411
unsigned m_reasonCodesCount
Amount of reason codes in the array.
Definition: common.h:413
const char * m_reasonStr
"Reason String" property, can be NULL
Definition: common.h:414
const CC_Mqtt5UserProp * m_userProps
Pointer to "User Properties" array, can be NULL.
Definition: common.h:415
const CC_Mqtt5ReasonCode * m_reasonCodes
Pointer to array contianing per-topic subscription reason codes.
Definition: common.h:412
unsigned m_userPropsCount
Amount of elements in the "User Properties" array.
Definition: common.h:416
Topic filter configuration structure of the "subscribe" operation.
Definition: common.h:392
bool m_retainAsPublished
"Retain As Published" subscription option, defaults to false.
Definition: common.h:397
CC_Mqtt5RetainHandling m_retainHandling
"Retain Handling" subscription option, defaults to CC_Mqtt5RetainHandling_Send.
Definition: common.h:395
const char * m_topic
"Topic Filter" string, mustn't be NULL
Definition: common.h:393
bool m_noLocal
"No Local" subscription option, defaults to false.
Definition: common.h:396
CC_Mqtt5QoS m_maxQos
"Maximum QoS" value, defaults to CC_Mqtt5QoS_ExactlyOnceDelivery.
Definition: common.h:394
Response information from broker to "unsubscribe" request.
Definition: common.h:430
unsigned m_reasonCodesCount
Amount of reason codes in the array.
Definition: common.h:432
const CC_Mqtt5ReasonCode * m_reasonCodes
Pointer to array contianing per-topic unsubscription reason codes.
Definition: common.h:431
unsigned m_userPropsCount
Amount of elements in the "User Properties" array.
Definition: common.h:435
const char * m_reasonStr
"Reason String" property, can be NULL
Definition: common.h:433
const CC_Mqtt5UserProp * m_userProps
Pointer to "User Properties" array, can be NULL.
Definition: common.h:434
Topic filter configuration structure of the "unsubscribe" operation.
Definition: common.h:423
const char * m_topic
"Topic Filter" string, mustn't be NULL
Definition: common.h:424
Wraping structre of the single "User Property".
Definition: common.h:279
const char * m_value
Value string, can be NULL.
Definition: common.h:281
const char * m_key
Key string, mustn't be NULL.
Definition: common.h:280