Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Wi-Fi Management

Wi-Fi Management API. More...

Data Structures

struct  wifi_version
 Wi-Fi version. More...
 
struct  wifi_band_channel
 Wi-Fi structure to uniquely identify a band-channel pair. More...
 
struct  wifi_scan_params
 Wi-Fi scan parameters structure. More...
 
struct  wifi_scan_result
 Wi-Fi scan result, each result is provided to the net_mgmt_event_callback via its info attribute (see net_mgmt.h) More...
 
struct  wifi_connect_req_params
 Wi-Fi connect request parameters. More...
 
struct  wifi_status
 Generic Wi-Fi status for commands and events. More...
 
struct  wifi_iface_status
 Wi-Fi interface status. More...
 
struct  wifi_ps_params
 Wi-Fi power save parameters. More...
 
struct  wifi_twt_params
 Wi-Fi TWT parameters. More...
 
struct  wifi_twt_flow_info
 Wi-Fi TWT flow information. More...
 
struct  wifi_ps_config
 Wi-Fi power save configuration. More...
 
struct  wifi_reg_chan_info
 Per-channel regulatory attributes. More...
 
struct  wifi_reg_domain
 Regulatory domain information or configuration. More...
 
struct  wifi_raw_scan_result
 Wi-Fi raw scan result. More...
 
struct  wifi_ap_sta_info
 AP mode - connected STA details. More...
 
union  wifi_mgmt_events
 
struct  wifi_mode_info
 Wi-Fi mode setup. More...
 
struct  wifi_filter_info
 Wi-Fi filter setting for monitor, prmoiscuous, TX-injection modes. More...
 
struct  wifi_channel_info
 Wi-Fi channel setting for monitor and TX-injection modes. More...
 
struct  wifi_mgmt_ops
 Wi-Fi management API. More...
 
struct  net_wifi_mgmt_offload
 Wi-Fi management offload API. More...
 

Macros

#define WIFI_COUNTRY_CODE_LEN   2
 
#define WIFI_LISTEN_INTERVAL_MIN   0
 
#define WIFI_LISTEN_INTERVAL_MAX   65535
 
#define WIFI_SSID_MAX_LEN   32
 
#define WIFI_PSK_MIN_LEN   8
 
#define WIFI_PSK_MAX_LEN   64
 
#define WIFI_SAE_PSWD_MAX_LEN   128
 
#define WIFI_MAC_ADDR_LEN   6
 
#define WIFI_CHANNEL_MIN   1
 
#define WIFI_CHANNEL_MAX   233
 
#define WIFI_CHANNEL_ANY   255
 
#define WIFI_INTERFACE_INDEX_MIN   1
 
#define WIFI_INTERFACE_INDEX_MAX   255
 
#define WIFI_MGMT_SCAN_SSID_FILT_MAX   1
 
#define WIFI_MGMT_SCAN_CHAN_MAX_MANUAL   1
 
#define WIFI_MGMT_BAND_STR_SIZE_MAX   8
 
#define WIFI_MGMT_SCAN_MAX_BSS_CNT   65535
 
#define NET_REQUEST_WIFI_SCAN    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_SCAN)
 
#define NET_REQUEST_WIFI_CONNECT    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONNECT)
 
#define NET_REQUEST_WIFI_DISCONNECT    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DISCONNECT)
 
#define NET_REQUEST_WIFI_AP_ENABLE    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_ENABLE)
 
#define NET_REQUEST_WIFI_AP_DISABLE    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_DISABLE)
 
#define NET_REQUEST_WIFI_IFACE_STATUS    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_IFACE_STATUS)
 
#define NET_REQUEST_WIFI_PS    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS)
 
#define NET_REQUEST_WIFI_TWT    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_TWT)
 
#define NET_REQUEST_WIFI_PS_CONFIG    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_CONFIG)
 
#define NET_REQUEST_WIFI_REG_DOMAIN    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_REG_DOMAIN)
 
#define NET_REQUEST_WIFI_MODE    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_MODE)
 
#define NET_REQUEST_WIFI_PACKET_FILTER    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PACKET_FILTER)
 
#define NET_REQUEST_WIFI_CHANNEL    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CHANNEL)
 
#define NET_REQUEST_WIFI_AP_STA_DISCONNECT    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_STA_DISCONNECT)
 
#define NET_REQUEST_WIFI_VERSION    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_VERSION)
 
#define NET_REQUEST_WIFI_RTS_THRESHOLD    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_RTS_THRESHOLD)
 
#define NET_EVENT_WIFI_SCAN_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_RESULT)
 
#define NET_EVENT_WIFI_SCAN_DONE    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_DONE)
 
#define NET_EVENT_WIFI_CONNECT_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_CONNECT_RESULT)
 
#define NET_EVENT_WIFI_DISCONNECT_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_RESULT)
 
#define NET_EVENT_WIFI_IFACE_STATUS    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_IFACE_STATUS)
 
#define NET_EVENT_WIFI_TWT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT)
 
#define NET_EVENT_WIFI_TWT_SLEEP_STATE    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE)
 
#define NET_EVENT_WIFI_RAW_SCAN_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT)
 
#define NET_EVENT_WIFI_DISCONNECT_COMPLETE    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE)
 
#define NET_EVENT_WIFI_AP_ENABLE_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT)
 
#define NET_EVENT_WIFI_AP_DISABLE_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT)
 
#define NET_EVENT_WIFI_AP_STA_CONNECTED    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_CONNECTED)
 
#define NET_EVENT_WIFI_AP_STA_DISCONNECTED    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED)
 
#define WIFI_MAX_TWT_FLOWS   8
 
#define WIFI_MAX_TWT_INTERVAL_US   (LONG_MAX - 1)
 
#define WIFI_MAX_TWT_WAKE_INTERVAL_US   262144
 
#define WIFI_MAX_TWT_WAKE_AHEAD_DURATION_US   (LONG_MAX - 1)
 
#define MAX_REG_CHAN_NUM   42
 

Typedefs

typedef void(* scan_result_cb_t) (struct net_if *iface, int status, struct wifi_scan_result *entry)
 Scan result callback.
 

Enumerations

enum  wifi_security_type {
  WIFI_SECURITY_TYPE_NONE = 0 , WIFI_SECURITY_TYPE_PSK , WIFI_SECURITY_TYPE_PSK_SHA256 , WIFI_SECURITY_TYPE_SAE ,
  WIFI_SECURITY_TYPE_WAPI , WIFI_SECURITY_TYPE_EAP , WIFI_SECURITY_TYPE_WEP , WIFI_SECURITY_TYPE_WPA_PSK ,
  __WIFI_SECURITY_TYPE_AFTER_LAST , WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1 , WIFI_SECURITY_TYPE_UNKNOWN
}
 IEEE 802.11 security types. More...
 
enum  wifi_mfp_options {
  WIFI_MFP_DISABLE = 0 , WIFI_MFP_OPTIONAL , WIFI_MFP_REQUIRED , __WIFI_MFP_AFTER_LAST ,
  WIFI_MFP_MAX = __WIFI_MFP_AFTER_LAST - 1 , WIFI_MFP_UNKNOWN
}
 IEEE 802.11w - Management frame protection. More...
 
enum  wifi_frequency_bands {
  WIFI_FREQ_BAND_2_4_GHZ = 0 , WIFI_FREQ_BAND_5_GHZ , WIFI_FREQ_BAND_6_GHZ , __WIFI_FREQ_BAND_AFTER_LAST ,
  WIFI_FREQ_BAND_MAX = __WIFI_FREQ_BAND_AFTER_LAST - 1 , WIFI_FREQ_BAND_UNKNOWN
}
 IEEE 802.11 operational frequency bands (not exhaustive). More...
 
enum  wifi_iface_state {
  WIFI_STATE_DISCONNECTED = 0 , WIFI_STATE_INTERFACE_DISABLED , WIFI_STATE_INACTIVE , WIFI_STATE_SCANNING ,
  WIFI_STATE_AUTHENTICATING , WIFI_STATE_ASSOCIATING , WIFI_STATE_ASSOCIATED , WIFI_STATE_4WAY_HANDSHAKE ,
  WIFI_STATE_GROUP_HANDSHAKE , WIFI_STATE_COMPLETED , __WIFI_STATE_AFTER_LAST , WIFI_STATE_MAX = __WIFI_STATE_AFTER_LAST - 1 ,
  WIFI_STATE_UNKNOWN
}
 Wi-Fi interface states. More...
 
enum  wifi_iface_mode {
  WIFI_MODE_INFRA = 0 , WIFI_MODE_IBSS = 1 , WIFI_MODE_AP = 2 , WIFI_MODE_P2P_GO = 3 ,
  WIFI_MODE_P2P_GROUP_FORMATION = 4 , WIFI_MODE_MESH = 5 , __WIFI_MODE_AFTER_LAST , WIFI_MODE_MAX = __WIFI_MODE_AFTER_LAST - 1 ,
  WIFI_MODE_UNKNOWN
}
 Wi-Fi interface modes. More...
 
enum  wifi_link_mode {
  WIFI_0 = 0 , WIFI_1 , WIFI_2 , WIFI_3 ,
  WIFI_4 , WIFI_5 , WIFI_6 , WIFI_6E ,
  WIFI_7 , __WIFI_LINK_MODE_AFTER_LAST , WIFI_LINK_MODE_MAX = __WIFI_LINK_MODE_AFTER_LAST - 1 , WIFI_LINK_MODE_UNKNOWN
}
 Wi-Fi link operating modes. More...
 
enum  wifi_scan_type { WIFI_SCAN_TYPE_ACTIVE = 0 , WIFI_SCAN_TYPE_PASSIVE }
 Wi-Fi scanning types. More...
 
enum  wifi_ps { WIFI_PS_DISABLED = 0 , WIFI_PS_ENABLED }
 Wi-Fi power save states. More...
 
enum  wifi_ps_mode { WIFI_PS_MODE_LEGACY = 0 , WIFI_PS_MODE_WMM }
 Wi-Fi power save modes. More...
 
enum  wifi_operational_modes {
  WIFI_STA_MODE = BIT(0) , WIFI_MONITOR_MODE = BIT(1) , WIFI_TX_INJECTION_MODE = BIT(2) , WIFI_PROMISCUOUS_MODE = BIT(3) ,
  WIFI_AP_MODE = BIT(4) , WIFI_SOFTAP_MODE = BIT(5)
}
 Wifi operational mode. More...
 
enum  wifi_filter { WIFI_PACKET_FILTER_ALL = BIT(0) , WIFI_PACKET_FILTER_MGMT = BIT(1) , WIFI_PACKET_FILTER_DATA = BIT(2) , WIFI_PACKET_FILTER_CTRL = BIT(3) }
 Mode filter settings. More...
 
enum  wifi_twt_operation { WIFI_TWT_SETUP = 0 , WIFI_TWT_TEARDOWN }
 Wi-Fi Target Wake Time (TWT) operations. More...
 
enum  wifi_twt_negotiation_type { WIFI_TWT_INDIVIDUAL = 0 , WIFI_TWT_BROADCAST , WIFI_TWT_WAKE_TBTT }
 Wi-Fi Target Wake Time (TWT) negotiation types. More...
 
enum  wifi_twt_setup_cmd {
  WIFI_TWT_SETUP_CMD_REQUEST = 0 , WIFI_TWT_SETUP_CMD_SUGGEST , WIFI_TWT_SETUP_CMD_DEMAND , WIFI_TWT_SETUP_CMD_GROUPING ,
  WIFI_TWT_SETUP_CMD_ACCEPT , WIFI_TWT_SETUP_CMD_ALTERNATE , WIFI_TWT_SETUP_CMD_DICTATE , WIFI_TWT_SETUP_CMD_REJECT
}
 Wi-Fi Target Wake Time (TWT) setup commands. More...
 
enum  wifi_twt_setup_resp_status { WIFI_TWT_RESP_RECEIVED = 0 , WIFI_TWT_RESP_NOT_RECEIVED }
 Wi-Fi Target Wake Time (TWT) negotiation status. More...
 
enum  wifi_twt_fail_reason {
  WIFI_TWT_FAIL_UNSPECIFIED , WIFI_TWT_FAIL_CMD_EXEC_FAIL , WIFI_TWT_FAIL_OPERATION_NOT_SUPPORTED , WIFI_TWT_FAIL_UNABLE_TO_GET_IFACE_STATUS ,
  WIFI_TWT_FAIL_DEVICE_NOT_CONNECTED , WIFI_TWT_FAIL_PEER_NOT_HE_CAPAB , WIFI_TWT_FAIL_PEER_NOT_TWT_CAPAB , WIFI_TWT_FAIL_OPERATION_IN_PROGRESS ,
  WIFI_TWT_FAIL_INVALID_FLOW_ID , WIFI_TWT_FAIL_IP_NOT_ASSIGNED , WIFI_TWT_FAIL_FLOW_ALREADY_EXISTS
}
 Target Wake Time (TWT) error codes. More...
 
enum  wifi_twt_teardown_status { WIFI_TWT_TEARDOWN_SUCCESS = 0 , WIFI_TWT_TEARDOWN_FAILED }
 Wi-Fi Target Wake Time (TWT) teradown status. More...
 
enum  wifi_ps_param_type {
  WIFI_PS_PARAM_STATE , WIFI_PS_PARAM_LISTEN_INTERVAL , WIFI_PS_PARAM_WAKEUP_MODE , WIFI_PS_PARAM_MODE ,
  WIFI_PS_PARAM_TIMEOUT
}
 Wi-Fi power save parameters. More...
 
enum  wifi_ps_wakeup_mode { WIFI_PS_WAKEUP_MODE_DTIM = 0 , WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL }
 Wi-Fi power save modes. More...
 
enum  wifi_config_ps_param_fail_reason {
  WIFI_PS_PARAM_FAIL_UNSPECIFIED , WIFI_PS_PARAM_FAIL_CMD_EXEC_FAIL , WIFI_PS_PARAM_FAIL_OPERATION_NOT_SUPPORTED , WIFI_PS_PARAM_FAIL_UNABLE_TO_GET_IFACE_STATUS ,
  WIFI_PS_PARAM_FAIL_DEVICE_NOT_CONNECTED , WIFI_PS_PARAM_FAIL_DEVICE_CONNECTED , WIFI_PS_PARAM_LISTEN_INTERVAL_RANGE_INVALID
}
 Wi-Fi power save error codes. More...
 
enum  net_request_wifi_cmd {
  NET_REQUEST_WIFI_CMD_SCAN = 1 , NET_REQUEST_WIFI_CMD_CONNECT , NET_REQUEST_WIFI_CMD_DISCONNECT , NET_REQUEST_WIFI_CMD_AP_ENABLE ,
  NET_REQUEST_WIFI_CMD_AP_DISABLE , NET_REQUEST_WIFI_CMD_IFACE_STATUS , NET_REQUEST_WIFI_CMD_PS , NET_REQUEST_WIFI_CMD_TWT ,
  NET_REQUEST_WIFI_CMD_PS_CONFIG , NET_REQUEST_WIFI_CMD_REG_DOMAIN , NET_REQUEST_WIFI_CMD_MODE , NET_REQUEST_WIFI_CMD_PACKET_FILTER ,
  NET_REQUEST_WIFI_CMD_CHANNEL , NET_REQUEST_WIFI_CMD_AP_STA_DISCONNECT , NET_REQUEST_WIFI_CMD_VERSION , NET_REQUEST_WIFI_CMD_RTS_THRESHOLD ,
  NET_REQUEST_WIFI_CMD_MAX
}
 Wi-Fi management commands. More...
 
enum  net_event_wifi_cmd {
  NET_EVENT_WIFI_CMD_SCAN_RESULT = 1 , NET_EVENT_WIFI_CMD_SCAN_DONE , NET_EVENT_WIFI_CMD_CONNECT_RESULT , NET_EVENT_WIFI_CMD_DISCONNECT_RESULT ,
  NET_EVENT_WIFI_CMD_IFACE_STATUS , NET_EVENT_WIFI_CMD_TWT , NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE , NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT ,
  NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE , NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT , NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT , NET_EVENT_WIFI_CMD_AP_STA_CONNECTED ,
  NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED
}
 Wi-Fi management events. More...
 
enum  wifi_conn_status {
  WIFI_STATUS_CONN_SUCCESS = 0 , WIFI_STATUS_CONN_FAIL , WIFI_STATUS_CONN_WRONG_PASSWORD , WIFI_STATUS_CONN_TIMEOUT ,
  WIFI_STATUS_CONN_AP_NOT_FOUND , WIFI_STATUS_CONN_LAST_STATUS , WIFI_STATUS_DISCONN_FIRST_STATUS = WIFI_STATUS_CONN_LAST_STATUS
}
 Wi-Fi connect result codes. More...
 
enum  wifi_disconn_reason { WIFI_REASON_DISCONN_UNSPECIFIED = WIFI_STATUS_DISCONN_FIRST_STATUS , WIFI_REASON_DISCONN_USER_REQUEST , WIFI_REASON_DISCONN_AP_LEAVING , WIFI_REASON_DISCONN_INACTIVITY }
 Wi-Fi disconnect reason codes. More...
 
enum  wifi_ap_status {
  WIFI_STATUS_AP_SUCCESS = 0 , WIFI_STATUS_AP_FAIL , WIFI_STATUS_AP_CHANNEL_NOT_SUPPORTED , WIFI_STATUS_AP_CHANNEL_NOT_ALLOWED ,
  WIFI_STATUS_AP_SSID_NOT_ALLOWED , WIFI_STATUS_AP_AUTH_TYPE_NOT_SUPPORTED , WIFI_STATUS_AP_OP_NOT_SUPPORTED , WIFI_STATUS_AP_OP_NOT_PERMITTED
}
 Wi-Fi AP mode result codes. More...
 
enum  wifi_mgmt_op { WIFI_MGMT_GET = 0 , WIFI_MGMT_SET = 1 }
 Generic get/set operation for any command. More...
 
enum  wifi_twt_sleep_state { WIFI_TWT_STATE_SLEEP = 0 , WIFI_TWT_STATE_AWAKE = 1 }
 Wi-Fi TWT sleep states. More...
 

Functions

const char * wifi_security_txt (enum wifi_security_type security)
 Helper function to get user-friendly security type name.
 
const char * wifi_mfp_txt (enum wifi_mfp_options mfp)
 Helper function to get user-friendly MFP name.
 
const char * wifi_band_txt (enum wifi_frequency_bands band)
 Helper function to get user-friendly frequency band name.
 
const char * wifi_state_txt (enum wifi_iface_state state)
 Helper function to get user-friendly interface state name.
 
const char * wifi_mode_txt (enum wifi_iface_mode mode)
 Helper function to get user-friendly interface mode name.
 
const char * wifi_link_mode_txt (enum wifi_link_mode link_mode)
 Helper function to get user-friendly link mode name.
 
const char * wifi_ps_txt (enum wifi_ps ps_name)
 Helper function to get user-friendly ps name.
 
const char * wifi_ps_mode_txt (enum wifi_ps_mode ps_mode)
 Helper function to get user-friendly ps mode name.
 
const char * wifi_twt_operation_txt (enum wifi_twt_operation twt_operation)
 Helper function to get user-friendly twt operation name.
 
const char * wifi_twt_negotiation_type_txt (enum wifi_twt_negotiation_type twt_negotiation)
 Helper function to get user-friendly twt negotiation type name.
 
const char * wifi_twt_setup_cmd_txt (enum wifi_twt_setup_cmd twt_setup)
 Helper function to get user-friendly twt setup cmd name.
 
static const char * wifi_twt_get_err_code_str (int16_t err_no)
 Helper function to get user-friendly TWT error code name.
 
const char * wifi_ps_wakeup_mode_txt (enum wifi_ps_wakeup_mode ps_wakeup_mode)
 Helper function to get user-friendly ps wakeup mode name.
 
static const char * wifi_ps_get_config_err_code_str (int16_t err_no)
 Helper function to get user-friendly power save error code name.
 
void wifi_mgmt_raise_connect_result_event (struct net_if *iface, int status)
 Wi-Fi management connect result event.
 
void wifi_mgmt_raise_disconnect_result_event (struct net_if *iface, int status)
 Wi-Fi management disconnect result event.
 
void wifi_mgmt_raise_iface_status_event (struct net_if *iface, struct wifi_iface_status *iface_status)
 Wi-Fi management interface status event.
 
void wifi_mgmt_raise_twt_event (struct net_if *iface, struct wifi_twt_params *twt_params)
 Wi-Fi management TWT event.
 
void wifi_mgmt_raise_twt_sleep_state (struct net_if *iface, int twt_sleep_state)
 Wi-Fi management TWT sleep state event.
 
void wifi_mgmt_raise_raw_scan_result_event (struct net_if *iface, struct wifi_raw_scan_result *raw_scan_info)
 Wi-Fi management raw scan result event.
 
void wifi_mgmt_raise_disconnect_complete_event (struct net_if *iface, int status)
 Wi-Fi management disconnect complete event.
 
void wifi_mgmt_raise_ap_enable_result_event (struct net_if *iface, enum wifi_ap_status status)
 Wi-Fi management AP mode enable result event.
 
void wifi_mgmt_raise_ap_disable_result_event (struct net_if *iface, enum wifi_ap_status status)
 Wi-Fi management AP mode disable result event.
 
void wifi_mgmt_raise_ap_sta_connected_event (struct net_if *iface, struct wifi_ap_sta_info *sta_info)
 Wi-Fi management AP mode STA connected event.
 
void wifi_mgmt_raise_ap_sta_disconnected_event (struct net_if *iface, struct wifi_ap_sta_info *sta_info)
 Wi-Fi management AP mode STA disconnected event.
 

Wi-Fi utility functions.

Utility functions for the Wi-Fi subsystem.

int wifi_utils_parse_scan_bands (char *scan_bands_str, uint8_t *band_map)
 Convert a band specification string to a bitmap representing the bands.
 
int wifi_utils_parse_scan_ssids (char *scan_ssids_str, const char *ssids[], uint8_t num_ssids)
 Append a string containing an SSID to an array of SSID strings.
 
int wifi_utils_parse_scan_chan (char *scan_chan_str, struct wifi_band_channel *chan, uint8_t max_channels)
 Convert a string containing a specification of scan channels to an array.
 
bool wifi_utils_validate_chan (uint8_t band, uint16_t chan)
 Validate a channel against a band.
 
bool wifi_utils_validate_chan_2g (uint16_t chan)
 Validate a channel against the 2.4 GHz band.
 
bool wifi_utils_validate_chan_5g (uint16_t chan)
 Validate a channel against the 5 GHz band.
 
bool wifi_utils_validate_chan_6g (uint16_t chan)
 Validate a channel against the 6 GHz band.
 
#define WIFI_UTILS_MAX_BAND_STR_LEN   3
 
#define WIFI_UTILS_MAX_CHAN_STR_LEN   4
 

Detailed Description

Wi-Fi Management API.

Macro Definition Documentation

◆ MAX_REG_CHAN_NUM

#define MAX_REG_CHAN_NUM   42

◆ NET_EVENT_WIFI_AP_DISABLE_RESULT

#define NET_EVENT_WIFI_AP_DISABLE_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT)

◆ NET_EVENT_WIFI_AP_ENABLE_RESULT

#define NET_EVENT_WIFI_AP_ENABLE_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT)

◆ NET_EVENT_WIFI_AP_STA_CONNECTED

#define NET_EVENT_WIFI_AP_STA_CONNECTED    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_CONNECTED)

◆ NET_EVENT_WIFI_AP_STA_DISCONNECTED

#define NET_EVENT_WIFI_AP_STA_DISCONNECTED    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED)

◆ NET_EVENT_WIFI_CONNECT_RESULT

#define NET_EVENT_WIFI_CONNECT_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_CONNECT_RESULT)

◆ NET_EVENT_WIFI_DISCONNECT_COMPLETE

#define NET_EVENT_WIFI_DISCONNECT_COMPLETE    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE)

◆ NET_EVENT_WIFI_DISCONNECT_RESULT

#define NET_EVENT_WIFI_DISCONNECT_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_RESULT)

◆ NET_EVENT_WIFI_IFACE_STATUS

#define NET_EVENT_WIFI_IFACE_STATUS    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_IFACE_STATUS)

◆ NET_EVENT_WIFI_RAW_SCAN_RESULT

#define NET_EVENT_WIFI_RAW_SCAN_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT)

◆ NET_EVENT_WIFI_SCAN_DONE

#define NET_EVENT_WIFI_SCAN_DONE    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_DONE)

◆ NET_EVENT_WIFI_SCAN_RESULT

#define NET_EVENT_WIFI_SCAN_RESULT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_RESULT)

◆ NET_EVENT_WIFI_TWT

#define NET_EVENT_WIFI_TWT    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT)

◆ NET_EVENT_WIFI_TWT_SLEEP_STATE

#define NET_EVENT_WIFI_TWT_SLEEP_STATE    (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE)

◆ NET_REQUEST_WIFI_AP_DISABLE

#define NET_REQUEST_WIFI_AP_DISABLE    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_DISABLE)

◆ NET_REQUEST_WIFI_AP_ENABLE

#define NET_REQUEST_WIFI_AP_ENABLE    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_ENABLE)

◆ NET_REQUEST_WIFI_AP_STA_DISCONNECT

#define NET_REQUEST_WIFI_AP_STA_DISCONNECT    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_STA_DISCONNECT)

◆ NET_REQUEST_WIFI_CHANNEL

#define NET_REQUEST_WIFI_CHANNEL    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CHANNEL)

◆ NET_REQUEST_WIFI_CONNECT

#define NET_REQUEST_WIFI_CONNECT    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONNECT)

◆ NET_REQUEST_WIFI_DISCONNECT

#define NET_REQUEST_WIFI_DISCONNECT    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DISCONNECT)

◆ NET_REQUEST_WIFI_IFACE_STATUS

#define NET_REQUEST_WIFI_IFACE_STATUS    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_IFACE_STATUS)

◆ NET_REQUEST_WIFI_MODE

#define NET_REQUEST_WIFI_MODE    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_MODE)

◆ NET_REQUEST_WIFI_PACKET_FILTER

#define NET_REQUEST_WIFI_PACKET_FILTER    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PACKET_FILTER)

◆ NET_REQUEST_WIFI_PS

#define NET_REQUEST_WIFI_PS    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS)

◆ NET_REQUEST_WIFI_PS_CONFIG

#define NET_REQUEST_WIFI_PS_CONFIG    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_CONFIG)

◆ NET_REQUEST_WIFI_REG_DOMAIN

#define NET_REQUEST_WIFI_REG_DOMAIN    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_REG_DOMAIN)

◆ NET_REQUEST_WIFI_RTS_THRESHOLD

#define NET_REQUEST_WIFI_RTS_THRESHOLD    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_RTS_THRESHOLD)

◆ NET_REQUEST_WIFI_SCAN

#define NET_REQUEST_WIFI_SCAN    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_SCAN)

◆ NET_REQUEST_WIFI_TWT

#define NET_REQUEST_WIFI_TWT    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_TWT)

◆ NET_REQUEST_WIFI_VERSION

#define NET_REQUEST_WIFI_VERSION    (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_VERSION)

◆ WIFI_CHANNEL_ANY

#define WIFI_CHANNEL_ANY   255

#include <zephyr/net/wifi.h>

◆ WIFI_CHANNEL_MAX

#define WIFI_CHANNEL_MAX   233

#include <zephyr/net/wifi.h>

◆ WIFI_CHANNEL_MIN

#define WIFI_CHANNEL_MIN   1

#include <zephyr/net/wifi.h>

◆ WIFI_COUNTRY_CODE_LEN

#define WIFI_COUNTRY_CODE_LEN   2

#include <zephyr/net/wifi.h>

◆ WIFI_INTERFACE_INDEX_MAX

#define WIFI_INTERFACE_INDEX_MAX   255

#include <zephyr/net/wifi.h>

◆ WIFI_INTERFACE_INDEX_MIN

#define WIFI_INTERFACE_INDEX_MIN   1

#include <zephyr/net/wifi.h>

◆ WIFI_LISTEN_INTERVAL_MAX

#define WIFI_LISTEN_INTERVAL_MAX   65535

#include <zephyr/net/wifi.h>

◆ WIFI_LISTEN_INTERVAL_MIN

#define WIFI_LISTEN_INTERVAL_MIN   0

#include <zephyr/net/wifi.h>

◆ WIFI_MAC_ADDR_LEN

#define WIFI_MAC_ADDR_LEN   6

#include <zephyr/net/wifi.h>

◆ WIFI_MAX_TWT_FLOWS

#define WIFI_MAX_TWT_FLOWS   8

◆ WIFI_MAX_TWT_INTERVAL_US

#define WIFI_MAX_TWT_INTERVAL_US   (LONG_MAX - 1)

◆ WIFI_MAX_TWT_WAKE_AHEAD_DURATION_US

#define WIFI_MAX_TWT_WAKE_AHEAD_DURATION_US   (LONG_MAX - 1)

◆ WIFI_MAX_TWT_WAKE_INTERVAL_US

#define WIFI_MAX_TWT_WAKE_INTERVAL_US   262144

◆ WIFI_MGMT_BAND_STR_SIZE_MAX

#define WIFI_MGMT_BAND_STR_SIZE_MAX   8

◆ WIFI_MGMT_SCAN_CHAN_MAX_MANUAL

#define WIFI_MGMT_SCAN_CHAN_MAX_MANUAL   1

◆ WIFI_MGMT_SCAN_MAX_BSS_CNT

#define WIFI_MGMT_SCAN_MAX_BSS_CNT   65535

◆ WIFI_MGMT_SCAN_SSID_FILT_MAX

#define WIFI_MGMT_SCAN_SSID_FILT_MAX   1

◆ WIFI_PSK_MAX_LEN

#define WIFI_PSK_MAX_LEN   64

#include <zephyr/net/wifi.h>

◆ WIFI_PSK_MIN_LEN

#define WIFI_PSK_MIN_LEN   8

#include <zephyr/net/wifi.h>

◆ WIFI_SAE_PSWD_MAX_LEN

#define WIFI_SAE_PSWD_MAX_LEN   128

#include <zephyr/net/wifi.h>

◆ WIFI_SSID_MAX_LEN

#define WIFI_SSID_MAX_LEN   32

#include <zephyr/net/wifi.h>

◆ WIFI_UTILS_MAX_BAND_STR_LEN

#define WIFI_UTILS_MAX_BAND_STR_LEN   3

◆ WIFI_UTILS_MAX_CHAN_STR_LEN

#define WIFI_UTILS_MAX_CHAN_STR_LEN   4

Typedef Documentation

◆ scan_result_cb_t

typedef void(* scan_result_cb_t) (struct net_if *iface, int status, struct wifi_scan_result *entry)

#include <zephyr/net/wifi_mgmt.h>

Scan result callback.

Parameters
ifaceNetwork interface
statusScan result status
entryScan result entry

Enumeration Type Documentation

◆ net_event_wifi_cmd

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management events.

Enumerator
NET_EVENT_WIFI_CMD_SCAN_RESULT 

Scan results available.

NET_EVENT_WIFI_CMD_SCAN_DONE 

Scan done.

NET_EVENT_WIFI_CMD_CONNECT_RESULT 

Connect result.

NET_EVENT_WIFI_CMD_DISCONNECT_RESULT 

Disconnect result.

NET_EVENT_WIFI_CMD_IFACE_STATUS 

Interface status.

NET_EVENT_WIFI_CMD_TWT 

TWT events.

NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE 

TWT sleep status: awake or sleeping, can be used by application to determine if it can send data or not.

NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT 

Raw scan results available.

NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE 

Disconnect complete.

NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT 

AP mode enable result.

NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT 

AP mode disable result.

NET_EVENT_WIFI_CMD_AP_STA_CONNECTED 

STA connected to AP.

NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED 

STA disconnected from AP.

◆ net_request_wifi_cmd

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management commands.

Enumerator
NET_REQUEST_WIFI_CMD_SCAN 

Scan for Wi-Fi networks.

NET_REQUEST_WIFI_CMD_CONNECT 

Connect to a Wi-Fi network.

NET_REQUEST_WIFI_CMD_DISCONNECT 

Disconnect from a Wi-Fi network.

NET_REQUEST_WIFI_CMD_AP_ENABLE 

Enable AP mode.

NET_REQUEST_WIFI_CMD_AP_DISABLE 

Disable AP mode.

NET_REQUEST_WIFI_CMD_IFACE_STATUS 

Get interface status.

NET_REQUEST_WIFI_CMD_PS 

Set power save status.

NET_REQUEST_WIFI_CMD_TWT 

Setup or teardown TWT flow.

NET_REQUEST_WIFI_CMD_PS_CONFIG 

Get power save config.

NET_REQUEST_WIFI_CMD_REG_DOMAIN 

Set or get regulatory domain.

NET_REQUEST_WIFI_CMD_MODE 

Set or get Mode of operation.

NET_REQUEST_WIFI_CMD_PACKET_FILTER 

Set or get packet filter setting for current mode.

NET_REQUEST_WIFI_CMD_CHANNEL 

Set or get Wi-Fi channel for Monitor or TX-Injection mode.

NET_REQUEST_WIFI_CMD_AP_STA_DISCONNECT 

Disconnect a STA from AP.

NET_REQUEST_WIFI_CMD_VERSION 

Get Wi-Fi driver and Firmware versions.

NET_REQUEST_WIFI_CMD_RTS_THRESHOLD 

Set RTS threshold.

NET_REQUEST_WIFI_CMD_MAX 

◆ wifi_ap_status

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi AP mode result codes.

To be overlaid on top of wifi_status in the AP mode enable or disable result event for detailed status.

Enumerator
WIFI_STATUS_AP_SUCCESS 

AP mode enable or disable successful.

WIFI_STATUS_AP_FAIL 

AP mode enable or disable failed - generic failure.

WIFI_STATUS_AP_CHANNEL_NOT_SUPPORTED 

AP mode enable failed - channel not supported.

WIFI_STATUS_AP_CHANNEL_NOT_ALLOWED 

AP mode enable failed - channel not allowed.

WIFI_STATUS_AP_SSID_NOT_ALLOWED 

AP mode enable failed - SSID not allowed.

WIFI_STATUS_AP_AUTH_TYPE_NOT_SUPPORTED 

AP mode enable failed - authentication type not supported.

WIFI_STATUS_AP_OP_NOT_SUPPORTED 

AP mode enable failed - operation not supported.

WIFI_STATUS_AP_OP_NOT_PERMITTED 

AP mode enable failed - operation not permitted.

◆ wifi_config_ps_param_fail_reason

#include <zephyr/net/wifi.h>

Wi-Fi power save error codes.

Enumerator
WIFI_PS_PARAM_FAIL_UNSPECIFIED 

Unspecified error.

WIFI_PS_PARAM_FAIL_CMD_EXEC_FAIL 

Command execution failed.

WIFI_PS_PARAM_FAIL_OPERATION_NOT_SUPPORTED 

Parameter not supported.

WIFI_PS_PARAM_FAIL_UNABLE_TO_GET_IFACE_STATUS 

Unable to get interface status.

WIFI_PS_PARAM_FAIL_DEVICE_NOT_CONNECTED 

Device not connected to AP.

WIFI_PS_PARAM_FAIL_DEVICE_CONNECTED 

Device already connected to AP.

WIFI_PS_PARAM_LISTEN_INTERVAL_RANGE_INVALID 

Listen interval out of range.

◆ wifi_conn_status

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi connect result codes.

To be overlaid on top of wifi_status in the connect result event for detailed status.

Enumerator
WIFI_STATUS_CONN_SUCCESS 

Connection successful.

WIFI_STATUS_CONN_FAIL 

Connection failed - generic failure.

WIFI_STATUS_CONN_WRONG_PASSWORD 

Connection failed - wrong password Few possible reasons for 4-way handshake failure that we can guess are as follows: 1) Incorrect key 2) EAPoL frames lost causing timeout.

#1 is the likely cause, so, we convey to the user that it is due to Wrong passphrase/password.

WIFI_STATUS_CONN_TIMEOUT 

Connection timed out.

WIFI_STATUS_CONN_AP_NOT_FOUND 

Connection failed - AP not found.

WIFI_STATUS_CONN_LAST_STATUS 

Last connection status.

WIFI_STATUS_DISCONN_FIRST_STATUS 

Connection disconnected status.

◆ wifi_disconn_reason

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi disconnect reason codes.

To be overlaid on top of wifi_status in the disconnect result event for detailed reason.

Enumerator
WIFI_REASON_DISCONN_UNSPECIFIED 

Unspecified reason.

WIFI_REASON_DISCONN_USER_REQUEST 

Disconnected due to user request.

WIFI_REASON_DISCONN_AP_LEAVING 

Disconnected due to AP leaving.

WIFI_REASON_DISCONN_INACTIVITY 

Disconnected due to inactivity.

◆ wifi_filter

#include <zephyr/net/wifi.h>

Mode filter settings.

Enumerator
WIFI_PACKET_FILTER_ALL 

Support management, data and control packet sniffing.

WIFI_PACKET_FILTER_MGMT 

Support only sniffing of management packets.

WIFI_PACKET_FILTER_DATA 

Support only sniffing of data packets.

WIFI_PACKET_FILTER_CTRL 

Support only sniffing of control packets.

◆ wifi_frequency_bands

#include <zephyr/net/wifi.h>

IEEE 802.11 operational frequency bands (not exhaustive).

Enumerator
WIFI_FREQ_BAND_2_4_GHZ 

2.4 GHz band.

WIFI_FREQ_BAND_5_GHZ 

5 GHz band.

WIFI_FREQ_BAND_6_GHZ 

6 GHz band (Wi-Fi 6E, also extends to 7GHz).

WIFI_FREQ_BAND_MAX 

Highest frequency band available.

WIFI_FREQ_BAND_UNKNOWN 

Invalid frequency band.

◆ wifi_iface_mode

#include <zephyr/net/wifi.h>

Wi-Fi interface modes.

Based on https://w1.fi/wpa_supplicant/devel/defs_8h.html#a4aeb27c1e4abd046df3064ea9756f0bc

Enumerator
WIFI_MODE_INFRA 

Infrastructure station mode.

WIFI_MODE_IBSS 

IBSS (ad-hoc) station mode.

WIFI_MODE_AP 

AP mode.

WIFI_MODE_P2P_GO 

P2P group owner mode.

WIFI_MODE_P2P_GROUP_FORMATION 

P2P group formation mode.

WIFI_MODE_MESH 

802.11s Mesh mode.

WIFI_MODE_MAX 
WIFI_MODE_UNKNOWN 

◆ wifi_iface_state

#include <zephyr/net/wifi.h>

Wi-Fi interface states.

Based on https://w1.fi/wpa_supplicant/devel/defs_8h.html#a4aeb27c1e4abd046df3064ea9756f0bc

Enumerator
WIFI_STATE_DISCONNECTED 

Interface is disconnected.

WIFI_STATE_INTERFACE_DISABLED 

Interface is disabled (administratively).

WIFI_STATE_INACTIVE 

No enabled networks in the configuration.

WIFI_STATE_SCANNING 

Interface is scanning for networks.

WIFI_STATE_AUTHENTICATING 

Authentication with a network is in progress.

WIFI_STATE_ASSOCIATING 

Association with a network is in progress.

WIFI_STATE_ASSOCIATED 

Association with a network completed.

WIFI_STATE_4WAY_HANDSHAKE 

4-way handshake with a network is in progress.

WIFI_STATE_GROUP_HANDSHAKE 

Group Key exchange with a network is in progress.

WIFI_STATE_COMPLETED 

All authentication completed, ready to pass data.

WIFI_STATE_MAX 
WIFI_STATE_UNKNOWN 

◆ wifi_link_mode

#include <zephyr/net/wifi.h>

Wi-Fi link operating modes.

As per https://en.wikipedia.org/wiki/Wi-Fi#Versions_and_generations.

Enumerator
WIFI_0 

802.11 (legacy).

WIFI_1 

802.11b.

WIFI_2 

802.11a.

WIFI_3 

802.11g.

WIFI_4 

802.11n.

WIFI_5 

802.11ac.

WIFI_6 

802.11ax.

WIFI_6E 

802.11ax 6GHz.

WIFI_7 

802.11be.

WIFI_LINK_MODE_MAX 
WIFI_LINK_MODE_UNKNOWN 

◆ wifi_mfp_options

#include <zephyr/net/wifi.h>

IEEE 802.11w - Management frame protection.

Enumerator
WIFI_MFP_DISABLE 

MFP disabled.

WIFI_MFP_OPTIONAL 

MFP optional.

WIFI_MFP_REQUIRED 

MFP required.

WIFI_MFP_MAX 
WIFI_MFP_UNKNOWN 

◆ wifi_mgmt_op

#include <zephyr/net/wifi_mgmt.h>

Generic get/set operation for any command.

Enumerator
WIFI_MGMT_GET 

Get operation.

WIFI_MGMT_SET 

Set operation.

◆ wifi_operational_modes

#include <zephyr/net/wifi.h>

Wifi operational mode.

Enumerator
WIFI_STA_MODE 

STA mode setting enable.

WIFI_MONITOR_MODE 

Monitor mode setting enable.

WIFI_TX_INJECTION_MODE 

TX injection mode setting enable.

WIFI_PROMISCUOUS_MODE 

Promiscuous mode setting enable.

WIFI_AP_MODE 

AP mode setting enable.

WIFI_SOFTAP_MODE 

Softap mode setting enable.

◆ wifi_ps

enum wifi_ps

#include <zephyr/net/wifi.h>

Wi-Fi power save states.

Enumerator
WIFI_PS_DISABLED 

Power save disabled.

WIFI_PS_ENABLED 

Power save enabled.

◆ wifi_ps_mode

#include <zephyr/net/wifi.h>

Wi-Fi power save modes.

Enumerator
WIFI_PS_MODE_LEGACY 

Legacy power save mode.

WIFI_PS_MODE_WMM 

WMM power save mode.

◆ wifi_ps_param_type

#include <zephyr/net/wifi.h>

Wi-Fi power save parameters.

Enumerator
WIFI_PS_PARAM_STATE 

Power save state.

WIFI_PS_PARAM_LISTEN_INTERVAL 

Power save listen interval.

WIFI_PS_PARAM_WAKEUP_MODE 

Power save wakeup mode.

WIFI_PS_PARAM_MODE 

Power save mode.

WIFI_PS_PARAM_TIMEOUT 

Power save timeout.

◆ wifi_ps_wakeup_mode

#include <zephyr/net/wifi.h>

Wi-Fi power save modes.

Enumerator
WIFI_PS_WAKEUP_MODE_DTIM 

DTIM based wakeup.

WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL 

Listen interval based wakeup.

◆ wifi_scan_type

#include <zephyr/net/wifi.h>

Wi-Fi scanning types.

Enumerator
WIFI_SCAN_TYPE_ACTIVE 

Active scanning (default).

WIFI_SCAN_TYPE_PASSIVE 

Passive scanning.

◆ wifi_security_type

#include <zephyr/net/wifi.h>

IEEE 802.11 security types.

Enumerator
WIFI_SECURITY_TYPE_NONE 

No security.

WIFI_SECURITY_TYPE_PSK 

WPA2-PSK security.

WIFI_SECURITY_TYPE_PSK_SHA256 

WPA2-PSK-SHA256 security.

WIFI_SECURITY_TYPE_SAE 

WPA3-SAE security.

WIFI_SECURITY_TYPE_WAPI 

GB 15629.11-2003 WAPI security.

WIFI_SECURITY_TYPE_EAP 

EAP security - Enterprise.

WIFI_SECURITY_TYPE_WEP 

WEP security.

WIFI_SECURITY_TYPE_WPA_PSK 

WPA-PSK security.

WIFI_SECURITY_TYPE_MAX 
WIFI_SECURITY_TYPE_UNKNOWN 

◆ wifi_twt_fail_reason

#include <zephyr/net/wifi.h>

Target Wake Time (TWT) error codes.

Enumerator
WIFI_TWT_FAIL_UNSPECIFIED 

Unspecified error.

WIFI_TWT_FAIL_CMD_EXEC_FAIL 

Command execution failed.

WIFI_TWT_FAIL_OPERATION_NOT_SUPPORTED 

Operation not supported.

WIFI_TWT_FAIL_UNABLE_TO_GET_IFACE_STATUS 

Unable to get interface status.

WIFI_TWT_FAIL_DEVICE_NOT_CONNECTED 

Device not connected to AP.

WIFI_TWT_FAIL_PEER_NOT_HE_CAPAB 

Peer not HE (802.11ax/Wi-Fi 6) capable.

WIFI_TWT_FAIL_PEER_NOT_TWT_CAPAB 

Peer not TWT capable.

WIFI_TWT_FAIL_OPERATION_IN_PROGRESS 

A TWT flow is already in progress.

WIFI_TWT_FAIL_INVALID_FLOW_ID 

Invalid negotiated flow id.

WIFI_TWT_FAIL_IP_NOT_ASSIGNED 

IP address not assigned or configured.

WIFI_TWT_FAIL_FLOW_ALREADY_EXISTS 

Flow already exists.

◆ wifi_twt_negotiation_type

#include <zephyr/net/wifi.h>

Wi-Fi Target Wake Time (TWT) negotiation types.

Enumerator
WIFI_TWT_INDIVIDUAL 

TWT individual negotiation.

WIFI_TWT_BROADCAST 

TWT broadcast negotiation.

WIFI_TWT_WAKE_TBTT 

TWT wake TBTT negotiation.

◆ wifi_twt_operation

#include <zephyr/net/wifi.h>

Wi-Fi Target Wake Time (TWT) operations.

Enumerator
WIFI_TWT_SETUP 

TWT setup operation.

WIFI_TWT_TEARDOWN 

TWT teardown operation.

◆ wifi_twt_setup_cmd

#include <zephyr/net/wifi.h>

Wi-Fi Target Wake Time (TWT) setup commands.

Enumerator
WIFI_TWT_SETUP_CMD_REQUEST 

TWT setup request.

WIFI_TWT_SETUP_CMD_SUGGEST 

TWT setup suggest (parameters can be changed by AP)

WIFI_TWT_SETUP_CMD_DEMAND 

TWT setup demand (parameters can not be changed by AP)

WIFI_TWT_SETUP_CMD_GROUPING 

TWT setup grouping (grouping of TWT flows)

WIFI_TWT_SETUP_CMD_ACCEPT 

TWT setup accept (parameters accepted by AP)

WIFI_TWT_SETUP_CMD_ALTERNATE 

TWT setup alternate (alternate parameters suggested by AP)

WIFI_TWT_SETUP_CMD_DICTATE 

TWT setup dictate (parameters dictated by AP)

WIFI_TWT_SETUP_CMD_REJECT 

TWT setup reject (parameters rejected by AP)

◆ wifi_twt_setup_resp_status

#include <zephyr/net/wifi.h>

Wi-Fi Target Wake Time (TWT) negotiation status.

Enumerator
WIFI_TWT_RESP_RECEIVED 

TWT response received for TWT request.

WIFI_TWT_RESP_NOT_RECEIVED 

TWT response not received for TWT request.

◆ wifi_twt_sleep_state

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi TWT sleep states.

Enumerator
WIFI_TWT_STATE_SLEEP 

TWT sleep state: sleeping.

WIFI_TWT_STATE_AWAKE 

TWT sleep state: awake.

◆ wifi_twt_teardown_status

#include <zephyr/net/wifi.h>

Wi-Fi Target Wake Time (TWT) teradown status.

Enumerator
WIFI_TWT_TEARDOWN_SUCCESS 

TWT teardown success.

WIFI_TWT_TEARDOWN_FAILED 

TWT teardown failure.

Function Documentation

◆ wifi_band_txt()

const char * wifi_band_txt ( enum wifi_frequency_bands  band)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly frequency band name.

◆ wifi_link_mode_txt()

const char * wifi_link_mode_txt ( enum wifi_link_mode  link_mode)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly link mode name.

◆ wifi_mfp_txt()

const char * wifi_mfp_txt ( enum wifi_mfp_options  mfp)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly MFP name.

◆ wifi_mgmt_raise_ap_disable_result_event()

void wifi_mgmt_raise_ap_disable_result_event ( struct net_if iface,
enum wifi_ap_status  status 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management AP mode disable result event.

Parameters
ifaceNetwork interface
statusAP mode disable result status

◆ wifi_mgmt_raise_ap_enable_result_event()

void wifi_mgmt_raise_ap_enable_result_event ( struct net_if iface,
enum wifi_ap_status  status 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management AP mode enable result event.

Parameters
ifaceNetwork interface
statusAP mode enable result status

◆ wifi_mgmt_raise_ap_sta_connected_event()

void wifi_mgmt_raise_ap_sta_connected_event ( struct net_if iface,
struct wifi_ap_sta_info sta_info 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management AP mode STA connected event.

Parameters
ifaceNetwork interface
sta_infoSTA information

◆ wifi_mgmt_raise_ap_sta_disconnected_event()

void wifi_mgmt_raise_ap_sta_disconnected_event ( struct net_if iface,
struct wifi_ap_sta_info sta_info 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management AP mode STA disconnected event.

Parameters
ifaceNetwork interface
sta_infoSTA information

◆ wifi_mgmt_raise_connect_result_event()

void wifi_mgmt_raise_connect_result_event ( struct net_if iface,
int  status 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management connect result event.

Parameters
ifaceNetwork interface
statusConnect result status

◆ wifi_mgmt_raise_disconnect_complete_event()

void wifi_mgmt_raise_disconnect_complete_event ( struct net_if iface,
int  status 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management disconnect complete event.

Parameters
ifaceNetwork interface
statusDisconnect complete status

◆ wifi_mgmt_raise_disconnect_result_event()

void wifi_mgmt_raise_disconnect_result_event ( struct net_if iface,
int  status 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management disconnect result event.

Parameters
ifaceNetwork interface
statusDisconnect result status

◆ wifi_mgmt_raise_iface_status_event()

void wifi_mgmt_raise_iface_status_event ( struct net_if iface,
struct wifi_iface_status iface_status 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management interface status event.

Parameters
ifaceNetwork interface
iface_statusInterface status

◆ wifi_mgmt_raise_raw_scan_result_event()

void wifi_mgmt_raise_raw_scan_result_event ( struct net_if iface,
struct wifi_raw_scan_result raw_scan_info 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management raw scan result event.

Parameters
ifaceNetwork interface
raw_scan_infoRaw scan result

◆ wifi_mgmt_raise_twt_event()

void wifi_mgmt_raise_twt_event ( struct net_if iface,
struct wifi_twt_params twt_params 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management TWT event.

Parameters
ifaceNetwork interface
twt_paramsTWT parameters

◆ wifi_mgmt_raise_twt_sleep_state()

void wifi_mgmt_raise_twt_sleep_state ( struct net_if iface,
int  twt_sleep_state 
)

#include <zephyr/net/wifi_mgmt.h>

Wi-Fi management TWT sleep state event.

Parameters
ifaceNetwork interface
twt_sleep_stateTWT sleep state

◆ wifi_mode_txt()

const char * wifi_mode_txt ( enum wifi_iface_mode  mode)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly interface mode name.

◆ wifi_ps_get_config_err_code_str()

static const char * wifi_ps_get_config_err_code_str ( int16_t  err_no)
inlinestatic

#include <zephyr/net/wifi.h>

Helper function to get user-friendly power save error code name.

◆ wifi_ps_mode_txt()

const char * wifi_ps_mode_txt ( enum wifi_ps_mode  ps_mode)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly ps mode name.

◆ wifi_ps_txt()

const char * wifi_ps_txt ( enum wifi_ps  ps_name)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly ps name.

◆ wifi_ps_wakeup_mode_txt()

const char * wifi_ps_wakeup_mode_txt ( enum wifi_ps_wakeup_mode  ps_wakeup_mode)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly ps wakeup mode name.

◆ wifi_security_txt()

const char * wifi_security_txt ( enum wifi_security_type  security)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly security type name.

◆ wifi_state_txt()

const char * wifi_state_txt ( enum wifi_iface_state  state)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly interface state name.

◆ wifi_twt_get_err_code_str()

static const char * wifi_twt_get_err_code_str ( int16_t  err_no)
inlinestatic

#include <zephyr/net/wifi.h>

Helper function to get user-friendly TWT error code name.

◆ wifi_twt_negotiation_type_txt()

const char * wifi_twt_negotiation_type_txt ( enum wifi_twt_negotiation_type  twt_negotiation)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly twt negotiation type name.

◆ wifi_twt_operation_txt()

const char * wifi_twt_operation_txt ( enum wifi_twt_operation  twt_operation)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly twt operation name.

◆ wifi_twt_setup_cmd_txt()

const char * wifi_twt_setup_cmd_txt ( enum wifi_twt_setup_cmd  twt_setup)

#include <zephyr/net/wifi.h>

Helper function to get user-friendly twt setup cmd name.

◆ wifi_utils_parse_scan_bands()

int wifi_utils_parse_scan_bands ( char *  scan_bands_str,
uint8_t band_map 
)

#include <zephyr/net/wifi_utils.h>

Convert a band specification string to a bitmap representing the bands.

The function will parse a string which specifies Wi-Fi frequency band values as a comma separated string and convert it to a bitmap. The string can use the following characters to represent the bands:

  • 2: 2.4 GHz
  • 5: 5 GHz
  • 6: 6 GHz

For the bitmap generated refer to wifi_frequency_bands for bit position of each band.

E.g. a string "2,5,6" will be converted to a bitmap value of 0x7

Parameters
scan_bands_strString which spe.
band_mapPointer to the bitmap variable to be updated.
Return values
0on success.
-errnovalue in case of failure.

◆ wifi_utils_parse_scan_chan()

int wifi_utils_parse_scan_chan ( char *  scan_chan_str,
struct wifi_band_channel chan,
uint8_t  max_channels 
)

#include <zephyr/net/wifi_utils.h>

Convert a string containing a specification of scan channels to an array.

The function will parse a string which specifies channels to be scanned as a string and convert it to an array.

The channel string has to be formatted using the colon (:), comma(,), hyphen (-) and underscore (_) delimiters as follows:

  • A colon identifies the value preceding it as a band. A band value (2: 2.4 GHz, 5: 5 GHz 6: 6 GHz) has to precede the channels in that band (e.g. 2: etc)
  • Hyphens (-) are used to identify channel ranges (e.g. 2-7, 32-48 etc)
  • Commas are used to separate channel values within a band. Channels can be specified as individual values (2,6,48 etc) or channel ranges using hyphens (1-14, 32-48 etc)
  • Underscores (_) are used to specify multiple band-channel sets (e.g. 2:1,2_5:36,40 etc)
  • No spaces should be used anywhere, i.e. before/after commas, before/after hyphens etc.

An example channel specification specifying channels in the 2.4 GHz and 5 GHz bands is as below: 2:1,5,7,9-11_5:36-48,100,163-167

Parameters
scan_chan_strList of channels expressed in the format described above.
chanPointer to an array where the parsed channels are to be stored.
max_channelsMaximum number of channels to store
Return values
0on success.
-errnovalue in case of failure.

◆ wifi_utils_parse_scan_ssids()

int wifi_utils_parse_scan_ssids ( char *  scan_ssids_str,
const char *  ssids[],
uint8_t  num_ssids 
)

#include <zephyr/net/wifi_utils.h>

Append a string containing an SSID to an array of SSID strings.

Parameters
scan_ssids_strstring to be appended in the list of scanned SSIDs.
ssidsPointer to an array where the SSIDs pointers are to be stored.
num_ssidsMaximum number of SSIDs that can be stored.
Return values
0on success.
-errnovalue in case of failure.

◆ wifi_utils_validate_chan()

bool wifi_utils_validate_chan ( uint8_t  band,
uint16_t  chan 
)

#include <zephyr/net/wifi_utils.h>

Validate a channel against a band.

Parameters
bandBand to validate the channel against.
chanChannel to validate.
Return values
trueif the channel is valid for the band.
falseif the channel is not valid for the band.

◆ wifi_utils_validate_chan_2g()

bool wifi_utils_validate_chan_2g ( uint16_t  chan)

#include <zephyr/net/wifi_utils.h>

Validate a channel against the 2.4 GHz band.

Parameters
chanChannel to validate.
Return values
trueif the channel is valid for the band.
falseif the channel is not valid for the band.

◆ wifi_utils_validate_chan_5g()

bool wifi_utils_validate_chan_5g ( uint16_t  chan)

#include <zephyr/net/wifi_utils.h>

Validate a channel against the 5 GHz band.

Parameters
chanChannel to validate.
Return values
trueif the channel is valid for the band.
falseif the channel is not valid for the band.

◆ wifi_utils_validate_chan_6g()

bool wifi_utils_validate_chan_6g ( uint16_t  chan)

#include <zephyr/net/wifi_utils.h>

Validate a channel against the 6 GHz band.

Parameters
chanChannel to validate.
Return values
trueif the channel is valid for the band.
falseif the channel is not valid for the band.