CommsChampion Ecosystem MQTT v5 Client
MQTT v5 Client Library.
Loading...
Searching...
No Matches
Typedefs | Functions
"Re-authenticate Operation Data Type and Functions"

Typedefs

typedef void(* CC_Mqtt5ReauthCompleteCb) (void *data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5AuthInfo *response)
 Callback used to report completion of the "reauth" operation.
 
typedef struct CC_Mqtt5Reauth * CC_Mqtt5ReauthHandle
 Handle for "reauth" operation.
 

Functions

CC_Mqtt5ErrorCode cc_mqtt5_client_reauth (CC_Mqtt5ClientHandle handle, const CC_Mqtt5AuthConfig *config, CC_Mqtt5ReauthCompleteCb cb, void *cbData)
 Prepare, configure, and send "reauth" request in one go.
 
CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_add_user_prop (CC_Mqtt5ReauthHandle handle, const CC_Mqtt5UserProp *prop)
 Add user property to the configuration of the "reauth" operation.
 
CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_cancel (CC_Mqtt5ReauthHandle handle)
 Cancel the allocated "reauth" operation.
 
CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_config_auth (CC_Mqtt5ReauthHandle handle, const CC_Mqtt5AuthConfig *config)
 Perform authentication handshake configuration of the "reauth" operation.
 
unsigned cc_mqtt5_client_reauth_get_response_timeout (CC_Mqtt5ReauthHandle handle)
 Retrieve the configured the broker response timeout for the "reauth" operation.
 
void cc_mqtt5_client_reauth_init_config_auth (CC_Mqtt5AuthConfig *config)
 Intialize the CC_Mqtt5AuthConfig configuration structure.
 
CC_Mqtt5ReauthHandle cc_mqtt5_client_reauth_prepare (CC_Mqtt5ClientHandle handle, CC_Mqtt5ErrorCode *ec)
 Prepare "reauth" operation.
 
CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_send (CC_Mqtt5ReauthHandle handle, CC_Mqtt5ReauthCompleteCb cb, void *cbData)
 Send the configured "reauth" operation to broker.
 
CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_set_response_timeout (CC_Mqtt5ReauthHandle handle, unsigned ms)
 Configure the broker response timeout for the "reauth" operation.
 

Detailed Description

Typedef Documentation

◆ CC_Mqtt5ReauthCompleteCb

typedef void(* CC_Mqtt5ReauthCompleteCb) (void *data, CC_Mqtt5AsyncOpStatus status, const CC_Mqtt5AuthInfo *response)

Callback used to report completion of the "reauth" operation.

Parameters
[in]dataPointer to user data object passed as last parameter to the cc_mqtt5_client_reauth_send().
[in]statusStatus of the "reauth" operation.
[in]responseResponse information from the broker. Not-NULL is reported if and onfly if the "status" is equal to CC_Mqtt5AsyncOpStatus_Complete.
Postcondition
The data members of the reported response can NOT be accessed after the function returns.

◆ CC_Mqtt5ReauthHandle

typedef struct CC_Mqtt5Reauth* CC_Mqtt5ReauthHandle

Handle for "reauth" operation.

Returned by cc_mqtt5_client_reauth_prepare() function.

Function Documentation

◆ cc_mqtt5_client_reauth()

CC_Mqtt5ErrorCode cc_mqtt5_client_reauth ( CC_Mqtt5ClientHandle  handle,
const CC_Mqtt5AuthConfig config,
CC_Mqtt5ReauthCompleteCb  cb,
void *  cbData 
)

Prepare, configure, and send "reauth" request in one go.

Abstracts away sequence of the following functions invocation:

Parameters
[in]handleHandle returned by cc_mqtt5_client_alloc() function.
[in]configAuth configuration.
[in]cbCallback to be invoked when "reauth" operation is complete.
[in]cbDataPointer to any user data structure. It will passed as one of the parameters in callback invocation. May be NULL.
Returns
Result code of the call.

◆ cc_mqtt5_client_reauth_add_user_prop()

CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_add_user_prop ( CC_Mqtt5ReauthHandle  handle,
const CC_Mqtt5UserProp prop 
)

Add user property to the configuration of the "reauth" operation.

Parameters
[in]handleHandle returned by cc_mqtt5_client_reauth_prepare() function.
[in]propSingle user property info. Must NOT be NULL. Does not need to be preserved after invocation.
Returns
Result code of the call.

◆ cc_mqtt5_client_reauth_cancel()

CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_cancel ( CC_Mqtt5ReauthHandle  handle)

Cancel the allocated "reauth" operation.

In case the cc_mqtt5_client_reauth_send() function was successfully called before, the operation is cancelled without callback invocation.

Parameters
[in]handleHandle returned by cc_mqtt5_client_reauth_prepare() function.
Returns
Result code of the call.
Postcondition
The handle of the "reauth" operation is no longer valid and must be discarded.

◆ cc_mqtt5_client_reauth_config_auth()

CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_config_auth ( CC_Mqtt5ReauthHandle  handle,
const CC_Mqtt5AuthConfig config 
)

Perform authentication handshake configuration of the "reauth" operation.

Parameters
[in]handleHandle returned by cc_mqtt5_client_reauth_prepare() function.
[in]configAuthentication configuration structure. Must NOT be NULL. Does not need to be preserved after invocation.
Returns
Result code of the call.
Precondition
Mustn't be called more than once for a single "reauth" operation.
Postcondition
Some of the properties can get assigned regardless of the return value.

◆ cc_mqtt5_client_reauth_get_response_timeout()

unsigned cc_mqtt5_client_reauth_get_response_timeout ( CC_Mqtt5ReauthHandle  handle)

Retrieve the configured the broker response timeout for the "reauth" operation.

Parameters
[in]handleHandle returned by cc_mqtt5_client_reauth_prepare() function.
Returns
Response timeout duration in milliseconds.

◆ cc_mqtt5_client_reauth_init_config_auth()

void cc_mqtt5_client_reauth_init_config_auth ( CC_Mqtt5AuthConfig config)

Intialize the CC_Mqtt5AuthConfig configuration structure.

Parameters
[out]configConfiguration structure. Must not be NULL.

◆ cc_mqtt5_client_reauth_prepare()

CC_Mqtt5ReauthHandle cc_mqtt5_client_reauth_prepare ( CC_Mqtt5ClientHandle  handle,
CC_Mqtt5ErrorCode ec 
)

Prepare "reauth" operation.

For successful operation the client needs to be in the "connected" state and there is no other incomplete "reauth" operation.

Parameters
[in]handleHandle returned by cc_mqtt5_client_alloc() function.
[out]ecError code reporting result of the operation. Can be NULL.
Returns
Handle of the "reauth" operation, will be NULL in case of failure. To analyze the reason failure use "ec" output parameter.
Postcondition
The "reauth" operation is allocated, use either cc_mqtt5_client_reauth_send() or cc_mqtt5_client_reauth_cancel() to prevent memory leaks.

◆ cc_mqtt5_client_reauth_send()

CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_send ( CC_Mqtt5ReauthHandle  handle,
CC_Mqtt5ReauthCompleteCb  cb,
void *  cbData 
)

Send the configured "reauth" operation to broker.

Parameters
[in]handleHandle returned by cc_mqtt5_client_reauth_prepare() function.
[in]cbCallback to be invoked when "reauth" operation is complete.
[in]cbDataPointer to any user data structure. It will passed as one of the parameters in callback invocation. May be NULL.
Returns
Result code of the call.
Postcondition
The handle of the "reauth" operation can be discarded.
The provided callback will be invoked when the "reauth" operation is complete if and only if the function returns CC_Mqtt5ErrorCode_Success.

◆ cc_mqtt5_client_reauth_set_response_timeout()

CC_Mqtt5ErrorCode cc_mqtt5_client_reauth_set_response_timeout ( CC_Mqtt5ReauthHandle  handle,
unsigned  ms 
)

Configure the broker response timeout for the "reauth" operation.

Parameters
[in]handleHandle returned by cc_mqtt5_client_reauth_prepare() function.
[in]msResponse timeout duration in milliseconds.
Returns
Result code of the call.