|
CommsChampion Ecosystem MQTT-SN Client
MQTT-SN client library.
|
Classes | |
| struct | CC_MqttsnGatewayInfo |
| Gateway information. More... | |
Typedefs | |
| 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_MqttsnSearchCompleteCb) (void *data, CC_MqttsnAsyncOpStatus status, const CC_MqttsnGatewayInfo *info) |
Callback used to report completion of the asynchronous operation.
| [in] | data | Pointer to user data object, passed as the last parameter to the request call. |
| [in] | status | Status of the asynchronous operation. |
| [in] | info | Discovered gateway information. Not NULL if and only if status is CC_MqttsnAsyncOpStatus_Complete. |
| typedef struct CC_MqttsnSearch* CC_MqttsnSearchHandle |
Handle for "search" operation.
Returned by cc_mqttsn_client_search_prepare() function.
| CC_MqttsnErrorCode cc_mqttsn_client_search | ( | CC_MqttsnClientHandle | handle, |
| CC_MqttsnSearchCompleteCb | cb, | ||
| void * | cbData | ||
| ) |
Prepare and send "search" request in one go.
Abstracts away sequence of the following functions invocation:
| [in] | handle | Handle returned by cc_mqttsn_client_alloc() function. |
| [in] | cb | Callback to be invoked when "search" 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_search_cancel | ( | CC_MqttsnSearchHandle | handle | ) |
Cancel the allocated "search" operation.
In case the cc_mqttsn_client_search_send() function was successfully called before, the operation is cancelled without callback invocation.
| [in] | handle | Handle returned by cc_mqttsn_client_search_prepare() function. |
| unsigned cc_mqttsn_client_search_get_broadcast_radius | ( | CC_MqttsnSearchHandle | handle | ) |
Retrieve the configured broadcast radius for the "search" operation.
| [in] | handle | Handle returned by cc_mqttsn_client_search_prepare() function. |
| unsigned cc_mqttsn_client_search_get_retry_count | ( | CC_MqttsnSearchHandle | handle | ) |
Retrieve the configured retry count for the "search" operation.
| [in] | handle | Handle returned by cc_mqttsn_client_search_prepare() function. |
| unsigned cc_mqttsn_client_search_get_retry_period | ( | CC_MqttsnSearchHandle | handle | ) |
Retrieve the configured retry period for the "search" operation.
| [in] | handle | Handle returned by cc_mqttsn_client_search_prepare() function. |
| CC_MqttsnSearchHandle cc_mqttsn_client_search_prepare | ( | CC_MqttsnClientHandle | client, |
| CC_MqttsnErrorCode * | ec | ||
| ) |
Prepare "search" 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_search_send | ( | CC_MqttsnSearchHandle | handle, |
| CC_MqttsnSearchCompleteCb | cb, | ||
| void * | cbData | ||
| ) |
Send the "search" operation.
| [in] | handle | Handle returned by cc_mqttsn_client_search_prepare() function. |
| [in] | cb | Callback to be invoked when "search" 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_search_set_broadcast_radius | ( | CC_MqttsnSearchHandle | handle, |
| unsigned | broadcastRadius | ||
| ) |
Configure the broadcast radius for the "search" operation.
| [in] | handle | Handle returned by cc_mqttsn_client_search_prepare() function. |
| [in] | broadcastRadius | Broadcast radius. |
| CC_MqttsnErrorCode cc_mqttsn_client_search_set_retry_count | ( | CC_MqttsnSearchHandle | handle, |
| unsigned | count | ||
| ) |
Configure the retry count for the "search" operation.
| [in] | handle | Handle returned by cc_mqttsn_client_search_prepare() function. |
| [in] | count | Number of retries. |
| CC_MqttsnErrorCode cc_mqttsn_client_search_set_retry_period | ( | CC_MqttsnSearchHandle | handle, |
| unsigned | ms | ||
| ) |
Configure the retry period for the "search" operation.
| [in] | handle | Handle returned by cc_mqttsn_client_search_prepare() function. |
| [in] | ms | Retry period in milliseconds. |