CommsChampion Ecosystem MQTT-SN Client
MQTT-SN client library.
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations
common.h File Reference

Common definition for MQTT-SN clients. More...

#include <stdbool.h>

Go to the source code of this file.

Classes

struct  CC_MqttsnConnectConfig
 Configuration the "connect" operation. More...
 
struct  CC_MqttsnConnectInfo
 Information on the "connect" operation completion. More...
 
struct  CC_MqttsnGatewayInfo
 Gateway information. More...
 
struct  CC_MqttsnMessageInfo
 Incoming message information. More...
 
struct  CC_MqttsnPublishConfig
 Configuration the will for "publish" operations. More...
 
struct  CC_MqttsnPublishInfo
 Information on the "publish" operation completion. More...
 
struct  CC_MqttsnSleepConfig
 Configuration the "sleep" operation. More...
 
struct  CC_MqttsnSubscribeConfig
 Configuration the "subscribe" operation. More...
 
struct  CC_MqttsnSubscribeInfo
 Information on the "subscribe" operation completion. More...
 
struct  CC_MqttsnUnsubscribeConfig
 Configuration the "unsubscribe" operation. More...
 
struct  CC_MqttsnWillConfig
 Configuration the will for "connect" and "will" operations. More...
 
struct  CC_MqttsnWillInfo
 Information on the "will" operation completion. More...
 

Macros

#define CC_MQTTSN_CLIENT_MAJOR_VERSION   2U
 Major verion of the library.
 
#define CC_MQTTSN_CLIENT_MAKE_VERSION(major_, minor_, patch_)
 Macro to create numeric version as single unsigned number.
 
#define CC_MQTTSN_CLIENT_MINOR_VERSION   0U
 Minor verion of the library.
 
#define CC_MQTTSN_CLIENT_PATCH_VERSION   5U
 Patch level of the library.
 
#define CC_MQTTSN_CLIENT_VERSION   CC_MQTTSN_CLIENT_MAKE_VERSION(CC_MQTTSN_CLIENT_MAJOR_VERSION, CC_MQTTSN_CLIENT_MINOR_VERSION, CC_MQTTSN_CLIENT_PATCH_VERSION)
 Version of the library as single numeric value.
 

Typedefs

typedef unsigned(* CC_MqttsnCancelNextTickWaitCb) (void *data)
 Callback used to request termination of existing time measurement.
 
typedef struct CC_MqttsnClient * CC_MqttsnClientHandle
 Handler used to access client specific data structures.
 
typedef void(* CC_MqttsnConnectCompleteCb) (void *data, CC_MqttsnAsyncOpStatus status, const CC_MqttsnConnectInfo *info)
 Callback used to report completion of the connect operation.
 
typedef struct CC_MqttsnConnect * CC_MqttsnConnectHandle
 Handle for "connect" operation.
 
typedef void(* CC_MqttsnDisconnectCompleteCb) (void *data, CC_MqttsnAsyncOpStatus status)
 Callback used to report completion of the disconnect operation.
 
typedef struct CC_MqttsnDisconnect * CC_MqttsnDisconnectHandle
 Handle for "disconnect" operation.
 
typedef void(* CC_MqttsnErrorLogCb) (void *data, const char *msg)
 Callback used to report discovered errors.
 
typedef void(* CC_MqttsnGwDisconnectedReportCb) (void *data, CC_MqttsnGatewayDisconnectReason reason)
 Callback used to report unsolicited disconnection of the gateway.
 
typedef unsigned(* CC_MqttsnGwinfoDelayRequestCb) (void *data)
 Callback used to request delay (in ms) to wait before responding with GWINFO message on behalf of a gateway.
 
typedef void(* CC_MqttsnGwStatusReportCb) (void *data, CC_MqttsnGwStatus status, const CC_MqttsnGatewayInfo *info)
 Callback used to report gateway status.
 
typedef void(* CC_MqttsnMessageReportCb) (void *data, const CC_MqttsnMessageInfo *msgInfo)
 Callback used to report incoming messages.
 
typedef void(* CC_MqttsnNextTickProgramCb) (void *data, unsigned duration)
 Callback used to request time measurement.
 
typedef void(* CC_MqttsnPublishCompleteCb) (void *data, CC_MqttsnPublishHandle handle, CC_MqttsnAsyncOpStatus status, const CC_MqttsnPublishInfo *info)
 Callback used to report completion of the publish operation.
 
typedef struct CC_MqttsnPublish * CC_MqttsnPublishHandle
 Handle for "publish" operation.
 
typedef void(* CC_MqttsnSearchCompleteCb) (void *data, CC_MqttsnAsyncOpStatus status, const CC_MqttsnGatewayInfo *info)
 Callback used to report completion of the asynchronous operation.
 
typedef struct CC_MqttsnSearch * CC_MqttsnSearchHandle
 Handle for "search" operation.
 
typedef void(* CC_MqttsnSendOutputDataCb) (void *data, const unsigned char *buf, unsigned bufLen, unsigned broadcastRadius)
 Callback used to request to send data to the gateway.
 
typedef void(* CC_MqttsnSleepCompleteCb) (void *data, CC_MqttsnAsyncOpStatus status)
 Callback used to report completion of the sleep operation.
 
typedef struct CC_MqttsnSleep * CC_MqttsnSleepHandle
 Handle for "sleep" operation.
 
typedef void(* CC_MqttsnSubscribeCompleteCb) (void *data, CC_MqttsnSubscribeHandle handle, CC_MqttsnAsyncOpStatus status, const CC_MqttsnSubscribeInfo *info)
 Callback used to report completion of the subscribe operation.
 
typedef struct CC_MqttsnSubscribe * CC_MqttsnSubscribeHandle
 Handle for "subscribe" operation.
 
typedef unsigned short CC_MqttsnTopicId
 Type used to hold Topic ID value.
 
typedef void(* CC_MqttsnUnsubscribeCompleteCb) (void *data, CC_MqttsnUnsubscribeHandle handle, CC_MqttsnAsyncOpStatus status)
 Callback used to report completion of the unsubscribe operation.
 
typedef struct CC_MqttsnUnsubscribe * CC_MqttsnUnsubscribeHandle
 Handle for "unsubscribe" operation.
 
typedef void(* CC_MqttsnWillCompleteCb) (void *data, CC_MqttsnAsyncOpStatus status, const CC_MqttsnWillInfo *info)
 Callback used to report completion of the publish operation.
 
typedef struct CC_MqttsnWill * CC_MqttsnWillHandle
 Handle for "will" operation.
 

Enumerations

enum  CC_MqttsnAsyncOpStatus {
  CC_MqttsnAsyncOpStatus_Complete = 0 , CC_MqttsnAsyncOpStatus_InternalError = 1 , CC_MqttsnAsyncOpStatus_Timeout = 2 , CC_MqttsnAsyncOpStatus_Aborted = 3 ,
  CC_MqttsnAsyncOpStatus_OutOfMemory = 4 , CC_MqttsnAsyncOpStatus_BadParam = 5 , CC_MqttsnAsyncOpStatus_GatewayDisconnected = 6 , CC_MqttsnAsyncOpStatus_ValuesLimit
}
 Status of the asynchronous operation. More...
 
enum  CC_MqttsnConnectionStatus { CC_MqttsnConnectionStatus_Disconnected = 0 , CC_MqttsnConnectionStatus_Connected = 1 , CC_MqttsnConnectionStatus_Asleep = 2 , CC_MqttsnConnectionStatus_ValuesLimit }
 Connection state. More...
 
enum  CC_MqttsnDataOrigin { CC_MqttsnDataOrigin_Any = 0 , CC_MqttsnDataOrigin_ConnectedGw = 1 , CC_MqttsnDataOrigin_ValuesLimit }
 Data origin. More...
 
enum  CC_MqttsnErrorCode {
  CC_MqttsnErrorCode_Success = 0 , CC_MqttsnErrorCode_InternalError = 1 , CC_MqttsnErrorCode_NotIntitialized = 2 , CC_MqttsnErrorCode_Busy = 3 ,
  CC_MqttsnErrorCode_NotConnected = 4 , CC_MqttsnErrorCode_BadParam = 5 , CC_MqttsnErrorCode_InsufficientConfig = 6 , CC_MqttsnErrorCode_OutOfMemory = 7 ,
  CC_MqttsnErrorCode_BufferOverflow = 8 , CC_MqttsnErrorCode_NotSupported = 9 , CC_MqttsnErrorCode_RetryLater = 10 , CC_MqttsnErrorCode_Disconnecting = 11 ,
  CC_MqttsnErrorCode_NotSleeping = 12 , CC_MqttsnErrorCode_PreparationLocked = 13 , CC_MqttsnErrorCode_ValuesLimit
}
 Error code returned by various API functions. More...
 
enum  CC_MqttsnGatewayDisconnectReason { CC_MqttsnGatewayDisconnectReason_DisconnectMsg = 0 , CC_MqttsnGatewayDisconnectReason_NoGatewayResponse = 1 , CC_MqttsnGatewayDisconnectReason_ValuesLimit }
 Reason for reporting unsolicited gateway disconnection. More...
 
enum  CC_MqttsnGwStatus {
  CC_MqttsnGwStatus_AddedByGateway = 0 , CC_MqttsnGwStatus_AddedByClient = 1 , CC_MqttsnGwStatus_UpdatedByClient = 2 , CC_MqttsnGwStatus_Alive = 3 ,
  CC_MqttsnGwStatus_Tentative = 4 , CC_MqttsnGwStatus_Removed = 5 , CC_MqttsnGwStatus_ValuesLimit
}
 Status of the gateway. More...
 
enum  CC_MqttsnQoS { CC_MqttsnQoS_AtMostOnceDelivery = 0 , CC_MqttsnQoS_AtLeastOnceDelivery = 1 , CC_MqttsnQoS_ExactlyOnceDelivery = 2 , CC_MqttsnQoS_ValuesLimit }
 Quality of Service. More...
 
enum  CC_MqttsnReturnCode {
  CC_MqttsnReturnCode_Accepted = 0 , CC_MqttsnReturnCode_Conjestion = 1 , CC_MqttsnReturnCode_InvalidTopicId = 2 , CC_MqttsnReturnCode_NotSupported = 3 ,
  CC_MqttsnReturnCode_ValuesLimit
}
 Return code as per MQTT-SN specification. More...
 

Detailed Description

Common definition for MQTT-SN clients.