CommsChampion Ecosystem MQTT-SN Client
MQTT-SN client library.
|
Classes | |
struct | CC_MqttsnSubscribeConfig |
Configuration the "subscribe" operation. More... | |
struct | CC_MqttsnSubscribeInfo |
Information on the "subscribe" operation completion. More... | |
Typedefs | |
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 struct CC_MqttsnUnsubscribe * | CC_MqttsnUnsubscribeHandle |
Handle for "unsubscribe" 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.
[in] | data | Pointer to user data object, passed as the last parameter to the request call. |
[in] | handle | Handle returned by cc_mqttsn_client_subscribe_prepare() function. When the callback is invoked the handle is already invalid and cannot be used in any relevant function invocation, but it allows end application to identify the original "subscribe" operation and use the same callback function in parallel requests. |
[in] | status | Status of the "subscribe" 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_MqttsnSubscribe* CC_MqttsnSubscribeHandle |
Handle for "subscribe" operation.
Returned by cc_mqttsn_client_subscribe_prepare() function.
typedef struct CC_MqttsnUnsubscribe* CC_MqttsnUnsubscribeHandle |
Handle for "unsubscribe" operation.
Returned by cc_mqttsn_client_unsubscribe_prepare() function.
CC_MqttsnErrorCode cc_mqttsn_client_subscribe | ( | CC_MqttsnClientHandle | client, |
const CC_MqttsnSubscribeConfig * | config, | ||
CC_MqttsnSubscribeCompleteCb | cb, | ||
void * | cbData | ||
) |
Prepare and send "subscribe" request in one go.
Abstracts away sequence of the following functions invocation:
[in] | client | Handle returned by cc_mqttsn_client_alloc() function. |
[in] | config | Subscription configuration. |
[in] | cb | Callback to be invoked when "subscribe" 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_subscribe_cancel | ( | CC_MqttsnSubscribeHandle | handle | ) |
Cancel the allocated "subscribe" operation.
In case the cc_mqttsn_client_subscribe_send() function was successfully called before, the operation is cancelled without callback invocation.
[in] | handle | Handle returned by cc_mqttsn_client_subscribe_prepare() function. |
CC_MqttsnErrorCode cc_mqttsn_client_subscribe_config | ( | CC_MqttsnSubscribeHandle | handle, |
const CC_MqttsnSubscribeConfig * | config | ||
) |
Perform configuration of the "subscribe" operation.
[in] | handle | Handle returned by cc_mqttsn_client_subscribe_prepare() function. |
[in] | config | Configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
unsigned cc_mqttsn_client_subscribe_get_retry_count | ( | CC_MqttsnSubscribeHandle | handle | ) |
Retrieve the configured retry count for the "subscribe" operation.
[in] | handle | Handle returned by cc_mqttsn_client_subscribe_prepare() function. |
unsigned cc_mqttsn_client_subscribe_get_retry_period | ( | CC_MqttsnSubscribeHandle | handle | ) |
Retrieve the configured retry period for the "subscribe" operation.
[in] | handle | Handle returned by cc_mqttsn_client_subscribe_prepare() function. |
void cc_mqttsn_client_subscribe_init_config | ( | CC_MqttsnSubscribeConfig * | config | ) |
Intialize the CC_MqttsnSubscribeConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
CC_MqttsnSubscribeHandle cc_mqttsn_client_subscribe_prepare | ( | CC_MqttsnClientHandle | client, |
CC_MqttsnErrorCode * | ec | ||
) |
Prepare "subscribe" 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_subscribe_send | ( | CC_MqttsnSubscribeHandle | handle, |
CC_MqttsnSubscribeCompleteCb | cb, | ||
void * | cbData | ||
) |
Send the "subscribe" operation.
[in] | handle | Handle returned by cc_mqttsn_client_subscribe_prepare() function. |
[in] | cb | Callback to be invoked when "subscribe" 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_subscribe_set_retry_count | ( | CC_MqttsnSubscribeHandle | handle, |
unsigned | count | ||
) |
Configure the retry count for the "subscribe" operation.
[in] | handle | Handle returned by cc_mqttsn_client_subscribe_prepare() function. |
[in] | count | Number of retries. |
CC_MqttsnErrorCode cc_mqttsn_client_subscribe_set_retry_period | ( | CC_MqttsnSubscribeHandle | handle, |
unsigned | ms | ||
) |
Configure the retry period for the "subscribe" operation.
[in] | handle | Handle returned by cc_mqttsn_client_subscribe_prepare() function. |
[in] | ms | Retry period in milliseconds. |