CommsChampion Ecosystem MQTT v5 Client
MQTT v5 Client Library.
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations
common.h File Reference

Common definition for MQTT v5 clients. More...

#include <stdbool.h>

Go to the source code of this file.

Classes

struct  CC_Mqtt5AuthConfig
 Authentication Configuration. More...
 
struct  CC_Mqtt5AuthInfo
 Authentication handshake information. More...
 
struct  CC_Mqtt5ConnectBasicConfig
 Configuration structure to be passed to the cc_mqtt5_client_connect_config_basic(). More...
 
struct  CC_Mqtt5ConnectExtraConfig
 Extra properties configuration of the "connect" operation. More...
 
struct  CC_Mqtt5ConnectResponse
 Response information from broker to "connect" request. More...
 
struct  CC_Mqtt5ConnectWillConfig
 Configuration structure to be passed to the cc_mqtt5_client_connect_config_will(). More...
 
struct  CC_Mqtt5DisconnectConfig
 Configuration structure of the "disconnect" operation. More...
 
struct  CC_Mqtt5DisconnectInfo
 Broker disconnection information. More...
 
struct  CC_Mqtt5MessageInfo
 Received message information. More...
 
struct  CC_Mqtt5PublishBasicConfig
 Configuration structure to be passed to the cc_mqtt5_client_publish_config_basic(). More...
 
struct  CC_Mqtt5PublishExtraConfig
 Configuration structure to be passed to the cc_mqtt5_client_publish_config_extra(). More...
 
struct  CC_Mqtt5PublishResponse
 Response information from broker to "publish" request. More...
 
struct  CC_Mqtt5SubscribeExtraConfig
 Extra subscription properties configuration structure. More...
 
struct  CC_Mqtt5SubscribeResponse
 Response information from broker to "subscribe" request. More...
 
struct  CC_Mqtt5SubscribeTopicConfig
 Topic filter configuration structure of the "subscribe" operation. More...
 
struct  CC_Mqtt5UnsubscribeResponse
 Response information from broker to "unsubscribe" request. More...
 
struct  CC_Mqtt5UnsubscribeTopicConfig
 Topic filter configuration structure of the "unsubscribe" operation. 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.
 

Typedefs

typedef CC_Mqtt5AuthErrorCode(* CC_Mqtt5AuthCb) (void *data, const CC_Mqtt5AuthInfo *authInfoIn, CC_Mqtt5AuthInfo *authInfoOut)
 Callback used to report incoming authentication data.
 
typedef void(* CC_Mqtt5BrokerDisconnectReportCb) (void *data, CC_Mqtt5BrokerDisconnectReason reason, const CC_Mqtt5DisconnectInfo *info)
 Callback used to report unsolicited disconnection of the broker.
 
typedef unsigned(* CC_Mqtt5CancelNextTickWaitCb) (void *data)
 Callback used to request termination of existing time measurement.
 
typedef struct CC_Mqtt5Client * CC_Mqtt5ClientHandle
 Handle used to access client specific data structures.
 
typedef void(* CC_Mqtt5ConnectCompleteCb) (void *data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5ConnectResponse *response)
 Callback used to report completion of the "connect" operation.
 
typedef struct CC_Mqtt5Connect * CC_Mqtt5ConnectHandle
 Handle for "connect" operation.
 
typedef struct CC_Mqtt5Disconnect * CC_Mqtt5DisconnectHandle
 Handle for "disconnect" operation.
 
typedef void(* CC_Mqtt5ErrorLogCb) (void *data, const char *msg)
 Callback used to report discovered errors.
 
typedef void(* CC_Mqtt5MessageReceivedReportCb) (void *data, const CC_Mqtt5MessageInfo *info)
 Callback used to report new message received of the broker.
 
typedef void(* CC_Mqtt5NextTickProgramCb) (void *data, unsigned duration)
 Callback used to request time measurement.
 
typedef void(* CC_Mqtt5PublishCompleteCb) (void *data, CC_Mqtt5PublishHandle handle, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5PublishResponse *response)
 Callback used to report completion of the "publish" operation.
 
typedef struct CC_Mqtt5Publish * CC_Mqtt5PublishHandle
 Handle for "publish" operation.
 
typedef void(* CC_Mqtt5ReauthCompleteCb) (void *data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5AuthInfo *response)
 Callback used to report completion of the "reauth" operation.
 
typedef struct CC_Mqtt5Reauth * CC_Mqtt5ReauthHandle
 Handle for "reauth" operation.
 
typedef void(* CC_Mqtt5SendOutputDataCb) (void *data, const unsigned char *buf, unsigned bufLen)
 Callback used to request to send data to the broker.
 
typedef void(* CC_Mqtt5SubscribeCompleteCb) (void *data, CC_Mqtt5SubscribeHandle handle, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5SubscribeResponse *response)
 Callback used to report completion of the "subscribe" operation.
 
typedef struct CC_Mqtt5Subscribe * CC_Mqtt5SubscribeHandle
 Handle for "subscribe" operation.
 
typedef void(* CC_Mqtt5UnsubscribeCompleteCb) (void *data, CC_Mqtt5UnsubscribeHandle handle, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5UnsubscribeResponse *response)
 Callback used to report completion of the "unsubscribe" operation.
 
typedef struct CC_Mqtt5Unsubscribe * CC_Mqtt5UnsubscribeHandle
 Handle for "unsubscribe" operation.
 

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_Mqtt5PublishOrdering { CC_Mqtt5PublishOrdering_SameQos , CC_Mqtt5PublishOrdering_Full , CC_Mqtt5PublishOrdering_ValuesLimit }
 Publish ordering configuration. 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...
 
enum  CC_Mqtt5RetainHandling { CC_Mqtt5RetainHandling_Send = 0 , CC_Mqtt5RetainHandling_SendIfDoesNotExist = 1 , CC_Mqtt5RetainHandling_DoNotSend = 2 , CC_Mqtt5RetainHandling_ValuesLimit }
 "Retain Handling" option as defined by the MQTT v5 specification. More...
 
enum  CC_Mqtt5TopicAliasPreference {
  CC_Mqtt5TopicAliasPreference_UseAliasIfAvailable = 0 , CC_Mqtt5TopicAliasPreference_ForceAliasOnly = 1 , CC_Mqtt5TopicAliasPreference_ForceTopicOnly = 2 , CC_Mqtt5TopicAliasPreference_ForceTopicWithAlias = 3 ,
  CC_Mqtt5TopicAliasPreference_ValuesLimit
}
 Preference of whether to use numeric "Topic Alias" instead of string topic during publish operation. More...
 

Detailed Description

Common definition for MQTT v5 clients.

Typedef Documentation

◆ CC_Mqtt5AuthCb

typedef CC_Mqtt5AuthErrorCode(* CC_Mqtt5AuthCb) (void *data, const CC_Mqtt5AuthInfo *authInfoIn, CC_Mqtt5AuthInfo *authInfoOut)

Callback used to report incoming authentication data.

Parameters
[in]dataPointer to user data object passed during callback registration.
[in]authInfoInPointer to authentication data received from broker.
[out]authInfoOutPointer to authentication data to be sent to the broker. Expected to be filled by the callback.