Zephyr API Documentation
3.5.0
A Scalable Open Source RTOS
|
|
3.5.0 |
Wi-Fi Management API. More...
Data Structures | |
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_domain |
Regulatory domain information or configuration. More... | |
struct | wifi_raw_scan_result |
Wi-Fi raw scan result. 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... | |
Typedefs | |
typedef void(* | scan_result_cb_t) (struct net_if *iface, int status, struct wifi_scan_result *entry) |
Scan result callback. | |
Functions | |
const char *const | wifi_security_txt (enum wifi_security_type security) |
Helper function to get user-friendly security type name. | |
const char *const | wifi_mfp_txt (enum wifi_mfp_options mfp) |
Helper function to get user-friendly MFP name. | |
const char *const | wifi_band_txt (enum wifi_frequency_bands band) |
Helper function to get user-friendly frequency band name. | |
const char *const | wifi_state_txt (enum wifi_iface_state state) |
Helper function to get user-friendly interface state name. | |
const char *const | wifi_mode_txt (enum wifi_iface_mode mode) |
Helper function to get user-friendly interface mode name. | |
const char *const | wifi_link_mode_txt (enum wifi_link_mode link_mode) |
Helper function to get user-friendly link mode name. | |
const char *const | wifi_ps_txt (enum wifi_ps ps_name) |
Helper function to get user-friendly ps name. | |
const char *const | wifi_ps_mode_txt (enum wifi_ps_mode ps_mode) |
Helper function to get user-friendly ps mode name. | |
const char *const | wifi_twt_operation_txt (enum wifi_twt_operation twt_operation) |
Helper function to get user-friendly twt operation name. | |
const char *const | wifi_twt_negotiation_type_txt (enum wifi_twt_negotiation_type twt_negotiation) |
Helper function to get user-friendly twt negotiation type name. | |
const char *const | 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 *const | 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. | |
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. | |
#define | WIFI_UTILS_MAX_BAND_STR_LEN 3 |
#define | WIFI_UTILS_MAX_CHAN_STR_LEN 4 |
Wi-Fi Management API.
#define NET_EVENT_WIFI_CONNECT_RESULT (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_CONNECT_RESULT) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_EVENT_WIFI_DISCONNECT_COMPLETE (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_EVENT_WIFI_DISCONNECT_RESULT (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_RESULT) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_EVENT_WIFI_IFACE_STATUS (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_IFACE_STATUS) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_EVENT_WIFI_RAW_SCAN_RESULT (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_EVENT_WIFI_SCAN_DONE (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_DONE) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_EVENT_WIFI_SCAN_RESULT (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_RESULT) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_EVENT_WIFI_TWT (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_EVENT_WIFI_TWT_SLEEP_STATE (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_AP_DISABLE (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_DISABLE) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_AP_ENABLE (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_ENABLE) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_CHANNEL (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CHANNEL) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_CONNECT (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONNECT) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_DISCONNECT (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DISCONNECT) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_IFACE_STATUS (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_IFACE_STATUS) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_MODE (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_MODE) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_PACKET_FILTER (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PACKET_FILTER) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_PS (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_PS_CONFIG (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_CONFIG) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_PS_MODE (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_MODE) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_PS_TIMEOUT (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_TIMEOUT) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_REG_DOMAIN (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_REG_DOMAIN) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_SCAN (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_SCAN) |
#include <zephyr/net/wifi_mgmt.h>
#define NET_REQUEST_WIFI_TWT (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_TWT) |
#include <zephyr/net/wifi_mgmt.h>
#define WIFI_CHANNEL_ANY 255 |
#include <zephyr/net/wifi.h>
#define WIFI_CHANNEL_MAX 233 |
#include <zephyr/net/wifi.h>
#define WIFI_CHANNEL_MIN 1 |
#include <zephyr/net/wifi.h>
#define WIFI_COUNTRY_CODE_LEN 2 |
#include <zephyr/net/wifi.h>
#define WIFI_INTERFACE_INDEX_MAX 255 |
#include <zephyr/net/wifi.h>
#define WIFI_INTERFACE_INDEX_MIN 1 |
#include <zephyr/net/wifi.h>
#define WIFI_LISTEN_INTERVAL_MAX 65535 |
#include <zephyr/net/wifi.h>
#define WIFI_LISTEN_INTERVAL_MIN 0 |
#include <zephyr/net/wifi.h>
#define WIFI_MAC_ADDR_LEN 6 |
#include <zephyr/net/wifi.h>
#define WIFI_MAX_TWT_FLOWS 8 |
#include <zephyr/net/wifi_mgmt.h>
#define WIFI_MAX_TWT_INTERVAL_US (LONG_MAX - 1) |
#include <zephyr/net/wifi_mgmt.h>
#define WIFI_MAX_TWT_WAKE_INTERVAL_US 262144 |
#include <zephyr/net/wifi_mgmt.h>
#define WIFI_MGMT_BAND_STR_SIZE_MAX 8 |
#include <zephyr/net/wifi_mgmt.h>
#define WIFI_MGMT_SCAN_CHAN_MAX_MANUAL 1 |
#include <zephyr/net/wifi_mgmt.h>
#define WIFI_MGMT_SCAN_SSID_FILT_MAX 1 |
#include <zephyr/net/wifi_mgmt.h>
#define WIFI_PSK_MAX_LEN 64 |
#include <zephyr/net/wifi.h>
#define WIFI_PSK_MIN_LEN 8 |
#include <zephyr/net/wifi.h>
#define WIFI_SAE_PSWD_MAX_LEN 128 |
#include <zephyr/net/wifi.h>
#define WIFI_SSID_MAX_LEN 32 |
#include <zephyr/net/wifi.h>
#define WIFI_UTILS_MAX_BAND_STR_LEN 3 |
#include <zephyr/net/wifi_utils.h>
#define WIFI_UTILS_MAX_CHAN_STR_LEN 4 |
#include <zephyr/net/wifi_utils.h>
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.
iface | Network interface |
status | Scan result status |
entry | Scan result entry |
enum net_event_wifi_cmd |
#include <zephyr/net/wifi_mgmt.h>
Wi-Fi management events.
enum net_request_wifi_cmd |
#include <zephyr/net/wifi_mgmt.h>
Wi-Fi management commands.
#include <zephyr/net/wifi.h>
Wi-Fi power save error codes.
enum wifi_filter |
#include <zephyr/net/wifi.h>
Mode filter settings.
enum wifi_frequency_bands |
#include <zephyr/net/wifi.h>
IEEE 802.11 operational frequency bands (not exhaustive).
enum wifi_iface_mode |
#include <zephyr/net/wifi.h>
Wi-Fi interface modes.
Based on https://w1.fi/wpa_supplicant/devel/defs_8h.html#a4aeb27c1e4abd046df3064ea9756f0bc
enum wifi_iface_state |
#include <zephyr/net/wifi.h>
Wi-Fi interface states.
Based on https://w1.fi/wpa_supplicant/devel/defs_8h.html#a4aeb27c1e4abd046df3064ea9756f0bc
enum 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.
enum 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 |
enum 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. |
#include <zephyr/net/wifi.h>
Wifi operational mode.
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. |
enum 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. |
enum wifi_ps_param_type |
#include <zephyr/net/wifi.h>
Wi-Fi power save parameters.
enum 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. |
enum 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. |
enum wifi_security_type |
#include <zephyr/net/wifi.h>
IEEE 802.11 security types.
enum wifi_twt_fail_reason |
#include <zephyr/net/wifi.h>
Target Wake Time (TWT) error codes.
#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. |
enum 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. |
enum wifi_twt_setup_cmd |
#include <zephyr/net/wifi.h>
Wi-Fi Target Wake Time (TWT) setup commands.
#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. |
enum 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. |
const char *const wifi_band_txt | ( | enum wifi_frequency_bands | band | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly frequency band name.
const char *const wifi_link_mode_txt | ( | enum wifi_link_mode | link_mode | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly link mode name.
const char *const wifi_mfp_txt | ( | enum wifi_mfp_options | mfp | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly MFP name.
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.
iface | Network interface |
status | Connect result status |
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.
iface | Network interface |
status | Disconnect complete status |
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.
iface | Network interface |
status | Disconnect result status |
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.
iface | Network interface |
iface_status | Interface status |
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.
iface | Network interface |
raw_scan_info | Raw scan result |
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.
iface | Network interface |
twt_params | TWT parameters |
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.
iface | Network interface |
twt_sleep_state | TWT sleep state |
const char *const wifi_mode_txt | ( | enum wifi_iface_mode | mode | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly interface mode name.
|
inlinestatic |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly power save error code name.
const char *const wifi_ps_mode_txt | ( | enum wifi_ps_mode | ps_mode | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly ps mode name.
const char *const wifi_ps_txt | ( | enum wifi_ps | ps_name | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly ps name.
const char *const 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.
const char *const wifi_security_txt | ( | enum wifi_security_type | security | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly security type name.
const char *const wifi_state_txt | ( | enum wifi_iface_state | state | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly interface state name.
|
inlinestatic |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly TWT error code name.
const char *const 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.
const char *const wifi_twt_operation_txt | ( | enum wifi_twt_operation | twt_operation | ) |
#include <zephyr/net/wifi.h>
Helper function to get user-friendly twt operation name.
const char *const 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.
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:
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
scan_bands_str | String which spe. |
band_map | Pointer to the bitmap variable to be updated. |
0 | on success. |
-errno | value in case of failure. |
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:
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
scan_chan_str | List of channels expressed in the format described above. |
chan | Pointer to an array where the parsed channels are to be stored. |
max_channels | Maximum number of channels to store |
0 | on success. |
-errno | value in case of failure. |
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.
scan_ssids_str | string to be appended in the list of scanned SSIDs. |
ssids | Pointer to an array where the SSIDs pointers are to be stored. |
num_ssids | Maximum number of SSIDs that can be stored. |
0 | on success. |
-errno | value in case of failure. |