7#ifndef WIFI_CREDENTIALS_H__
8#define WIFI_CREDENTIALS_H__
10#include <zephyr/types.h>
11#include <zephyr/net/wifi.h>
12#include <zephyr/kernel.h>
25#define WIFI_CREDENTIALS_FLAG_BSSID BIT(0)
27#define WIFI_CREDENTIALS_FLAG_FAVORITE BIT(1)
29#define WIFI_CREDENTIALS_FLAG_2_4GHz BIT(2)
31#define WIFI_CREDENTIALS_FLAG_5GHz BIT(3)
33#define WIFI_CREDENTIALS_FLAG_MFP_REQUIRED BIT(4)
35#define WIFI_CREDENTIALS_FLAG_MFP_DISABLED BIT(5)
37#define WIFI_CREDENTIALS_MAX_PASSWORD_LEN\
38 MAX(WIFI_PSK_MAX_LEN, CONFIG_WIFI_CREDENTIALS_SAE_PASSWORD_LENGTH)
49 enum wifi_security_type
type;
50 char ssid[WIFI_SSID_MAX_LEN];
52 uint8_t
bssid[WIFI_MAC_ADDR_LEN];
110 enum wifi_security_type *
type,
112 size_t bssid_buf_len,
114 size_t password_buf_len,
115 size_t *password_len,
143 enum wifi_security_type
type,
144 const uint8_t *
bssid,
146 const char *password,
int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal *creds)
Set credentials for given SSID by struct.
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.
void(* wifi_credentials_ssid_cb)(void *cb_arg, const char *ssid, size_t ssid_len)
Callback type for wifi_credentials_for_each_ssid.
Definition: wifi_credentials.h:215
void wifi_credentials_for_each_ssid(wifi_credentials_ssid_cb cb, void *cb_arg)
Call callback for each registered 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.
bool wifi_credentials_is_empty(void)
Check if credentials storage is empty.
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_delete_by_ssid(const char *ssid, size_t ssid_len)
Delete credentials for given SSID.
int wifi_credentials_delete_all(void)
Deletes all stored Wi-Fi credentials.
#define WIFI_CREDENTIALS_MAX_PASSWORD_LEN
Definition: wifi_credentials.h:37
size_t client_cert_len
Definition: wifi_credentials.h:82
struct wifi_credentials_header header
Definition: wifi_credentials.h:77
size_t ca_cert_len
Definition: wifi_credentials.h:81
size_t private_key_len
Definition: wifi_credentials.h:83
size_t anonymous_identity_len
Definition: wifi_credentials.h:79
size_t identity_len
Definition: wifi_credentials.h:78
size_t private_key_pw_len
Definition: wifi_credentials.h:84
size_t password_len
Definition: wifi_credentials.h:80
Wi-Fi Enterprise credentials entry.
Definition: wifi_credentials.h:76
struct wifi_credentials_header header
Definition: wifi_credentials.h:67
char password[MAX(WIFI_PSK_MAX_LEN, CONFIG_WIFI_CREDENTIALS_SAE_PASSWORD_LENGTH)]
Definition: wifi_credentials.h:68
size_t password_len
Definition: wifi_credentials.h:69
Wi-Fi Personal credentials entry.
Definition: wifi_credentials.h:66