Library that provides a way to store and load Wi-Fi credentials.
More...
|
int | wifi_credentials_get_by_ssid_personal (const char *ssid, size_t ssid_len, enum wifi_security_type *type, uint8_t *bssid_buf, size_t bssid_buf_len, char *password_buf, size_t password_buf_len, size_t *password_len, uint32_t *flags, uint8_t *channel, uint32_t *timeout) |
| Get credentials for given SSID.
|
int | wifi_credentials_set_personal (const char *ssid, size_t ssid_len, enum wifi_security_type type, const uint8_t *bssid, size_t bssid_len, const char *password, size_t password_len, uint32_t flags, uint8_t channel, uint32_t timeout) |
| Set credentials for given SSID.
|
int | wifi_credentials_get_by_ssid_personal_struct (const char *ssid, size_t ssid_len, struct wifi_credentials_personal *buf) |
| Get credentials for given SSID by struct.
|
int | wifi_credentials_set_personal_struct (const struct wifi_credentials_personal *creds) |
| Set credentials for given SSID by struct.
|
int | wifi_credentials_delete_by_ssid (const char *ssid, size_t ssid_len) |
| Delete credentials for given SSID.
|
bool | wifi_credentials_is_empty (void) |
| Check if credentials storage is empty.
|
int | wifi_credentials_delete_all (void) |
| Deletes all stored Wi-Fi credentials.
|
void | wifi_credentials_for_each_ssid (wifi_credentials_ssid_cb cb, void *cb_arg) |
| Call callback for each registered SSID.
|
Library that provides a way to store and load Wi-Fi credentials.
- Since
- 4.0
- Version
- 0.1.0
◆ WIFI_CREDENTIALS_FLAG_2_4GHz
#define WIFI_CREDENTIALS_FLAG_2_4GHz BIT(2) |
◆ WIFI_CREDENTIALS_FLAG_5GHz
#define WIFI_CREDENTIALS_FLAG_5GHz BIT(3) |
◆ WIFI_CREDENTIALS_FLAG_6GHz
#define WIFI_CREDENTIALS_FLAG_6GHz BIT(4) |
◆ WIFI_CREDENTIALS_FLAG_ANONYMOUS_IDENTITY
#define WIFI_CREDENTIALS_FLAG_ANONYMOUS_IDENTITY BIT(7) |
◆ WIFI_CREDENTIALS_FLAG_BSSID
#define WIFI_CREDENTIALS_FLAG_BSSID BIT(0) |
◆ WIFI_CREDENTIALS_FLAG_FAVORITE
#define WIFI_CREDENTIALS_FLAG_FAVORITE BIT(1) |
◆ WIFI_CREDENTIALS_FLAG_KEY_PASSWORD
#define WIFI_CREDENTIALS_FLAG_KEY_PASSWORD BIT(8) |
◆ WIFI_CREDENTIALS_FLAG_MFP_DISABLED
#define WIFI_CREDENTIALS_FLAG_MFP_DISABLED BIT(6) |
◆ WIFI_CREDENTIALS_FLAG_MFP_REQUIRED
#define WIFI_CREDENTIALS_FLAG_MFP_REQUIRED BIT(5) |
◆ WIFI_CREDENTIALS_MAX_PASSWORD_LEN
#define WIFI_CREDENTIALS_MAX_PASSWORD_LEN MAX(WIFI_PSK_MAX_LEN, CONFIG_WIFI_CREDENTIALS_SAE_PASSWORD_LENGTH) |
◆ wifi_credentials_ssid_cb
typedef void(* wifi_credentials_ssid_cb) (void *cb_arg, const char *ssid, size_t ssid_len) |
◆ wifi_credentials_delete_all()
int wifi_credentials_delete_all |
( |
void | | ) |
|
◆ wifi_credentials_delete_by_ssid()
int wifi_credentials_delete_by_ssid |
( |
const char * | ssid, |
|
|
size_t | ssid_len ) |
◆ wifi_credentials_for_each_ssid()
◆ wifi_credentials_get_by_ssid_personal()
int wifi_credentials_get_by_ssid_personal |
( |
const char * | ssid, |
|
|
size_t | ssid_len, |
|
|
enum wifi_security_type * | type, |
|
|
uint8_t * | bssid_buf, |
|
|
size_t | bssid_buf_len, |
|
|
char * | password_buf, |
|
|
size_t | password_buf_len, |
|
|
size_t * | password_len, |
|
|
uint32_t * | flags, |
|
|
uint8_t * | channel, |
|
|
uint32_t * | timeout ) |
#include </home/runner/work/zephyr/zephyr/zephyr/include/zephyr/net/wifi_credentials.h>
Get credentials for given SSID.
- Parameters
-
[in] | ssid | SSID to look for |
[in] | ssid_len | length of SSID |
[out] | type | Wi-Fi security type |
[out] | bssid_buf | buffer to store BSSID if it was fixed |
[in] | bssid_buf_len | length of bssid_buf |
[out] | password_buf | buffer to store password |
[in] | password_buf_len | length of password_buf |
[out] | password_len | length of password |
[out] | flags | flags |
[out] | channel | channel |
[out] | timeout | timeout |
- Returns
- 0 Success.
-
-ENOENT No network with this SSID was found.
-
-EINVAL A required buffer was NULL or invalid SSID length.
-
-EPROTO The network with this SSID is not a personal network.
◆ wifi_credentials_get_by_ssid_personal_struct()
#include </home/runner/work/zephyr/zephyr/zephyr/include/zephyr/net/wifi_credentials.h>
Get credentials for given SSID by struct.
- Parameters
-
[in] | ssid | SSID to look for |
[in] | ssid_len | length of SSID |
[out] | buf | credentials Pointer to struct where credentials are stored |
- Returns
- 0 Success.
-
-ENOENT No network with this SSID was found.
-
-EINVAL A required buffer was NULL or too small.
-
-EPROTO The network with this SSID is not a personal network.
◆ wifi_credentials_is_empty()
bool wifi_credentials_is_empty |
( |
void | | ) |
|
◆ wifi_credentials_set_personal()
#include </home/runner/work/zephyr/zephyr/zephyr/include/zephyr/net/wifi_credentials.h>
Set credentials for given SSID.
- Parameters
-
[in] | ssid | SSID to look for |
[in] | ssid_len | length of SSID |
[in] | type | Wi-Fi security type |
[in] | bssid | BSSID (may be NULL) |
[in] | bssid_len | length of BSSID buffer (either 0 or WIFI_MAC_ADDR_LEN) |
[in] | password | password |
[in] | password_len | length of password |
[in] | flags | flags |
[in] | channel | Channel |
[in] | timeout | Timeout |
- Returns
- 0 Success. Credentials are stored in persistent storage.
-
-EINVAL A required buffer was NULL or security type is not supported.
-
-ENOTSUP Security type is not supported.
-
-ENOBUFS All slots are already taken.
◆ wifi_credentials_set_personal_struct()