CommsChampion Ecosystem MQTT-SN Client
MQTT-SN client library.
|
Classes | |
struct | CC_MqttsnConnectConfig |
Configuration the "connect" operation. More... | |
struct | CC_MqttsnConnectInfo |
Information on the "connect" operation completion. More... | |
struct | CC_MqttsnWillConfig |
Configuration the will for "connect" and "will" operations. More... | |
Typedefs | |
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_MqttsnConnectCompleteCb) (void *data, CC_MqttsnAsyncOpStatus status, const CC_MqttsnConnectInfo *info) |
Callback used to report completion of the connect operation.
[in] | data | Pointer to user data object, passed as the last parameter to the request call. |
[in] | status | Status of the "connect" operation. |
[in] | info | Information about op completion. Not-NULL is reported if and onfly if the "status" is equal to CC_MqttsnAsyncOpStatus_Complete. |
typedef struct CC_MqttsnConnect* CC_MqttsnConnectHandle |
Handle for "connect" operation.
Returned by cc_mqttsn_client_connect_prepare() function.
CC_MqttsnErrorCode cc_mqttsn_client_connect | ( | CC_MqttsnClientHandle | client, |
const CC_MqttsnConnectConfig * | config, | ||
const CC_MqttsnWillConfig * | willConfig, | ||
CC_MqttsnConnectCompleteCb | cb, | ||
void * | cbData | ||
) |
Prepare and send "connect" request in one go.
Abstracts away sequence of the following functions invocation:
[in] | client | Handle returned by cc_mqttsn_client_alloc() function. |
[in] | config | Connection configuration. Can be NULL. |
[in] | willConfig | Will configuration. Can be NULL. |
[in] | cb | Callback to be invoked when "connect" operation is complete. |
[in] | cbData | Pointer to any user data structure. It will passed as one of the parameters in callback invocation. May be NULL. |
CC_MqttsnErrorCode cc_mqttsn_client_connect_cancel | ( | CC_MqttsnConnectHandle | handle | ) |
Cancel the allocated "connect" operation.
In case the cc_mqttsn_client_connect_send() function was successfully called before, the operation is cancelled without callback invocation.
[in] | handle | Handle returned by cc_mqttsn_client_connect_prepare() function. |
CC_MqttsnErrorCode cc_mqttsn_client_connect_config | ( | CC_MqttsnConnectHandle | handle, |
const CC_MqttsnConnectConfig * | config | ||
) |
Perform configuration of the "connect" operation.
[in] | handle | Handle returned by cc_mqttsn_client_connect_prepare() function. |
[in] | config | Configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
CC_MqttsnErrorCode cc_mqttsn_client_connect_config_will | ( | CC_MqttsnConnectHandle | handle, |
const CC_MqttsnWillConfig * | config | ||
) |
Perform will configuration of the "connect" operation.
[in] | handle | Handle returned by cc_mqttsn_client_connect_prepare() function. |
[in] | config | Configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
unsigned cc_mqttsn_client_connect_get_retry_count | ( | CC_MqttsnConnectHandle | handle | ) |
Retrieve the configured retry count for the "connect" operation.
[in] | handle | Handle returned by cc_mqttsn_client_connect_prepare() function. |
unsigned cc_mqttsn_client_connect_get_retry_period | ( | CC_MqttsnConnectHandle | handle | ) |
Retrieve the configured retry period for the "connect" operation.
[in] | handle | Handle returned by cc_mqttsn_client_connect_prepare() function. |
void cc_mqttsn_client_connect_init_config | ( | CC_MqttsnConnectConfig * | config | ) |
Intialize the CC_MqttsnConnectConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
void cc_mqttsn_client_connect_init_config_will | ( | CC_MqttsnWillConfig * | config | ) |
Intialize the CC_MqttsnWillConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
CC_MqttsnConnectHandle cc_mqttsn_client_connect_prepare | ( | CC_MqttsnClientHandle | client, |
CC_MqttsnErrorCode * | ec | ||
) |
Prepare "connect" operation.
[in] | client | Handle returned by cc_mqttsn_client_alloc() function. |
[out] | ec | Error code reporting result of the operation. Can be NULL. |
CC_MqttsnErrorCode cc_mqttsn_client_connect_send | ( | CC_MqttsnConnectHandle | handle, |
CC_MqttsnConnectCompleteCb | cb, | ||
void * | cbData | ||
) |
Send the "connect" operation.
[in] | handle | Handle returned by cc_mqttsn_client_connect_prepare() function. |
[in] | cb | Callback to be invoked when "connect" operation is complete. |
[in] | cbData | Pointer to any user data structure. It will passed as one of the parameters in callback invocation. May be NULL. |
CC_MqttsnErrorCode cc_mqttsn_client_connect_set_retry_count | ( | CC_MqttsnConnectHandle | handle, |
unsigned | count | ||
) |
Configure the retry count for the "connect" operation.
[in] | handle | Handle returned by cc_mqttsn_client_connect_prepare() function. |
[in] | count | Number of retries. |
CC_MqttsnErrorCode cc_mqttsn_client_connect_set_retry_period | ( | CC_MqttsnConnectHandle | handle, |
unsigned | ms | ||
) |
Configure the retry period for the "connect" operation.
[in] | handle | Handle returned by cc_mqttsn_client_connect_prepare() function. |
[in] | ms | Retry period in milliseconds. |
CC_MqttsnConnectionStatus cc_mqttsn_client_get_connection_status | ( | CC_MqttsnClientHandle | client | ) |
Check the inner state of the library of whether it's connected to the gateway.
[in] | client | Handle returned by cc_mqttsn_client_alloc() function. |