Wi-Fi Credential#
Functions#
Store a credential in specified credential identifier.
Retrieve a stored credential.
Delete a stored credential.
Function Documentation#
sl_wifi_set_credential#
sl_status_t sl_wifi_set_credential (sl_wifi_credential_id_t id, sl_wifi_credential_type_t type, const void * credential, uint32_t credential_length)
Store a credential in specified credential identifier.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_wifi_credential_id_t | [in] | id | Credential identifier as identified by sl_wifi_credential_id_t. | 
| sl_wifi_credential_type_t | [in] | type | Credential type as identified by sl_wifi_credential_type_t. | 
| const void * | [in] | credential | Pointer to the credential data object. | 
| uint32_t | [in] | credential_length | Length of the credential data object. | 
This function stores the credential type and data for the specified credential ID. The credential data can include client credentials, access point credentials and user credentials (user credential is a generic credential identifier that can be configured to represent a specific credential type, such as TLS, MQTT, or HTTP, based on the chosen protocol).
Repeatedly calling this API with the same ID will overwrite the existing credential type and data.
- Pre-conditions: - sl_wifi_init should be called before this API. 
 
Returns
- sl_status_t. See Status Codes and WiSeConnect Status Codes for details. 
sl_wifi_get_credential#
sl_status_t sl_wifi_get_credential (sl_wifi_credential_id_t id, sl_wifi_credential_type_t * type, void * credential, uint32_t * credential_length)
Retrieve a stored credential.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_wifi_credential_id_t | [in] | id | Credential identifier as identified by sl_wifi_credential_id_t. | 
| sl_wifi_credential_type_t * | [out] | type | Credential type as identified by sl_wifi_credential_type_t. | 
| void * | [out] | credential | Pointer to location where credential data is stored. | 
| uint32_t * | [inout] | credential_length | in: Number of bytes available at credential. out: Number of bytes written. | 
This function retrieves the credential data for the specified credential ID. The retrieved credential data is stored in the provided credential object.
- Pre-conditions: - sl_wifi_init should be called before this API. 
 
Returns
- sl_status_t. See Status Codes and WiSeConnect Status Codes for details. 
sl_wifi_delete_credential#
sl_status_t sl_wifi_delete_credential (sl_wifi_credential_id_t id)
Delete a stored credential.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_wifi_credential_id_t | [in] | id | Credential identifier as identified by sl_wifi_credential_id_t. | 
This function deletes the credential data for the specific credential ID and type. Once deleted, the credential cannot be used further for any operations.
- Pre-conditions: - sl_wifi_init should be called before this API. 
 
Returns
- sl_status_t. See Status Codes and WiSeConnect Status Codes for details.