CommsChampion Ecosystem MQTT v5 Client
MQTT v5 Client Library.
|
Classes | |
struct | CC_Mqtt5UnsubscribeResponse |
Response information from broker to "unsubscribe" request. More... | |
struct | CC_Mqtt5UnsubscribeTopicConfig |
Topic filter configuration structure of the "unsubscribe" operation. More... | |
Typedefs | |
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. | |
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.
[in] | data | Pointer to user data object passed as last parameter to the cc_mqtt5_client_unsubscribe_send(). |
[in] | handle | Handle returned by cc_mqtt5_client_unsubscribe_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 "unsubscribe" operation and use the same callback function in parallel requests. |
[in] | status | Status of the "unsubscribe" operation. |
[in] | response | Response information from the broker. Not-NULL is reported if and onfly if the "status" is equal to CC_Mqtt5AsyncOpStatus_Complete. |
typedef struct CC_Mqtt5Unsubscribe* CC_Mqtt5UnsubscribeHandle |
Handle for "unsubscribe" operation.
Returned by cc_mqtt5_client_unsubscribe_prepare() function.
CC_Mqtt5ErrorCode cc_mqtt5_client_unsubscribe_add_user_prop | ( | CC_Mqtt5UnsubscribeHandle | handle, |
const CC_Mqtt5UserProp * | prop | ||
) |
Add user property to the configuration of the "unsubscribe" operation.
[in] | handle | Handle returned by cc_mqtt5_client_unsubscribe_prepare() function. |
[in] | prop | Single user property info. Must NOT be NULL. Does not need to be preserved after invocation. |
CC_Mqtt5ErrorCode cc_mqtt5_client_unsubscribe_cancel | ( | CC_Mqtt5UnsubscribeHandle | handle | ) |
Cancel the allocated "unsubscribe" operation.
In case the cc_mqtt5_client_unsubscribe_send() function was successfully called before, the operation is cancelled without callback invocation.
[in] | handle | Handle returned by cc_mqtt5_client_unsubscribe_prepare() function. |
CC_Mqtt5ErrorCode cc_mqtt5_client_unsubscribe_config_topic | ( | CC_Mqtt5UnsubscribeHandle | handle, |
const CC_Mqtt5UnsubscribeTopicConfig * | config | ||
) |
Add topic configuration of the "unsubscribe" operation.
[in] | handle | Handle returned by cc_mqtt5_client_unsubscribe_prepare() function. |
[in] | config | Topic configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
CC_Mqtt5ErrorCode cc_mqtt5_client_unsubscribe_full | ( | CC_Mqtt5ClientHandle | handle, |
const CC_Mqtt5UnsubscribeTopicConfig * | topicConfigs, | ||
unsigned | topicConfigsCount, | ||
CC_Mqtt5UnsubscribeCompleteCb | cb, | ||
void * | cbData | ||
) |
Prepare, configure, and send "unsubscribe" request in one go (full version)
Abstracts away sequence of the following functions invocation:
[in] | handle | Handle returned by cc_mqtt5_client_alloc() function. |
[in] | topicConfigs | Pointer to array of the topic configurations. |
[in] | topicConfigsCount | Amount of the topic configurations in the array. |
[in] | cb | Callback to be invoked when "unsubscribe" 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. |
unsigned cc_mqtt5_client_unsubscribe_get_response_timeout | ( | CC_Mqtt5UnsubscribeHandle | handle | ) |
Retrieve the configured the broker response timeout for the "unsubscribe" operation.
[in] | handle | Handle returned by cc_mqtt5_client_unsubscribe_prepare() function. |
void cc_mqtt5_client_unsubscribe_init_config_topic | ( | CC_Mqtt5UnsubscribeTopicConfig * | config | ) |
Intialize the CC_Mqtt5UnsubscribeTopicConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
CC_Mqtt5UnsubscribeHandle cc_mqtt5_client_unsubscribe_prepare | ( | CC_Mqtt5ClientHandle | handle, |
CC_Mqtt5ErrorCode * | ec | ||
) |
Prepare "unsubscribe" operation.
For successful operation the client needs to be in the "connected" state.
[in] | handle | Handle returned by cc_mqtt5_client_alloc() function. |
[out] | ec | Error code reporting result of the operation. Can be NULL. |
CC_Mqtt5ErrorCode cc_mqtt5_client_unsubscribe_send | ( | CC_Mqtt5UnsubscribeHandle | handle, |
CC_Mqtt5UnsubscribeCompleteCb | cb, | ||
void * | cbData | ||
) |
Send the configured "unsubscribe" operation to broker.
[in] | handle | Handle returned by cc_mqtt5_client_unsubscribe_prepare() function. |
[in] | cb | Callback to be invoked when "unsubscribe" 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_Mqtt5ErrorCode cc_mqtt5_client_unsubscribe_set_response_timeout | ( | CC_Mqtt5UnsubscribeHandle | handle, |
unsigned | ms | ||
) |
Configure the broker response timeout for the "unsubscribe" operation.
[in] | handle | Handle returned by cc_mqtt5_client_unsubscribe_prepare() function. |
[in] | ms | Response timeout duration in milliseconds. |
CC_Mqtt5ErrorCode cc_mqtt5_client_unsubscribe_simple | ( | CC_Mqtt5ClientHandle | handle, |
const CC_Mqtt5UnsubscribeTopicConfig * | topicConfig, | ||
CC_Mqtt5UnsubscribeCompleteCb | cb, | ||
void * | cbData | ||
) |
Prepare, configure, and send "unsubscribe" request in one go (simple version)
Abstracts away sequence of the following functions invocation:
[in] | handle | Handle returned by cc_mqtt5_client_alloc() function. |
[in] | topicConfig | Topic configuration. Can be NULL. |
[in] | cb | Callback to be invoked when "unsubscribe" 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. |