CommsChampion Ecosystem MQTT-SN Client
MQTT-SN client library.
|
Classes | |
struct | CC_MqttsnPublishConfig |
Configuration the will for "publish" operations. More... | |
struct | CC_MqttsnPublishInfo |
Information on the "publish" operation completion. More... | |
Typedefs | |
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_MqttsnPublishCompleteCb) (void *data, CC_MqttsnPublishHandle handle, CC_MqttsnAsyncOpStatus status, const CC_MqttsnPublishInfo *info) |
Callback used to report completion of the publish 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_publish_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 "publish" operation and use the same callback function in parallel requests. |
[in] | status | Status of the "publish" operation. |
[in] | info | Information about op completion. Not-NULL is reported only if the "status" is equal to CC_MqttsnAsyncOpStatus_Complete. When QoS2 publish is successfully performed the "info" can still be NULL. |
typedef struct CC_MqttsnPublish* CC_MqttsnPublishHandle |
Handle for "publish" operation.
Returned by cc_mqttsn_client_publish_prepare() function.
CC_MqttsnErrorCode cc_mqttsn_client_publish | ( | CC_MqttsnClientHandle | client, |
const CC_MqttsnPublishConfig * | config, | ||
CC_MqttsnPublishCompleteCb | cb, | ||
void * | cbData | ||
) |
Prepare and send "publish" 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 "publish" 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_publish_cancel | ( | CC_MqttsnPublishHandle | handle | ) |
Cancel the allocated "publish" operation.
In case the cc_mqttsn_client_publish_send() function was successfully called before, the operation is cancelled without callback invocation.
[in] | handle | Handle returned by cc_mqttsn_client_publish_prepare() function. |
CC_MqttsnErrorCode cc_mqttsn_client_publish_config | ( | CC_MqttsnPublishHandle | handle, |
const CC_MqttsnPublishConfig * | config | ||
) |
Perform configuration of the "publish" operation.
[in] | handle | Handle returned by cc_mqttsn_client_publish_prepare() function. |
[in] | config | Configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
unsigned cc_mqttsn_client_publish_get_retry_count | ( | CC_MqttsnPublishHandle | handle | ) |
Retrieve the configured retry count for the "publish" operation.
[in] | handle | Handle returned by cc_mqttsn_client_publish_prepare() function. |
unsigned cc_mqttsn_client_publish_get_retry_period | ( | CC_MqttsnPublishHandle | handle | ) |
Retrieve the configured retry period for the "publish" operation.
[in] | handle | Handle returned by cc_mqttsn_client_publish_prepare() function. |
void cc_mqttsn_client_publish_init_config | ( | CC_MqttsnPublishConfig * | config | ) |
Intialize the CC_MqttsnPublishConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
CC_MqttsnPublishHandle cc_mqttsn_client_publish_prepare | ( | CC_MqttsnClientHandle | client, |
CC_MqttsnErrorCode * | ec | ||
) |
Prepare "publish" 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_publish_send | ( | CC_MqttsnPublishHandle | handle, |
CC_MqttsnPublishCompleteCb | cb, | ||
void * | cbData | ||
) |
Send the "publish" operation.
[in] | handle | Handle returned by cc_mqttsn_client_publish_prepare() function. |
[in] | cb | Callback to be invoked when "publish" 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_publish_set_retry_count | ( | CC_MqttsnPublishHandle | handle, |
unsigned | count | ||
) |
Configure the retry count for the "publish" operation.
[in] | handle | Handle returned by cc_mqttsn_client_publish_prepare() function. |
[in] | count | Number of retries. |
CC_MqttsnErrorCode cc_mqttsn_client_publish_set_retry_period | ( | CC_MqttsnPublishHandle | handle, |
unsigned | ms | ||
) |
Configure the retry period for the "publish" operation.
[in] | handle | Handle returned by cc_mqttsn_client_publish_prepare() function. |
[in] | ms | Retry period in milliseconds. |