CommsChampion Ecosystem MQTT v5 Client
MQTT v5 Client Library.
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions
"Global Data Types and Functions"

Classes

struct  CC_Mqtt5AuthConfig
 Authentication Configuration. More...
 
struct  CC_Mqtt5AuthInfo
 Authentication handshake information. More...
 
struct  CC_Mqtt5DisconnectInfo
 Broker disconnection information. More...
 
struct  CC_Mqtt5MessageInfo
 Received message information. More...
 
struct  CC_Mqtt5UserProp
 Wraping structre of the single "User Property". More...
 

Macros

#define CC_MQTT5_CLIENT_MAJOR_VERSION   1U
 Major verion of the library.
 
#define CC_MQTT5_CLIENT_MAKE_VERSION(major_, minor_, patch_)
 Macro to create numeric version as single unsigned number.
 
#define CC_MQTT5_CLIENT_MINOR_VERSION   0U
 Minor verion of the library.
 
#define CC_MQTT5_CLIENT_PATCH_VERSION   1U
 Patch level of the library.
 
#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)
 Version of the library as single numeric value.
 
#define CC_MQTT5_MAX_TOPIC_ALIASES_LIMIT   0xffff
 MQTT5 protocol limit to topic alias.
 
#define CC_MQTT5_SESSION_NEVER_EXPIRES   0xffffffff
 Special value for "Session Expiry Interval" property to specify that session never expires.
 

Enumerations

enum  CC_Mqtt5AsyncOpStatus {
  CC_Mqtt5AsyncOpStatus_Complete = 0 , CC_Mqtt5AsyncOpStatus_InternalError = 1 , CC_Mqtt5AsyncOpStatus_Timeout = 2 , CC_Mqtt5AsyncOpStatus_ProtocolError = 3 ,
  CC_Mqtt5AsyncOpStatus_Aborted = 4 , CC_Mqtt5AsyncOpStatus_BrokerDisconnected = 5 , CC_Mqtt5AsyncOpStatus_OutOfMemory = 6 , CC_Mqtt5AsyncOpStatus_BadParam = 7 ,
  CC_Mqtt5AsyncOpStatus_ValuesLimit
}
 Status of the asynchronous operation. More...
 
enum  CC_Mqtt5AuthErrorCode { CC_Mqtt5AuthErrorCode_Continue = 0 , CC_Mqtt5AuthErrorCode_Disconnect = 1 , CC_Mqtt5AuthErrorCode_ValuesLimit = 2 }
 Error code returned by the CC_Mqtt5AuthCb callback. More...
 
enum  CC_Mqtt5BrokerDisconnectReason {
  CC_Mqtt5BrokerDisconnectReason_DisconnectMsg = 0 , CC_Mqtt5BrokerDisconnectReason_InternalError = 1 , CC_Mqtt5BrokerDisconnectReason_NoBrokerResponse = 2 , CC_Mqtt5BrokerDisconnectReason_ProtocolError = 3 ,
  CC_Mqtt5BrokerDisconnectReason_ValuesLimit
}
 Reason for reporting unsolicited broker disconnection. More...
 
enum  CC_Mqtt5ErrorCode {
  CC_Mqtt5ErrorCode_Success = 0 , CC_Mqtt5ErrorCode_InternalError = 1 , CC_Mqtt5ErrorCode_NotIntitialized = 2 , CC_Mqtt5ErrorCode_Busy = 3 ,
  CC_Mqtt5ErrorCode_NotConnected = 4 , CC_Mqtt5ErrorCode_AlreadyConnected = 5 , CC_Mqtt5ErrorCode_BadParam = 6 , CC_Mqtt5ErrorCode_InsufficientConfig = 7 ,
  CC_Mqtt5ErrorCode_OutOfMemory = 8 , CC_Mqtt5ErrorCode_BufferOverflow = 9 , CC_Mqtt5ErrorCode_NotSupported = 10 , CC_Mqtt5ErrorCode_RetryLater = 11 ,
  CC_Mqtt5ErrorCode_Disconnecting = 12 , CC_Mqtt5ErrorCode_NetworkDisconnected = 13 , CC_Mqtt5ErrorCode_NotAuthenticated = 14 , CC_Mqtt5ErrorCode_PreparationLocked = 15 ,
  CC_Mqtt5ErrorCode_ValuesLimit
}
 Error code returned by various API functions. More...
 
enum  CC_Mqtt5PayloadFormat { CC_Mqtt5PayloadFormat_Unspecified = 0 , CC_Mqtt5PayloadFormat_Utf8 = 1 , CC_Mqtt5PayloadFormat_ValuesLimit }
 Payload Format Indicator values as defined by the MQTT v5 protocol. More...
 
enum  CC_Mqtt5QoS { CC_Mqtt5QoS_AtMostOnceDelivery = 0 , CC_Mqtt5QoS_AtLeastOnceDelivery = 1 , CC_Mqtt5QoS_ExactlyOnceDelivery = 2 , CC_Mqtt5QoS_ValuesLimit }
 Quality of Service. More...
 
enum  CC_Mqtt5ReasonCode {
  CC_Mqtt5ReasonCode_Success = 0 , CC_Mqtt5ReasonCode_NormalDisconnection = 0 , CC_Mqtt5ReasonCode_GrantedQos0 = 0 , CC_Mqtt5ReasonCode_GrantedQos1 = 1 ,
  CC_Mqtt5ReasonCode_GrantedQos2 = 2 , CC_Mqtt5ReasonCode_DisconnectWithWill = 4 , CC_Mqtt5ReasonCode_NoMatchingSubscribers = 16 , CC_Mqtt5ReasonCode_NoSubscriptionExisted = 17 ,
  CC_Mqtt5ReasonCode_ContinueAuth = 24 , CC_Mqtt5ReasonCode_ReAuth = 25 , CC_Mqtt5ReasonCode_UnspecifiedError = 128 , CC_Mqtt5ReasonCode_MalformedPacket = 129 ,
  CC_Mqtt5ReasonCode_ProtocolError = 130 , CC_Mqtt5ReasonCode_ImplSpecificError = 131 , CC_Mqtt5ReasonCode_UnsupportedVersion = 132 , CC_Mqtt5ReasonCode_ClientIdInvalid = 133 ,
  CC_Mqtt5ReasonCode_BadUserPassword = 134 , CC_Mqtt5ReasonCode_NotAuthorized = 135 , CC_Mqtt5ReasonCode_ServerUnavailable = 136 , CC_Mqtt5ReasonCode_ServerBusy = 137 ,
  CC_Mqtt5ReasonCode_Banned = 138 , CC_Mqtt5ReasonCode_ServerShuttingDown = 139 , CC_Mqtt5ReasonCode_BadAuthMethod = 140 , CC_Mqtt5ReasonCode_KeepAliveTimeout = 141 ,
  CC_Mqtt5ReasonCode_SessionTakenOver = 142 , CC_Mqtt5ReasonCode_TopicFilterInvalid = 143 , CC_Mqtt5ReasonCode_TopicNameInvalid = 144 , CC_Mqtt5ReasonCode_PacketIdInUse = 145 ,
  CC_Mqtt5ReasonCode_PacketIdNotFound = 146 , CC_Mqtt5ReasonCode_ReceiveMaxExceeded = 147 , CC_Mqtt5ReasonCode_TopicAliasInvalid = 148 , CC_Mqtt5ReasonCode_PacketTooLarge = 149 ,
  CC_Mqtt5ReasonCode_MsgRateTooHigh = 150 , CC_Mqtt5ReasonCode_QuotaExceeded = 151 , CC_Mqtt5ReasonCode_AdministrativeAction = 152 , CC_Mqtt5ReasonCode_PayloadFormatInvalid = 153 ,
  CC_Mqtt5ReasonCode_RetainNotSupported = 154 , CC_Mqtt5ReasonCode_QosNotSupported = 155 , CC_Mqtt5ReasonCode_UseAnotherServer = 156 , CC_Mqtt5ReasonCode_ServerMoved = 157 ,
  CC_Mqtt5ReasonCode_SharedSubNotSuppored = 158 , CC_Mqtt5ReasonCode_ConnectionRateExceeded = 159 , CC_Mqtt5ReasonCode_MaxConnectTime = 160 , CC_Mqtt5ReasonCode_SubIdsNotSupported = 161 ,
  CC_Mqtt5ReasonCode_WildcardSubsNotSupported = 162
}
 "Reason Code" as defined in MQTT v5 specification More...
 

Functions

void cc_mqtt5_client_init_user_prop (CC_Mqtt5UserProp *prop)
 Intialize the CC_Mqtt5UserProp structure.
 

Detailed Description

Macro Definition Documentation

◆ CC_MQTT5_MAX_TOPIC_ALIASES_LIMIT

#define CC_MQTT5_MAX_TOPIC_ALIASES_LIMIT   0xffff

MQTT5 protocol limit to topic alias.

The application is expected not to allocate more than 65535 topic aliases.

◆ CC_MQTT5_SESSION_NEVER_EXPIRES

#define CC_MQTT5_SESSION_NEVER_EXPIRES   0xffffffff

Special value for "Session Expiry Interval" property to specify that session never expires.

See also
CC_Mqtt5ConnectExtraConfig::m_sessionExpiryInterval
CC_Mqtt5ConnectResponse::m_sessionExpiryInterval

Enumeration Type Documentation

◆ CC_Mqtt5AsyncOpStatus

Status of the asynchronous operation.

Enumerator
CC_Mqtt5AsyncOpStatus_Complete 

The requested operation has been completed, refer to reported extra details for information.

CC_Mqtt5AsyncOpStatus_InternalError 

Internal library error, please submit bug report

CC_Mqtt5AsyncOpStatus_Timeout 

The required response from broker hasn't been received in time.

CC_Mqtt5AsyncOpStatus_ProtocolError 

The broker's response doesn't comply with MQTT5 specification.

CC_Mqtt5AsyncOpStatus_Aborted 

The operation has been aborted before completion due to client's side operation.

CC_Mqtt5AsyncOpStatus_BrokerDisconnected 

The operation has been aborted before completion due to broker's disconnection.

CC_Mqtt5AsyncOpStatus_OutOfMemory 

The client library wasn't able to allocate necessary memory.

CC_Mqtt5AsyncOpStatus_BadParam 

Bad value has been returned from the relevant callback.

CC_Mqtt5AsyncOpStatus_ValuesLimit 

Limit for the values.

◆ CC_Mqtt5AuthErrorCode

Error code returned by the CC_Mqtt5AuthCb callback.

Enumerator
CC_Mqtt5AuthErrorCode_Continue 

Continue the authentication process.

CC_Mqtt5AuthErrorCode_Disconnect 

Stop the authentication, send DISCONNECT to broker.

CC_Mqtt5AuthErrorCode_ValuesLimit 

Limit for the values.

◆ CC_Mqtt5BrokerDisconnectReason

Reason for reporting unsolicited broker disconnection.

Enumerator
CC_Mqtt5BrokerDisconnectReason_DisconnectMsg 

The broker sent DISCONNECT message.

CC_Mqtt5BrokerDisconnectReason_InternalError 

The library encountered internal error and there is a need to close network connection.

CC_Mqtt5BrokerDisconnectReason_NoBrokerResponse 

No messages from the broker and no response to PINGREQ.

CC_Mqtt5BrokerDisconnectReason_ProtocolError 

Protocol error was detected.

CC_Mqtt5BrokerDisconnectReason_ValuesLimit 

Limit for the values.

◆ CC_Mqtt5ErrorCode

Error code returned by various API functions.

Enumerator
CC_Mqtt5ErrorCode_Success 

The requested function executed successfully.

CC_Mqtt5ErrorCode_InternalError 

Internal library error, please submit bug report

CC_Mqtt5ErrorCode_NotIntitialized 

The allocated client hasn't been initialized.

CC_Mqtt5ErrorCode_Busy 

The client library is in the middle of previous operation(s), cannot start a new one.

CC_Mqtt5ErrorCode_NotConnected 

The client library is not connected to the broker. Returned by operations that require connection to the broker.

CC_Mqtt5ErrorCode_AlreadyConnected 

The client library is already connected to the broker, cannot perform connection operation.

CC_Mqtt5ErrorCode_BadParam 

Bad parameter is passed to the function.

CC_Mqtt5ErrorCode_InsufficientConfig 

The required configuration hasn't been performed.

CC_Mqtt5ErrorCode_OutOfMemory 

Memory allocation failed.

CC_Mqtt5ErrorCode_BufferOverflow 

Output buffer is too short.

CC_Mqtt5ErrorCode_NotSupported 

Feature is not supported.

CC_Mqtt5ErrorCode_RetryLater 

Retry in next event loop iteration.

CC_Mqtt5ErrorCode_Disconnecting 

The client is in "disconnecting" state, (re)connect is required in the next iteration loop.

CC_Mqtt5ErrorCode_NetworkDisconnected 

When network is disconnected issueing new ops is not accepted.

CC_Mqtt5ErrorCode_NotAuthenticated 

The client not authenticated.

CC_Mqtt5ErrorCode_PreparationLocked 

Another operation is being prepared, cannot create a new one without performing "send" or "cancel".

CC_Mqtt5ErrorCode_ValuesLimit 

Limit for the values.

◆ CC_Mqtt5PayloadFormat

Payload Format Indicator values as defined by the MQTT v5 protocol.

Enumerator
CC_Mqtt5PayloadFormat_Unspecified 

Unspecified format.

CC_Mqtt5PayloadFormat_Utf8 

UTF-8 string.

CC_Mqtt5PayloadFormat_ValuesLimit 

Limit of the values.

◆ CC_Mqtt5QoS

Quality of Service.

Enumerator
CC_Mqtt5QoS_AtMostOnceDelivery 

QoS=0. At most once delivery.

CC_Mqtt5QoS_AtLeastOnceDelivery 

QoS=1. At least once delivery.

CC_Mqtt5QoS_ExactlyOnceDelivery 

QoS=2. Exactly once delivery.

CC_Mqtt5QoS_ValuesLimit 

Limit for the values.

◆ CC_Mqtt5ReasonCode

"Reason Code" as defined in MQTT v5 specification

Enumerator
CC_Mqtt5ReasonCode_Success 

value Success.

CC_Mqtt5ReasonCode_NormalDisconnection 

value Normal Disconnection.

CC_Mqtt5ReasonCode_GrantedQos0 

value Granted QoS0.

CC_Mqtt5ReasonCode_GrantedQos1 

value Granted QoS1.

CC_Mqtt5ReasonCode_GrantedQos2 

value Granted QoS2.

CC_Mqtt5ReasonCode_DisconnectWithWill 

value Disconnect w/ Will.

CC_Mqtt5ReasonCode_NoMatchingSubscribers 

value No Matching Subscribers.

CC_Mqtt5ReasonCode_NoSubscriptionExisted 

value No Subscription Existed.

CC_Mqtt5ReasonCode_ContinueAuth 

value Continue authentication.

CC_Mqtt5ReasonCode_ReAuth 

value Re-authenticate.

CC_Mqtt5ReasonCode_UnspecifiedError 

value Unspecified error.

CC_Mqtt5ReasonCode_MalformedPacket 

value Malformed Packet.

CC_Mqtt5ReasonCode_ProtocolError 

value Protocol Error.

CC_Mqtt5ReasonCode_ImplSpecificError 

value Impl. Specific Error.

CC_Mqtt5ReasonCode_UnsupportedVersion 

value Unsupported Version.

CC_Mqtt5ReasonCode_ClientIdInvalid 

value Client ID Invalid.

CC_Mqtt5ReasonCode_BadUserPassword 

value Bad Username/Password.

CC_Mqtt5ReasonCode_NotAuthorized 

value Not authorized.

CC_Mqtt5ReasonCode_ServerUnavailable 

value Server unavailable.

CC_Mqtt5ReasonCode_ServerBusy 

value Server busy.

CC_Mqtt5ReasonCode_Banned 

value Banned.

CC_Mqtt5ReasonCode_ServerShuttingDown 

value Server shutting down.

CC_Mqtt5ReasonCode_BadAuthMethod 

value Bad auth method.

CC_Mqtt5ReasonCode_KeepAliveTimeout 

value Keep Alive timeout.

CC_Mqtt5ReasonCode_SessionTakenOver 

value Session taken over.

CC_Mqtt5ReasonCode_TopicFilterInvalid 

value Topic Filter invalid.

CC_Mqtt5ReasonCode_TopicNameInvalid 

value Topic Name invalid.

CC_Mqtt5ReasonCode_PacketIdInUse 

value Packet ID in use.

CC_Mqtt5ReasonCode_PacketIdNotFound 

value Packet ID not found.

CC_Mqtt5ReasonCode_ReceiveMaxExceeded 

value Receive Max exceeded.

CC_Mqtt5ReasonCode_TopicAliasInvalid 

value Topic Alias invalid.

CC_Mqtt5ReasonCode_PacketTooLarge 

value Packet too large.

CC_Mqtt5ReasonCode_MsgRateTooHigh 

value Message rate too high.

CC_Mqtt5ReasonCode_QuotaExceeded 

value Quota exceeded.

CC_Mqtt5ReasonCode_AdministrativeAction 

value Administrative action.

CC_Mqtt5ReasonCode_PayloadFormatInvalid 

value Payload format invalid.

CC_Mqtt5ReasonCode_RetainNotSupported 

value Retain not supported.

CC_Mqtt5ReasonCode_QosNotSupported 

value QoS not supported.

CC_Mqtt5ReasonCode_UseAnotherServer 

value Use another server.

CC_Mqtt5ReasonCode_ServerMoved 

value Server moved.

CC_Mqtt5ReasonCode_SharedSubNotSuppored 

value Shared Sub not supported.

CC_Mqtt5ReasonCode_ConnectionRateExceeded 

value Connection rate exceeded.

CC_Mqtt5ReasonCode_MaxConnectTime 

value Maximum connect time.

CC_Mqtt5ReasonCode_SubIdsNotSupported 

value Sub IDs not supported.

CC_Mqtt5ReasonCode_WildcardSubsNotSupported 

value Wildcard Subs not supported.

Function Documentation

◆ cc_mqtt5_client_init_user_prop()

void cc_mqtt5_client_init_user_prop ( CC_Mqtt5UserProp prop)

Intialize the CC_Mqtt5UserProp structure.

Parameters
[out]propUser property info. Must not be NULL.