CommsChampion Ecosystem MQTT v5 Client
MQTT v5 Client Library.
|
Classes | |
struct | CC_Mqtt5ConnectBasicConfig |
Configuration structure to be passed to the cc_mqtt5_client_connect_config_basic(). More... | |
struct | CC_Mqtt5ConnectExtraConfig |
Extra properties configuration of the "connect" operation. More... | |
struct | CC_Mqtt5ConnectResponse |
Response information from broker to "connect" request. More... | |
struct | CC_Mqtt5ConnectWillConfig |
Configuration structure to be passed to the cc_mqtt5_client_connect_config_will(). More... | |
Typedefs | |
typedef void(* | CC_Mqtt5ConnectCompleteCb) (void *data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5ConnectResponse *response) |
Callback used to report completion of the "connect" operation. | |
typedef struct CC_Mqtt5Connect * | CC_Mqtt5ConnectHandle |
Handle for "connect" operation. | |
typedef void(* CC_Mqtt5ConnectCompleteCb) (void *data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5ConnectResponse *response) |
Callback used to report completion of the "connect" operation.
[in] | data | Pointer to user data object passed as last parameter to the cc_mqtt5_client_connect_send(). |
[in] | status | Status of the "connect" 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_Mqtt5Connect* CC_Mqtt5ConnectHandle |
Handle for "connect" operation.
Returned by cc_mqtt5_client_connect_prepare() function.
CC_Mqtt5ErrorCode cc_mqtt5_client_connect_add_user_prop | ( | CC_Mqtt5ConnectHandle | handle, |
const CC_Mqtt5UserProp * | prop | ||
) |
Add user property to the configuration of the "connect" operation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_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_connect_add_will_user_prop | ( | CC_Mqtt5ConnectHandle | handle, |
const CC_Mqtt5UserProp * | prop | ||
) |
Add user property to the will configuration of the "connect" operation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_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_connect_cancel | ( | CC_Mqtt5ConnectHandle | handle | ) |
Cancel the allocated "connect" operation.
In case the cc_mqtt5_client_connect_send() function was successfully called before, the operation is cancelled without callback invocation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_prepare() function. |
CC_Mqtt5ErrorCode cc_mqtt5_client_connect_config_auth | ( | CC_Mqtt5ConnectHandle | handle, |
const CC_Mqtt5AuthConfig * | config | ||
) |
Perform authentication handshake configuration of the "connect" operation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_prepare() function. |
[in] | config | Authentication configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
CC_Mqtt5ErrorCode cc_mqtt5_client_connect_config_basic | ( | CC_Mqtt5ConnectHandle | handle, |
const CC_Mqtt5ConnectBasicConfig * | config | ||
) |
Perform basic configuration of the "connect" operation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_prepare() function. |
[in] | config | Basic configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
CC_Mqtt5ErrorCode cc_mqtt5_client_connect_config_extra | ( | CC_Mqtt5ConnectHandle | handle, |
const CC_Mqtt5ConnectExtraConfig * | config | ||
) |
Perform extra properties configuration of the "connect" operation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_prepare() function. |
[in] | config | Extra properties configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
CC_Mqtt5ErrorCode cc_mqtt5_client_connect_config_will | ( | CC_Mqtt5ConnectHandle | handle, |
const CC_Mqtt5ConnectWillConfig * | config | ||
) |
Perform will configuration of the "connect" operation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_prepare() function. |
[in] | config | Will configuration structure. Must NOT be NULL. Does not need to be preserved after invocation. |
CC_Mqtt5ErrorCode cc_mqtt5_client_connect_full | ( | CC_Mqtt5ClientHandle | handle, |
const CC_Mqtt5ConnectBasicConfig * | basicConfig, | ||
const CC_Mqtt5ConnectWillConfig * | willConfig, | ||
const CC_Mqtt5ConnectExtraConfig * | extraConfig, | ||
const CC_Mqtt5AuthConfig * | authConfig, | ||
CC_Mqtt5ConnectCompleteCb | cb, | ||
void * | cbData | ||
) |
Prepare, configure, and send "connect" 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] | basicConfig | Basic configuration. Can be NULL. |
[in] | willConfig | Will configuration. Can be NULL. |
[in] | extraConfig | Extra configuration. Can be NULL. |
[in] | authConfig | Auth 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. |
unsigned cc_mqtt5_client_connect_get_response_timeout | ( | CC_Mqtt5ConnectHandle | handle | ) |
Retrieve the configured the broker response timeout for the "connect" operation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_prepare() function. |
void cc_mqtt5_client_connect_init_auth_info | ( | CC_Mqtt5AuthInfo * | info | ) |
Intialize the CC_Mqtt5AuthInfo configuration structure.
[out] | info | Authentication information structure. Must not be NULL. |
void cc_mqtt5_client_connect_init_config_auth | ( | CC_Mqtt5AuthConfig * | config | ) |
Intialize the CC_Mqtt5AuthConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
void cc_mqtt5_client_connect_init_config_basic | ( | CC_Mqtt5ConnectBasicConfig * | config | ) |
Intialize the CC_Mqtt5ConnectBasicConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
void cc_mqtt5_client_connect_init_config_extra | ( | CC_Mqtt5ConnectExtraConfig * | config | ) |
Intialize the CC_Mqtt5ConnectExtraConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
void cc_mqtt5_client_connect_init_config_will | ( | CC_Mqtt5ConnectWillConfig * | config | ) |
Intialize the CC_Mqtt5ConnectWillConfig configuration structure.
[out] | config | Configuration structure. Must not be NULL. |
CC_Mqtt5ConnectHandle cc_mqtt5_client_connect_prepare | ( | CC_Mqtt5ClientHandle | handle, |
CC_Mqtt5ErrorCode * | ec | ||
) |
Prepare "connect" operation.
For successful operation the client needs to be in the "disconnected" state and there are no other incomplete "connect" operation
[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_connect_send | ( | CC_Mqtt5ConnectHandle | handle, |
CC_Mqtt5ConnectCompleteCb | cb, | ||
void * | cbData | ||
) |
Send the configured "connect" operation to broker.
[in] | handle | Handle returned by cc_mqtt5_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_Mqtt5ErrorCode cc_mqtt5_client_connect_set_response_timeout | ( | CC_Mqtt5ConnectHandle | handle, |
unsigned | ms | ||
) |
Configure the broker response timeout for the "connect" operation.
[in] | handle | Handle returned by cc_mqtt5_client_connect_prepare() function. |
[in] | ms | Response timeout duration in milliseconds. |
CC_Mqtt5ErrorCode cc_mqtt5_client_connect_simple | ( | CC_Mqtt5ClientHandle | handle, |
const CC_Mqtt5ConnectBasicConfig * | basicConfig, | ||
CC_Mqtt5ConnectCompleteCb | cb, | ||
void * | cbData | ||
) |
Prepare, configure, and send "connect" 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] | basicConfig | Basic 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. |
bool cc_mqtt5_client_is_connected | ( | CC_Mqtt5ClientHandle | handle | ) |
Check the inner state of the library of whether it's connected to the broker.
[in] | handle | Handle returned by cc_mqtt5_client_alloc() function. |