idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::wifi Namespace Reference

Classes

struct  ap_config
 Configuration for WiFi access point mode. More...
 
struct  ap_probe_req_event_data
 Information about a probe request received by the soft-AP. More...
 
struct  ap_record
 Information about a discovered access point. More...
 
struct  ap_sta_connected_event_data
 Information about a station connecting to the soft-AP. More...
 
struct  ap_sta_disconnected_event_data
 Information about a station disconnecting from the soft-AP. More...
 
struct  authmode_change_event_data
 Information about an authentication mode change. More...
 
struct  bandwidths_config
 Bandwidth configuration for dual-band operation. More...
 
struct  bss_rssi_low_event_data
 Information about BSS RSSI dropping below threshold. More...
 
struct  channel_info
 WiFi channel information. More...
 
struct  connected_event_data
 Information about a successful station connection. More...
 
struct  country_config
 WiFi country configuration. More...
 
struct  csi_config
 CSI (Channel State Information) configuration. More...
 
struct  disconnected_event_data
 Information about a station disconnection. More...
 
class  error_category
 Error category for WiFi errors. More...
 
struct  ftm_initiator_config
 FTM initiator session configuration. More...
 
struct  ftm_report_entry
 Single FTM report measurement entry. More...
 
struct  ftm_report_event_data
 Information about an FTM report. More...
 
struct  he_ap_info
 HE (High Efficiency) AP information. More...
 
struct  home_channel_change_event_data
 Information about a home channel change. More...
 
struct  init_config
 Configuration for WiFi initialization. More...
 
struct  pmf_config
 Protected Management Frame (PMF) configuration. More...
 
struct  protocols_config
 Protocol configuration for dual-band operation. More...
 
struct  scan_config
 Configuration for a WiFi scan operation. More...
 
struct  scan_default_params
 Default scan timing parameters. More...
 
struct  scan_done_event_data
 Information about a completed scan. More...
 
struct  sta_config
 Configuration for WiFi station mode. More...
 
struct  sta_info
 Information about a station connected to the soft-AP. More...
 

Enumerations

enum class  role : int {
  sta = 1 ,
  ap = 2
}
 WiFi role (station and/or access point). More...
 
enum class  auth_mode : int {
  open = 0 ,
  wep = 1 ,
  wpa_psk = 2 ,
  wpa2_psk = 3 ,
  wpa_wpa2_psk = 4 ,
  wpa2_enterprise = 5 ,
  wpa3_psk = 6 ,
  wpa2_wpa3_psk = 7 ,
  wapi_psk = 8 ,
  owe = 9 ,
  wpa3_ent_192 = 10 ,
  dpp = 13 ,
  wpa3_enterprise = 14 ,
  wpa2_wpa3_enterprise = 15 ,
  wpa_enterprise = 16
}
 WiFi authentication mode. More...
 
enum class  power_save : int {
  none = 0 ,
  min_modem = 1 ,
  max_modem = 2
}
 WiFi power save mode. More...
 
enum class  bandwidth : int {
  ht20 = 1 ,
  ht40 = 2 ,
  bw80 = 3 ,
  bw160 = 4 ,
  bw80_80 = 5
}
 WiFi channel bandwidth. More...
 
enum class  scan_type : int {
  active = 0 ,
  passive = 1
}
 WiFi scan type. More...
 
enum class  second_channel : int {
  above = 1 ,
  below = 2
}
 WiFi secondary channel position relative to the primary channel. More...
 
enum class  sort_method : int {
  by_rssi = 0 ,
  by_security = 1
}
 WiFi AP sort method for connection. More...
 
enum class  disconnect_reason : uint16_t {
  unspecified = 1 ,
  auth_expire = 2 ,
  auth_leave = 3 ,
  assoc_expire = 4 ,
  assoc_toomany = 5 ,
  not_authed = 6 ,
  not_assoced = 7 ,
  assoc_leave = 8 ,
  assoc_not_authed = 9 ,
  disassoc_pwrcap_bad = 10 ,
  disassoc_supchan_bad = 11 ,
  bss_transition_disassoc = 12 ,
  ie_invalid = 13 ,
  mic_failure = 14 ,
  fourway_handshake_timeout = 15 ,
  group_key_update_timeout = 16 ,
  ie_in_4way_differs = 17 ,
  group_cipher_invalid = 18 ,
  pairwise_cipher_invalid = 19 ,
  akmp_invalid = 20 ,
  unsupp_rsn_ie_version = 21 ,
  invalid_rsn_ie_cap = 22 ,
  ieee_802_1x_auth_failed = 23 ,
  cipher_suite_rejected = 24 ,
  tdls_peer_unreachable = 25 ,
  tdls_unspecified = 26 ,
  ssp_requested_disassoc = 27 ,
  no_ssp_roaming_agreement = 28 ,
  bad_cipher_or_akm = 29 ,
  not_authorized_this_location = 30 ,
  service_change_precludes_ts = 31 ,
  unspecified_qos = 32 ,
  not_enough_bandwidth = 33 ,
  missing_acks = 34 ,
  exceeded_txop = 35 ,
  sta_leaving = 36 ,
  end_ba = 37 ,
  unknown_ba = 38 ,
  timeout = 39 ,
  peer_initiated = 46 ,
  ap_initiated = 47 ,
  invalid_ft_action_frame_count = 48 ,
  invalid_pmkid = 49 ,
  invalid_mde = 50 ,
  invalid_fte = 51 ,
  transmission_link_establish_failed = 67 ,
  alterative_channel_occupied = 68 ,
  beacon_timeout = 200 ,
  no_ap_found = 201 ,
  auth_fail = 202 ,
  assoc_fail = 203 ,
  handshake_timeout = 204 ,
  connection_fail = 205 ,
  ap_tsf_reset = 206 ,
  roaming = 207 ,
  assoc_comeback_time_too_long = 208 ,
  sa_query_timeout = 209 ,
  no_ap_found_w_compatible_security = 210 ,
  no_ap_found_in_authmode_threshold = 211 ,
  no_ap_found_in_rssi_threshold = 212
}
 WiFi disconnection reason codes. More...
 
enum class  cipher_type : int {
  none = 0 ,
  wep40 = 1 ,
  wep104 = 2 ,
  tkip = 3 ,
  ccmp = 4 ,
  tkip_ccmp = 5 ,
  aes_cmac128 = 6 ,
  sms4 = 7 ,
  gcmp = 8 ,
  gcmp256 = 9 ,
  aes_gmac128 = 10 ,
  aes_gmac256 = 11 ,
  unknown = 12
}
 WiFi cipher type. More...
 
enum class  phy_mode : int {
  lr = 0 ,
  b11b = 1 ,
  b11g = 2 ,
  b11a = 3 ,
  ht20 = 4 ,
  ht40 = 5 ,
  he20 = 6 ,
  vht20 = 7
}
 WiFi PHY mode. More...
 
enum class  band : int {
  ghz_2g = 1 ,
  ghz_5g = 2
}
 WiFi frequency band. More...
 
enum class  band_mode : int {
  ghz_2g_only = 1 ,
  ghz_5g_only = 2 ,
  auto_mode = 3
}
 WiFi band mode. More...
 
enum class  channel_5g : uint32_t {
  ch36 = 1u << 1 ,
  ch40 = 1u << 2 ,
  ch44 = 1u << 3 ,
  ch48 = 1u << 4 ,
  ch52 = 1u << 5 ,
  ch56 = 1u << 6 ,
  ch60 = 1u << 7 ,
  ch64 = 1u << 8 ,
  ch100 = 1u << 9 ,
  ch104 = 1u << 10 ,
  ch108 = 1u << 11 ,
  ch112 = 1u << 12 ,
  ch116 = 1u << 13 ,
  ch120 = 1u << 14 ,
  ch124 = 1u << 15 ,
  ch128 = 1u << 16 ,
  ch132 = 1u << 17 ,
  ch136 = 1u << 18 ,
  ch140 = 1u << 19 ,
  ch144 = 1u << 20 ,
  ch149 = 1u << 21 ,
  ch153 = 1u << 22 ,
  ch157 = 1u << 23 ,
  ch161 = 1u << 24 ,
  ch165 = 1u << 25 ,
  ch169 = 1u << 26 ,
  ch173 = 1u << 27 ,
  ch177 = 1u << 28 ,
  all = 0x1FFFFFFE
}
 5 GHz WiFi channel flags. More...
 
enum class  storage : int {
  flash = 0 ,
  ram = 1
}
 WiFi configuration storage location. More...
 
enum class  country_policy : int {
  auto_policy = 0 ,
  manual = 1
}
 WiFi country policy. More...
 
enum class  scan_method : int {
  fast = 0 ,
  all_channel = 1
}
 WiFi scan method. More...
 
enum class  sae_pwe_method : int {
  hunt_and_peck = 1 ,
  hash_to_element = 2
}
 SAE PWE (Password Element) derivation method. More...
 
enum class  sae_pk_mode : int {
  automatic = 0 ,
  only = 1 ,
  disabled = 2
}
 SAE-PK (Public Key) mode. More...
 
enum class  protocol : uint8_t {
  b11b = 0x01 ,
  b11g = 0x02 ,
  b11n = 0x04 ,
  lr = 0x08 ,
  b11a = 0x10 ,
  b11ac = 0x20 ,
  b11ax = 0x40
}
 WiFi protocol flags. More...
 
enum class  promiscuous_pkt_type : int {
  mgmt = 0 ,
  ctrl = 1 ,
  data = 2 ,
  misc = 3
}
 Promiscuous mode packet type. More...
 
enum class  promiscuous_filter : uint32_t {
  all = 0xFFFFFFFF ,
  mgmt = 1u << 0 ,
  ctrl = 1u << 1 ,
  data = 1u << 2 ,
  misc = 1u << 3 ,
  data_mpdu = 1u << 4 ,
  data_ampdu = 1u << 5 ,
  fcsfail = 1u << 6
}
 Promiscuous mode filter flags. More...
 
enum class  promiscuous_ctrl_filter : uint32_t {
  all = 0xFF800000 ,
  wrapper = 1u << 23 ,
  bar = 1u << 24 ,
  ba = 1u << 25 ,
  pspoll = 1u << 26 ,
  rts = 1u << 27 ,
  cts = 1u << 28 ,
  ack = 1u << 29 ,
  cfend = 1u << 30 ,
  cfendack = 1u << 31
}
 Promiscuous mode control frame sub-type filter flags. More...
 
enum class  event_mask : uint32_t {
  all = 0xFFFFFFFF ,
  none = 0 ,
  ap_probe_req_rx = 1u << 0
}
 WiFi event mask flags. More...
 
enum class  statis_module : uint32_t {
  buffer = 1u << 0 ,
  rxtx = 1u << 1 ,
  hw = 1u << 2 ,
  diag = 1u << 3 ,
  ps = 1u << 4 ,
  all = 0xFFFFFFFF
}
 WiFi statistics module flags. More...
 
enum class  vendor_ie_type : int {
  beacon = 0 ,
  probe_req = 1 ,
  probe_resp = 2 ,
  assoc_req = 3 ,
  assoc_resp = 4
}
 Vendor-specific IE type. More...
 
enum class  vendor_ie_id : int {
  id_0 = 0 ,
  id_1 = 1
}
 Vendor-specific IE index. More...
 
enum class  ftm_status : int {
  success = 0 ,
  unsupported = 1 ,
  conf_rejected = 2 ,
  no_response = 3 ,
  fail = 4 ,
  no_valid_msmt = 5 ,
  user_term = 6
}
 FTM (Fine Timing Measurement) session status. More...
 
enum class  phy_rate : int {
  rate_1m_l = 0x00 ,
  rate_2m_l = 0x01 ,
  rate_5m_l = 0x02 ,
  rate_11m_l = 0x03 ,
  rate_2m_s = 0x05 ,
  rate_5m_s = 0x06 ,
  rate_11m_s = 0x07 ,
  rate_48m = 0x08 ,
  rate_24m = 0x09 ,
  rate_12m = 0x0A ,
  rate_6m = 0x0B ,
  rate_54m = 0x0C ,
  rate_36m = 0x0D ,
  rate_18m = 0x0E ,
  rate_9m = 0x0F ,
  mcs0_lgi = 0x10 ,
  mcs1_lgi = 0x11 ,
  mcs2_lgi = 0x12 ,
  mcs3_lgi = 0x13 ,
  mcs4_lgi = 0x14 ,
  mcs5_lgi = 0x15 ,
  mcs6_lgi = 0x16 ,
  mcs7_lgi = 0x17 ,
  mcs0_sgi = 0x18 ,
  mcs1_sgi = mcs0_sgi + 1 ,
  mcs2_sgi = mcs0_sgi + 2 ,
  mcs3_sgi = mcs0_sgi + 3 ,
  mcs4_sgi = mcs0_sgi + 4 ,
  mcs5_sgi = mcs0_sgi + 5 ,
  mcs6_sgi = mcs0_sgi + 6 ,
  mcs7_sgi = mcs0_sgi + 7 ,
  lora_250k = 0x29 ,
  lora_500k = 0x2A
}
 WiFi PHY transmission rate. More...
 
enum class  errc : esp_err_t {
  not_init = 0x3001 ,
  not_started = 0x3002 ,
  not_stopped = 0x3003 ,
  if_error = 0x3004 ,
  mode = 0x3005 ,
  state = 0x3006 ,
  conn = 0x3007 ,
  nvs = 0x3008 ,
  mac = 0x3009 ,
  ssid = 0x300A ,
  password = 0x300B ,
  timeout = 0x300C ,
  wake_fail = 0x300D ,
  would_block = 0x300E ,
  not_connect = 0x300F ,
  post = 0x3012 ,
  init_state = 0x3013 ,
  stop_state = 0x3014 ,
  not_assoc = 0x3015 ,
  tx_disallow = 0x3016 ,
  twt_full = 0x3017 ,
  twt_setup_timeout = 0x3018 ,
  twt_setup_txfail = 0x3019 ,
  twt_setup_reject = 0x301A ,
  discard = 0x301B ,
  roc_in_progress = 0x301C
}
 Error codes for WiFi operations. More...
 
enum class  event_id : int32_t {
  ready = 0 ,
  scan_done = 1 ,
  sta_start = 2 ,
  sta_stop = 3 ,
  sta_connected = 4 ,
  sta_disconnected = 5 ,
  sta_authmode_change = 6 ,
  sta_wps_er_success = 7 ,
  sta_wps_er_failed = 8 ,
  sta_wps_er_timeout = 9 ,
  sta_wps_er_pin = 10 ,
  sta_wps_er_pbc_overlap = 11 ,
  ap_start = 12 ,
  ap_stop = 13 ,
  ap_sta_connected = 14 ,
  ap_sta_disconnected = 15 ,
  ap_probe_req_received = 16 ,
  ftm_report = 17 ,
  sta_bss_rssi_low = 18 ,
  action_tx_status = 19 ,
  roc_done = 20 ,
  sta_beacon_timeout = 21 ,
  connectionless_module_wake_interval_start = 22 ,
  ap_wps_rg_success = 23 ,
  ap_wps_rg_failed = 24 ,
  ap_wps_rg_timeout = 25 ,
  ap_wps_rg_pin = 26 ,
  ap_wps_rg_pbc_overlap = 27 ,
  itwt_setup = 28 ,
  itwt_teardown = 29 ,
  itwt_probe = 30 ,
  itwt_suspend = 31 ,
  twt_wakeup = 32 ,
  btwt_setup = 33 ,
  btwt_teardown = 34 ,
  nan_started = 35 ,
  nan_stopped = 36 ,
  nan_svc_match = 37 ,
  nan_replied = 38 ,
  nan_receive = 39 ,
  ndp_indication = 40 ,
  ndp_confirm = 41 ,
  ndp_terminated = 42 ,
  home_channel_change = 43 ,
  sta_neighbor_rep = 44 ,
  ap_wrong_password = 45 ,
  sta_beacon_offset_unstable = 46 ,
  dpp_uri_ready = 47 ,
  dpp_cfg_recvd = 48 ,
  dpp_failed = 49
}
 WiFi event IDs. More...
 

Functions

void init (const init_config &cfg={})
 Initializes the WiFi subsystem.
 
void deinit ()
 Deinitializes the WiFi subsystem and frees resources.
 
void start ()
 Starts the WiFi subsystem.
 
void stop ()
 Stops the WiFi subsystem.
 
void restore ()
 Restores WiFi stack persistent settings to defaults.
 
result< voidtry_init (const init_config &cfg={})
 Initializes the WiFi subsystem.
 
result< voidtry_deinit ()
 Deinitializes the WiFi subsystem and frees resources.
 
result< voidtry_start ()
 Starts the WiFi subsystem.
 
result< voidtry_stop ()
 Stops the WiFi subsystem.
 
result< voidtry_restore ()
 Restores WiFi stack persistent settings to defaults.
 
void set_roles (flags< role > roles)
 Sets the active WiFi roles.
 
flags< roleget_roles ()
 Gets the currently active WiFi roles.
 
result< voidtry_set_roles (flags< role > roles)
 Sets the active WiFi roles.
 
result< flags< role > > try_get_roles ()
 Gets the currently active WiFi roles.
 
void set_sta_config (const sta_config &cfg)
 Sets the WiFi station configuration.
 
sta_config get_sta_config ()
 Gets the current WiFi station configuration.
 
result< voidtry_set_sta_config (const sta_config &cfg)
 Sets the WiFi station configuration.
 
result< sta_configtry_get_sta_config ()
 Gets the current WiFi station configuration.
 
void set_ap_config (const ap_config &cfg)
 Sets the WiFi access point configuration.
 
ap_config get_ap_config ()
 Gets the current WiFi access point configuration.
 
void deauth_sta (uint16_t aid)
 Deauthenticates a station from the soft-AP.
 
std::vector< sta_infoget_sta_list ()
 Gets the list of stations connected to the soft-AP.
 
uint16_t ap_get_sta_aid (mac_address mac)
 Gets the association ID for a station connected to the soft-AP.
 
result< voidtry_set_ap_config (const ap_config &cfg)
 Sets the WiFi access point configuration.
 
result< ap_configtry_get_ap_config ()
 Gets the current WiFi access point configuration.
 
result< voidtry_deauth_sta (uint16_t aid)
 Deauthenticates a station from the soft-AP.
 
result< std::vector< sta_info > > try_get_sta_list ()
 Gets the list of stations connected to the soft-AP.
 
result< uint16_ttry_ap_get_sta_aid (mac_address mac)
 Gets the association ID for a station connected to the soft-AP.
 
void connect ()
 Connects to the configured access point.
 
void disconnect ()
 Disconnects from the current access point.
 
void clear_fast_connect ()
 Clears the fast-connect data stored in memory.
 
uint16_t sta_get_aid ()
 Gets the association ID assigned by the AP in station mode.
 
enum phy_mode get_negotiated_phymode ()
 Gets the PHY mode negotiated with the connected AP.
 
result< voidtry_connect ()
 Connects to the configured access point.
 
result< voidtry_disconnect ()
 Disconnects from the current access point.
 
result< voidtry_clear_fast_connect ()
 Clears the fast-connect data stored in memory.
 
result< uint16_ttry_sta_get_aid ()
 Gets the association ID assigned by the AP in station mode.
 
result< enum phy_modetry_get_negotiated_phymode ()
 Gets the PHY mode negotiated with the connected AP.
 
std::vector< ap_recordscan (const scan_config &cfg={})
 Performs a blocking scan for access points.
 
void scan_start (const scan_config &cfg={})
 Starts a non-blocking scan for access points.
 
std::vector< ap_recordscan_get_results ()
 Retrieves results from a completed scan.
 
void scan_stop ()
 Stops an in-progress scan.
 
uint16_t scan_get_ap_num ()
 Gets the number of APs found in the last scan.
 
void clear_ap_list ()
 Clears the AP list stored from a previous scan.
 
void set_scan_parameters (const scan_default_params &params)
 Sets the default scan timing parameters.
 
scan_default_params get_scan_parameters ()
 Gets the current default scan timing parameters.
 
result< std::vector< ap_record > > try_scan (const scan_config &cfg={})
 Performs a blocking scan for access points.
 
result< voidtry_scan_start (const scan_config &cfg={})
 Starts a non-blocking scan for access points.
 
result< std::vector< ap_record > > try_scan_get_results ()
 Retrieves results from a completed scan.
 
result< voidtry_scan_stop ()
 Stops an in-progress scan.
 
result< uint16_ttry_scan_get_ap_num ()
 Gets the number of APs found in the last scan.
 
result< voidtry_clear_ap_list ()
 Clears the AP list stored from a previous scan.
 
result< voidtry_set_scan_parameters (const scan_default_params &params)
 Sets the default scan timing parameters.
 
result< scan_default_paramstry_get_scan_parameters ()
 Gets the current default scan timing parameters.
 
void set_power_save (enum power_save ps)
 Sets the power save mode.
 
enum power_save get_power_save ()
 Gets the current power save mode.
 
result< voidtry_set_power_save (enum power_save ps)
 Sets the power save mode.
 
result< enum power_savetry_get_power_save ()
 Gets the current power save mode.
 
void set_bandwidth (enum role iface, enum bandwidth bw)
 Sets the channel bandwidth for the specified interface.
 
enum bandwidth get_bandwidth (enum role iface)
 Gets the current channel bandwidth for the specified interface.
 
void set_bandwidths (enum role iface, const bandwidths_config &bw)
 Sets bandwidths for dual-band operation on the specified interface.
 
bandwidths_config get_bandwidths (enum role iface)
 Gets bandwidths for dual-band operation on the specified interface.
 
result< voidtry_set_bandwidth (enum role iface, enum bandwidth bw)
 Sets the channel bandwidth for the specified interface.
 
result< enum bandwidthtry_get_bandwidth (enum role iface)
 Gets the current channel bandwidth for the specified interface.
 
result< voidtry_set_bandwidths (enum role iface, const bandwidths_config &bw)
 Sets bandwidths for dual-band operation on the specified interface.
 
result< bandwidths_configtry_get_bandwidths (enum role iface)
 Gets bandwidths for dual-band operation on the specified interface.
 
void set_mac (enum role iface, mac_address mac)
 Sets the MAC address for the specified interface.
 
mac_address get_mac (enum role iface)
 Gets the MAC address for the specified interface.
 
result< voidtry_set_mac (enum role iface, mac_address mac)
 Sets the MAC address for the specified interface.
 
result< mac_addresstry_get_mac (enum role iface)
 Gets the MAC address for the specified interface.
 
ap_record get_ap_info ()
 Gets information about the currently connected access point.
 
result< ap_recordtry_get_ap_info ()
 Gets information about the currently connected access point.
 
void set_channel (uint8_t primary, std::optional< enum second_channel > second=std::nullopt)
 Sets the primary and secondary channel.
 
channel_info get_channel ()
 Gets the current primary and secondary channel.
 
result< voidtry_set_channel (uint8_t primary, std::optional< enum second_channel > second=std::nullopt)
 Sets the primary and secondary channel.
 
result< channel_infotry_get_channel ()
 Gets the current primary and secondary channel.
 
void set_country (const country_config &cfg)
 Sets the WiFi country configuration.
 
country_config get_country ()
 Gets the current WiFi country configuration.
 
void set_country_code (std::string_view cc, bool ieee80211d_enabled)
 Sets the country code.
 
std::string get_country_code ()
 Gets the current country code.
 
result< voidtry_set_country (const country_config &cfg)
 Sets the WiFi country configuration.
 
result< country_configtry_get_country ()
 Gets the current WiFi country configuration.
 
result< voidtry_set_country_code (std::string_view cc, bool ieee80211d_enabled)
 Sets the country code.
 
result< std::string > try_get_country_code ()
 Gets the current country code.
 
void set_max_tx_power (int8_t power)
 Sets the maximum transmit power.
 
int8_t get_max_tx_power ()
 Gets the current maximum transmit power.
 
result< voidtry_set_max_tx_power (int8_t power)
 Sets the maximum transmit power.
 
result< int8_ttry_get_max_tx_power ()
 Gets the current maximum transmit power.
 
void set_rssi_threshold (int32_t rssi)
 Sets the RSSI threshold for the sta_bss_rssi_low event.
 
int get_rssi ()
 Gets the current RSSI of the connected AP.
 
result< voidtry_set_rssi_threshold (int32_t rssi)
 Sets the RSSI threshold for the sta_bss_rssi_low event.
 
result< inttry_get_rssi ()
 Gets the current RSSI of the connected AP.
 
void set_protocol (enum role iface, flags< protocol > protos)
 Sets the enabled WiFi protocols for the specified interface.
 
flags< protocolget_protocol (enum role iface)
 Gets the enabled WiFi protocols for the specified interface.
 
void set_protocols (enum role iface, const protocols_config &cfg)
 Sets the enabled WiFi protocols for dual-band operation.
 
protocols_config get_protocols (enum role iface)
 Gets the enabled WiFi protocols for dual-band operation.
 
result< voidtry_set_protocol (enum role iface, flags< protocol > protos)
 Sets the enabled WiFi protocols for the specified interface.
 
result< flags< protocol > > try_get_protocol (enum role iface)
 Gets the enabled WiFi protocols for the specified interface.
 
result< voidtry_set_protocols (enum role iface, const protocols_config &cfg)
 Sets the enabled WiFi protocols for dual-band operation.
 
result< protocols_configtry_get_protocols (enum role iface)
 Gets the enabled WiFi protocols for dual-band operation.
 
void set_band (enum band b)
 Sets the WiFi band.
 
enum band get_band ()
 Gets the current WiFi band.
 
void set_band_mode (enum band_mode m)
 Sets the WiFi band mode.
 
enum band_mode get_band_mode ()
 Gets the current WiFi band mode.
 
result< voidtry_set_band (enum band b)
 Sets the WiFi band.
 
result< enum bandtry_get_band ()
 Gets the current WiFi band.
 
result< voidtry_set_band_mode (enum band_mode m)
 Sets the WiFi band mode.
 
result< enum band_modetry_get_band_mode ()
 Gets the current WiFi band mode.
 
void set_storage (enum storage s)
 Sets the WiFi configuration storage location.
 
result< voidtry_set_storage (enum storage s)
 Sets the WiFi configuration storage location.
 
void set_inactive_time (enum role iface, uint16_t sec)
 Sets the inactive time before a station is deauthenticated.
 
uint16_t get_inactive_time (enum role iface)
 Gets the inactive time before a station is deauthenticated.
 
result< voidtry_set_inactive_time (enum role iface, uint16_t sec)
 Sets the inactive time before a station is deauthenticated.
 
result< uint16_ttry_get_inactive_time (enum role iface)
 Gets the inactive time before a station is deauthenticated.
 
void set_event_mask (flags< event_mask > mask)
 Sets the WiFi event mask.
 
flags< event_maskget_event_mask ()
 Gets the current WiFi event mask.
 
result< voidtry_set_event_mask (flags< event_mask > mask)
 Sets the WiFi event mask.
 
result< flags< event_mask > > try_get_event_mask ()
 Gets the current WiFi event mask.
 
void force_wakeup_acquire ()
 Acquires a WiFi wakeup lock.
 
void force_wakeup_release ()
 Releases a WiFi wakeup lock.
 
result< voidtry_force_wakeup_acquire ()
 Acquires a WiFi wakeup lock.
 
result< voidtry_force_wakeup_release ()
 Releases a WiFi wakeup lock.
 
void set_promiscuous (bool en)
 Enables or disables promiscuous mode.
 
bool get_promiscuous ()
 Gets whether promiscuous mode is enabled.
 
void set_promiscuous_rx_cb (void(*cb)(void *, int))
 Sets the promiscuous mode receive callback.
 
void set_promiscuous_filter (flags< promiscuous_filter > filter)
 Sets the promiscuous mode packet type filter.
 
flags< promiscuous_filterget_promiscuous_filter ()
 Gets the current promiscuous mode packet type filter.
 
void set_promiscuous_ctrl_filter (flags< promiscuous_ctrl_filter > filter)
 Sets the promiscuous mode control frame sub-type filter.
 
flags< promiscuous_ctrl_filterget_promiscuous_ctrl_filter ()
 Gets the current promiscuous mode control frame sub-type filter.
 
result< voidtry_set_promiscuous (bool en)
 Enables or disables promiscuous mode.
 
result< booltry_get_promiscuous ()
 Gets whether promiscuous mode is enabled.
 
result< voidtry_set_promiscuous_rx_cb (void(*cb)(void *, int))
 Sets the promiscuous mode receive callback.
 
result< voidtry_set_promiscuous_filter (flags< promiscuous_filter > filter)
 Sets the promiscuous mode packet type filter.
 
result< flags< promiscuous_filter > > try_get_promiscuous_filter ()
 Gets the current promiscuous mode packet type filter.
 
result< voidtry_set_promiscuous_ctrl_filter (flags< promiscuous_ctrl_filter > filter)
 Sets the promiscuous mode control frame sub-type filter.
 
result< flags< promiscuous_ctrl_filter > > try_get_promiscuous_ctrl_filter ()
 Gets the current promiscuous mode control frame sub-type filter.
 
void tx_80211 (enum role iface, std::span< const uint8_t > buffer, bool en_sys_seq)
 Transmits a raw 802.11 frame.
 
void register_80211_tx_cb (void(*cb)(const void *))
 Registers a callback for 802.11 TX completion.
 
result< voidtry_tx_80211 (enum role iface, std::span< const uint8_t > buffer, bool en_sys_seq)
 Transmits a raw 802.11 frame.
 
result< voidtry_register_80211_tx_cb (void(*cb)(const void *))
 Registers a callback for 802.11 TX completion.
 
void set_vendor_ie (bool enable, enum vendor_ie_type type, enum vendor_ie_id id, const void *vnd_ie)
 Sets a vendor-specific information element.
 
void set_vendor_ie_cb (void(*cb)(void *, int, const uint8_t *, const void *, int), void *ctx)
 Registers a callback for received vendor-specific IEs.
 
result< voidtry_set_vendor_ie (bool enable, enum vendor_ie_type type, enum vendor_ie_id id, const void *vnd_ie)
 Sets a vendor-specific information element.
 
result< voidtry_set_vendor_ie_cb (void(*cb)(void *, int, const uint8_t *, const void *, int), void *ctx)
 Registers a callback for received vendor-specific IEs.
 
void set_csi (bool en)
 Enables or disables CSI (Channel State Information) collection.
 
void set_csi_config (const csi_config &cfg)
 Sets the CSI configuration.
 
csi_config get_csi_config ()
 Gets the current CSI configuration.
 
void set_csi_rx_cb (void(*cb)(void *, void *), void *ctx)
 Registers a callback for CSI data reception.
 
result< voidtry_set_csi (bool en)
 Enables or disables CSI (Channel State Information) collection.
 
result< voidtry_set_csi_config (const csi_config &cfg)
 Sets the CSI configuration.
 
result< csi_configtry_get_csi_config ()
 Gets the current CSI configuration.
 
result< voidtry_set_csi_rx_cb (void(*cb)(void *, void *), void *ctx)
 Registers a callback for CSI data reception.
 
void ftm_initiate_session (const ftm_initiator_config &cfg)
 Initiates an FTM (Fine Timing Measurement) session.
 
void ftm_end_session ()
 Ends the current FTM session.
 
void ftm_resp_set_offset (int16_t offset)
 Sets the FTM responder offset.
 
std::vector< ftm_report_entryftm_get_report (size_t max_entries)
 Retrieves the FTM measurement report entries.
 
result< voidtry_ftm_initiate_session (const ftm_initiator_config &cfg)
 Initiates an FTM (Fine Timing Measurement) session.
 
result< voidtry_ftm_end_session ()
 Ends the current FTM session.
 
result< voidtry_ftm_resp_set_offset (int16_t offset)
 Sets the FTM responder offset.
 
result< std::vector< ftm_report_entry > > try_ftm_get_report (size_t max_entries)
 Retrieves the FTM measurement report entries.
 
int64_t get_tsf_time (enum role iface)
 Gets the TSF (Timing Synchronization Function) time for the specified interface.
 
void statis_dump (flags< statis_module > modules)
 Dumps WiFi statistics for the specified modules.
 
void config_11b_rate (enum role iface, bool disable)
 Enables or disables 802.11b rate for the specified interface.
 
void config_80211_tx_rate (enum role iface, enum phy_rate rate)
 Sets the 802.11 TX rate for the specified interface.
 
void disable_pmf_config (enum role iface)
 Disables PMF (Protected Management Frames) for the specified interface.
 
void set_dynamic_cs (bool enabled)
 Enables or disables dynamic CS (Carrier Sense).
 
void connectionless_module_set_wake_interval (uint16_t interval)
 Sets the connectionless module wake interval.
 
result< voidtry_statis_dump (flags< statis_module > modules)
 Dumps WiFi statistics for the specified modules.
 
result< voidtry_config_11b_rate (enum role iface, bool disable)
 Enables or disables 802.11b rate for the specified interface.
 
result< voidtry_config_80211_tx_rate (enum role iface, enum phy_rate rate)
 Sets the 802.11 TX rate for the specified interface.
 
result< voidtry_disable_pmf_config (enum role iface)
 Disables PMF (Protected Management Frames) for the specified interface.
 
result< voidtry_set_dynamic_cs (bool enabled)
 Enables or disables dynamic CS (Carrier Sense).
 
result< voidtry_connectionless_module_set_wake_interval (uint16_t interval)
 Sets the connectionless module wake interval.
 
netif::interface create_default_sta_netif ()
 Creates a default WiFi station network interface.
 
netif::interface create_default_ap_netif ()
 Creates a default WiFi access point network interface.
 
result< netif::interfacetry_create_default_sta_netif ()
 Creates a default WiFi station network interface.
 
result< netif::interfacetry_create_default_ap_netif ()
 Creates a default WiFi access point network interface.
 
std::error_code make_error_code (errc e) noexcept
 Creates an error code from an idfxx::wifi::errc value.
 

Variables

const event_base< event_idevents
 WiFi event base.
 
constexpr idfxx::event< event_id, connected_event_datasta_connected {event_id::sta_connected}
 Station connected event with connection details.
 
constexpr idfxx::event< event_id, disconnected_event_datasta_disconnected {event_id::sta_disconnected}
 Station disconnected event with disconnection details.
 
constexpr idfxx::event< event_id, scan_done_event_datascan_done {event_id::scan_done}
 Scan completed event with scan results summary.
 
constexpr idfxx::event< event_id, authmode_change_event_datasta_authmode_change {event_id::sta_authmode_change}
 Station authentication mode changed event.
 
constexpr idfxx::event< event_id, ap_sta_connected_event_dataap_sta_connected {event_id::ap_sta_connected}
 Station connected to soft-AP event.
 
constexpr idfxx::event< event_id, ap_sta_disconnected_event_dataap_sta_disconnected
 Station disconnected from soft-AP event.
 
constexpr idfxx::event< event_id, ap_probe_req_event_dataap_probe_req_received {event_id::ap_probe_req_received}
 Probe request received by soft-AP event.
 
constexpr idfxx::event< event_id, bss_rssi_low_event_datasta_bss_rssi_low {event_id::sta_bss_rssi_low}
 BSS RSSI dropped below threshold event.
 
constexpr idfxx::event< event_id, home_channel_change_event_datahome_channel_change
 Home channel changed event.
 
constexpr idfxx::event< event_id, ftm_report_event_dataftm_report {event_id::ftm_report}
 FTM report received event.
 
constexpr idfxx::event< event_idready {event_id::ready}
 WiFi ready event.
 
constexpr idfxx::event< event_idsta_start {event_id::sta_start}
 Station started event.
 
constexpr idfxx::event< event_idsta_stop {event_id::sta_stop}
 Station stopped event.
 
constexpr idfxx::event< event_idap_start {event_id::ap_start}
 Soft-AP started event.
 
constexpr idfxx::event< event_idap_stop {event_id::ap_stop}
 Soft-AP stopped event.
 
constexpr idfxx::event< event_idsta_beacon_timeout {event_id::sta_beacon_timeout}
 Station beacon timeout event.
 
constexpr idfxx::event< event_idsta_wps_er_success {event_id::sta_wps_er_success}
 WPS enrollee success event.
 
constexpr idfxx::event< event_idsta_wps_er_failed {event_id::sta_wps_er_failed}
 WPS enrollee failed event.
 
constexpr idfxx::event< event_idsta_wps_er_timeout {event_id::sta_wps_er_timeout}
 WPS enrollee timeout event.
 
constexpr idfxx::event< event_idsta_wps_er_pin {event_id::sta_wps_er_pin}
 WPS enrollee PIN received event.
 
constexpr idfxx::event< event_idsta_wps_er_pbc_overlap {event_id::sta_wps_er_pbc_overlap}
 WPS PBC overlap detected event.
 
constexpr idfxx::event< event_idaction_tx_status {event_id::action_tx_status}
 Action frame TX status event.
 
constexpr idfxx::event< event_idroc_done {event_id::roc_done}
 Remain-on-channel done event.
 
constexpr idfxx::event< event_idconnectionless_module_wake_interval_start
 Connectionless module wake interval start event.
 
constexpr idfxx::event< event_idap_wps_rg_success {event_id::ap_wps_rg_success}
 AP WPS registrar success event.
 
constexpr idfxx::event< event_idap_wps_rg_failed {event_id::ap_wps_rg_failed}
 AP WPS registrar failed event.
 
constexpr idfxx::event< event_idap_wps_rg_timeout {event_id::ap_wps_rg_timeout}
 AP WPS registrar timeout event.
 
constexpr idfxx::event< event_idap_wps_rg_pin {event_id::ap_wps_rg_pin}
 AP WPS registrar PIN received event.
 
constexpr idfxx::event< event_idap_wps_rg_pbc_overlap {event_id::ap_wps_rg_pbc_overlap}
 AP WPS PBC overlap detected event.
 
constexpr idfxx::event< event_iditwt_setup {event_id::itwt_setup}
 Individual TWT setup event.
 
constexpr idfxx::event< event_iditwt_teardown {event_id::itwt_teardown}
 Individual TWT teardown event.
 
constexpr idfxx::event< event_iditwt_probe {event_id::itwt_probe}
 Individual TWT probe event.
 
constexpr idfxx::event< event_iditwt_suspend {event_id::itwt_suspend}
 Individual TWT suspend event.
 
constexpr idfxx::event< event_idtwt_wakeup {event_id::twt_wakeup}
 TWT wakeup event.
 
constexpr idfxx::event< event_idbtwt_setup {event_id::btwt_setup}
 Broadcast TWT setup event.
 
constexpr idfxx::event< event_idbtwt_teardown {event_id::btwt_teardown}
 Broadcast TWT teardown event.
 
constexpr idfxx::event< event_idnan_started {event_id::nan_started}
 NAN started event.
 
constexpr idfxx::event< event_idnan_stopped {event_id::nan_stopped}
 NAN stopped event.
 
constexpr idfxx::event< event_idnan_svc_match {event_id::nan_svc_match}
 NAN service match event.
 
constexpr idfxx::event< event_idnan_replied {event_id::nan_replied}
 NAN replied event.
 
constexpr idfxx::event< event_idnan_receive {event_id::nan_receive}
 NAN receive event.
 
constexpr idfxx::event< event_idndp_indication {event_id::ndp_indication}
 NDP indication event.
 
constexpr idfxx::event< event_idndp_confirm {event_id::ndp_confirm}
 NDP confirm event.
 
constexpr idfxx::event< event_idndp_terminated {event_id::ndp_terminated}
 NDP terminated event.
 
constexpr idfxx::event< event_idsta_neighbor_rep {event_id::sta_neighbor_rep}
 Station neighbor report received event.
 
constexpr idfxx::event< event_idap_wrong_password {event_id::ap_wrong_password}
 AP detected wrong password from station event.
 
constexpr idfxx::event< event_idsta_beacon_offset_unstable {event_id::sta_beacon_offset_unstable}
 Station beacon offset unstable event.
 
constexpr idfxx::event< event_iddpp_uri_ready {event_id::dpp_uri_ready}
 DPP URI ready event.
 
constexpr idfxx::event< event_iddpp_cfg_recvd {event_id::dpp_cfg_recvd}
 DPP configuration received event.
 
constexpr idfxx::event< event_iddpp_failed {event_id::dpp_failed}
 DPP failed event.
 

Enumeration Type Documentation

◆ auth_mode

WiFi authentication mode.

Enumerator
open 

Open (no authentication).

wep 

WEP authentication.

wpa_psk 

WPA-PSK authentication.

wpa2_psk 

WPA2-PSK authentication.

wpa_wpa2_psk 

WPA/WPA2-PSK authentication.

wpa2_enterprise 

WPA2-Enterprise authentication.

wpa3_psk 

WPA3-PSK authentication.

wpa2_wpa3_psk 

WPA2/WPA3-PSK authentication.

wapi_psk 

WAPI-PSK authentication.

owe 

OWE (Opportunistic Wireless Encryption).

wpa3_ent_192 

WPA3-Enterprise Suite B 192-bit.

dpp 

DPP (Device Provisioning Protocol).

wpa3_enterprise 

WPA3-Enterprise Only Mode.

wpa2_wpa3_enterprise 

WPA3-Enterprise Transition Mode.

wpa_enterprise 

WPA-Enterprise authentication.

Definition at line 63 of file wifi.hpp.

◆ band

WiFi frequency band.

Enumerator
ghz_2g 

2.4 GHz band.

ghz_5g 

5 GHz band.

Definition at line 260 of file wifi.hpp.

◆ band_mode

WiFi band mode.

Enumerator
ghz_2g_only 

2.4 GHz only.

ghz_5g_only 

5 GHz only.

auto_mode 

Automatic band selection.

Definition at line 271 of file wifi.hpp.

◆ bandwidth

WiFi channel bandwidth.

Enumerator
ht20 

HT20 (20 MHz bandwidth).

ht40 

HT40 (40 MHz bandwidth).

bw80 

80 MHz bandwidth.

bw160 

160 MHz bandwidth.

bw80_80 

80+80 MHz bandwidth.

Definition at line 99 of file wifi.hpp.

◆ channel_5g

5 GHz WiFi channel flags.

Each value represents a specific 5 GHz channel. Can be combined using bitwise operators via the flags<channel_5g> type to form a channel mask.

Enumerator
ch36 

Channel 36.

ch40 

Channel 40.

ch44 

Channel 44.

ch48 

Channel 48.

ch52 

Channel 52.

ch56 

Channel 56.

ch60 

Channel 60.

ch64 

Channel 64.

ch100 

Channel 100.

ch104 

Channel 104.

ch108 

Channel 108.

ch112 

Channel 112.

ch116 

Channel 116.

ch120 

Channel 120.

ch124 

Channel 124.

ch128 

Channel 128.

ch132 

Channel 132.

ch136 

Channel 136.

ch140 

Channel 140.

ch144 

Channel 144.

ch149 

Channel 149.

ch153 

Channel 153.

ch157 

Channel 157.

ch161 

Channel 161.

ch165 

Channel 165.

ch169 

Channel 169.

ch173 

Channel 173.

ch177 

Channel 177.

all 

All 5 GHz channels.

Definition at line 286 of file wifi.hpp.

◆ cipher_type

WiFi cipher type.

Enumerator
none 

No cipher.

wep40 

WEP40 cipher.

wep104 

WEP104 cipher.

tkip 

TKIP cipher.

ccmp 

CCMP cipher.

tkip_ccmp 

TKIP and CCMP cipher.

aes_cmac128 

AES-CMAC-128 cipher.

sms4 

SMS4 cipher.

gcmp 

GCMP cipher.

gcmp256 

GCMP-256 cipher.

aes_gmac128 

AES-GMAC-128 cipher.

aes_gmac256 

AES-GMAC-256 cipher.

unknown 

Unknown cipher type.

Definition at line 221 of file wifi.hpp.

◆ country_policy

WiFi country policy.

Enumerator
auto_policy 

Automatically set country info based on connected AP.

manual 

Manually configured country info.

Definition at line 335 of file wifi.hpp.

◆ disconnect_reason

WiFi disconnection reason codes.

Values 1-68 are IEEE 802.11 standard reason codes. Values 200+ are vendor-specific reason codes for events such as beacon timeout and authentication failure.

Enumerator
unspecified 

Unspecified reason.

auth_expire 

Authentication expired.

auth_leave 

Deauthenticated because sending STA is leaving.

assoc_expire 

Disassociated due to inactivity.

assoc_toomany 

Disassociated because AP is unable to handle all associated STAs.

not_authed 

Class 2 frame received from nonauthenticated STA.

not_assoced 

Class 3 frame received from nonassociated STA.

assoc_leave 

Disassociated because sending STA is leaving.

assoc_not_authed 

STA requesting association is not authenticated.

disassoc_pwrcap_bad 

Disassociated because power capability is unacceptable.

disassoc_supchan_bad 

Disassociated because supported channels are unacceptable.

bss_transition_disassoc 

Disassociated due to BSS transition management.

ie_invalid 

Invalid information element.

mic_failure 

Message integrity code failure.

fourway_handshake_timeout 

4-way handshake timeout.

group_key_update_timeout 

Group key handshake timeout.

ie_in_4way_differs 

Information element in 4-way handshake differs.

group_cipher_invalid 

Invalid group cipher.

pairwise_cipher_invalid 

Invalid pairwise cipher.

akmp_invalid 

Invalid AKMP.

unsupp_rsn_ie_version 

Unsupported RSN information element version.

invalid_rsn_ie_cap 

Invalid RSN information element capabilities.

ieee_802_1x_auth_failed 

IEEE 802.1X authentication failed.

cipher_suite_rejected 

Cipher suite rejected.

tdls_peer_unreachable 

TDLS peer unreachable.

tdls_unspecified 

TDLS unspecified reason.

ssp_requested_disassoc 

SSP requested disassociation.

no_ssp_roaming_agreement 

No SSP roaming agreement.

bad_cipher_or_akm 

Bad cipher or AKM.

not_authorized_this_location 

Not authorized for this location.

service_change_precludes_ts 

Service change precludes TS.

unspecified_qos 

Unspecified QoS reason.

not_enough_bandwidth 

Not enough bandwidth.

missing_acks 

Missing ACKs.

exceeded_txop 

Exceeded TXOP.

sta_leaving 

STA leaving.

end_ba 

Block Ack session ended.

unknown_ba 

Unknown Block Ack.

timeout 

Timeout.

peer_initiated 

Peer initiated disconnect.

ap_initiated 

AP initiated disconnect.

invalid_ft_action_frame_count 

Invalid FT action frame count.

invalid_pmkid 

Invalid PMKID.

invalid_mde 

Invalid MDE.

invalid_fte 

Invalid FTE.

transmission_link_establish_failed 

Transmission link establishment failed.

alterative_channel_occupied 

Alternative channel occupied.

beacon_timeout 

Beacon timeout (AP not responding).

no_ap_found 

No AP found matching the configured SSID.

auth_fail 

Authentication failed.

assoc_fail 

Association failed.

handshake_timeout 

Handshake timeout.

connection_fail 

Connection failed.

ap_tsf_reset 

AP TSF was reset.

roaming 

Roaming to another AP.

assoc_comeback_time_too_long 

Association comeback time too long.

sa_query_timeout 

SA query timeout.

no_ap_found_w_compatible_security 

No AP found with compatible security.

no_ap_found_in_authmode_threshold 

No AP found in authmode threshold.

no_ap_found_in_rssi_threshold 

No AP found in RSSI threshold.

Definition at line 149 of file wifi.hpp.

◆ errc

Error codes for WiFi operations.

Enumerator
not_init 

WiFi driver was not initialized.

not_started 

WiFi driver was not started.

not_stopped 

WiFi driver was not stopped.

if_error 

WiFi interface error.

mode 

WiFi mode error.

state 

WiFi internal state error.

conn 

WiFi internal control block of station error.

nvs 

WiFi internal NVS module error.

mac 

MAC address is invalid.

ssid 

SSID is invalid.

password 

Password is invalid.

timeout 

WiFi timeout.

wake_fail 

WiFi is in sleep state and wakeup failed.

would_block 

The caller would block.

not_connect 

Station still in disconnect status.

post 

Failed to post event to WiFi task.

init_state 

Invalid WiFi state when init/deinit is called.

stop_state 

WiFi stop in progress.

not_assoc 

WiFi connection not associated.

tx_disallow 

WiFi TX is disallowed.

twt_full 

No available TWT flow ID.

twt_setup_timeout 

TWT setup response timeout.

twt_setup_txfail 

TWT setup frame TX failed.

twt_setup_reject 

TWT setup request was rejected by AP.

discard 

Frame discarded.

roc_in_progress 

Remain-on-channel operation in progress.

Definition at line 616 of file wifi.hpp.

◆ event_id

WiFi event IDs.

Used with the wifi::events event base to register listeners and post events.

// use info.ssid, info.channel, etc.
});
constexpr idfxx::event< event_id, connected_event_data > sta_connected
Station connected event with connection details.
Definition wifi.hpp:1173
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Definition error.hpp:120
Information about a successful station connection.
Definition wifi.hpp:1013
Enumerator
ready 

WiFi ready.

scan_done 

Scan completed.

sta_start 

Station started.

sta_stop 

Station stopped.

sta_connected 

Station connected to AP.

sta_disconnected 

Station disconnected from AP.

sta_authmode_change 

Station authentication mode changed.

sta_wps_er_success 

WPS enrollee success.

sta_wps_er_failed 

WPS enrollee failed.

sta_wps_er_timeout 

WPS enrollee timeout.

sta_wps_er_pin 

WPS enrollee PIN code received.

sta_wps_er_pbc_overlap 

WPS PBC overlap detected.

ap_start 

Soft-AP started.

ap_stop 

Soft-AP stopped.

ap_sta_connected 

Station connected to soft-AP.

ap_sta_disconnected 

Station disconnected from soft-AP.

ap_probe_req_received 

Soft-AP received probe request.

ftm_report 

FTM report received.

sta_bss_rssi_low 

Station BSS RSSI is below threshold.

action_tx_status 

Action frame TX status.

roc_done 

Remain-on-channel done.

sta_beacon_timeout 

Station beacon timeout.

connectionless_module_wake_interval_start 

Connectionless module wake interval start.

ap_wps_rg_success 

AP WPS registrar success.

ap_wps_rg_failed 

AP WPS registrar failed.

ap_wps_rg_timeout 

AP WPS registrar timeout.

ap_wps_rg_pin 

AP WPS registrar PIN received.

ap_wps_rg_pbc_overlap 

AP WPS PBC overlap detected.

itwt_setup 

Individual TWT setup.

itwt_teardown 

Individual TWT teardown.

itwt_probe 

Individual TWT probe.

itwt_suspend 

Individual TWT suspend.

twt_wakeup 

TWT wakeup.

btwt_setup 

Broadcast TWT setup.

btwt_teardown 

Broadcast TWT teardown.

nan_started 

NAN started.

nan_stopped 

NAN stopped.

nan_svc_match 

NAN service match.

nan_replied 

NAN replied.

nan_receive 

NAN receive.

ndp_indication 

NDP indication.

ndp_confirm 

NDP confirm.

ndp_terminated 

NDP terminated.

home_channel_change 

Home channel changed.

sta_neighbor_rep 

Station neighbor report received.

ap_wrong_password 

AP detected wrong password from station.

sta_beacon_offset_unstable 

Station beacon offset unstable.

dpp_uri_ready 

DPP URI ready.

dpp_cfg_recvd 

DPP configuration received.

dpp_failed 

DPP failed.

Definition at line 933 of file wifi.hpp.

◆ event_mask

WiFi event mask flags.

Controls which events are suppressed from the event loop. Can be combined using bitwise operators via the flags<event_mask> type.

Enumerator
all 

All events.

none 

No events.

ap_probe_req_rx 

AP probe request received event.

Definition at line 454 of file wifi.hpp.

◆ ftm_status

FTM (Fine Timing Measurement) session status.

Enumerator
success 

FTM session completed successfully.

unsupported 

FTM not supported by peer.

conf_rejected 

FTM configuration rejected by peer.

no_response 

No response from peer.

fail 

FTM session failed.

no_valid_msmt 

No valid measurements obtained.

user_term 

FTM session terminated by user.

Definition at line 509 of file wifi.hpp.

◆ phy_mode

WiFi PHY mode.

Enumerator
lr 

Long Range mode.

b11b 

802.11b mode.

b11g 

802.11g mode.

b11a 

802.11a mode.

ht20 

HT20 mode.

ht40 

HT40 mode.

he20 

HE20 mode.

vht20 

VHT20 mode.

Definition at line 243 of file wifi.hpp.

◆ phy_rate

WiFi PHY transmission rate.

Specifies the physical layer data rate for 802.11 frame transmission. Includes rates for 802.11b (long/short preamble), OFDM (802.11a/g), HT (802.11n) with long/short guard interval, and Long Range modes.

Enumerator
rate_1m_l 

1 Mbps with long preamble.

rate_2m_l 

2 Mbps with long preamble.

rate_5m_l 

5.5 Mbps with long preamble.

rate_11m_l 

11 Mbps with long preamble.

rate_2m_s 

2 Mbps with short preamble.

rate_5m_s 

5.5 Mbps with short preamble.

rate_11m_s 

11 Mbps with short preamble.

rate_48m 

48 Mbps (OFDM).

rate_24m 

24 Mbps (OFDM).

rate_12m 

12 Mbps (OFDM).

rate_6m 

6 Mbps (OFDM).

rate_54m 

54 Mbps (OFDM).

rate_36m 

36 Mbps (OFDM).

rate_18m 

18 Mbps (OFDM).

rate_9m 

9 Mbps (OFDM).

mcs0_lgi 

MCS0 with long guard interval.

mcs1_lgi 

MCS1 with long guard interval.

mcs2_lgi 

MCS2 with long guard interval.

mcs3_lgi 

MCS3 with long guard interval.

mcs4_lgi 

MCS4 with long guard interval.

mcs5_lgi 

MCS5 with long guard interval.

mcs6_lgi 

MCS6 with long guard interval.

mcs7_lgi 

MCS7 with long guard interval.

mcs0_sgi 

MCS0 with short guard interval.

mcs1_sgi 

MCS1 with short guard interval.

mcs2_sgi 

MCS2 with short guard interval.

mcs3_sgi 

MCS3 with short guard interval.

mcs4_sgi 

MCS4 with short guard interval.

mcs5_sgi 

MCS5 with short guard interval.

mcs6_sgi 

MCS6 with short guard interval.

mcs7_sgi 

MCS7 with short guard interval.

lora_250k 

250 Kbps Long Range rate.

lora_500k 

500 Kbps Long Range rate.

Definition at line 529 of file wifi.hpp.

◆ power_save

WiFi power save mode.

Enumerator
none 

No power saving.

min_modem 

Minimum modem power saving. Station wakes up every DTIM.

max_modem 

Maximum modem power saving. Station wakes up every listen interval.

Definition at line 87 of file wifi.hpp.

◆ promiscuous_ctrl_filter

Promiscuous mode control frame sub-type filter flags.

Can be combined using bitwise operators via the flags<promiscuous_ctrl_filter> type.

Enumerator
all 

Accept all control sub-types.

wrapper 

Accept wrapper frames.

bar 

Accept Block Ack Request frames.

ba 

Accept Block Ack frames.

pspoll 

Accept PS-Poll frames.

rts 

Accept RTS frames.

cts 

Accept CTS frames.

ack 

Accept ACK frames.

cfend 

Accept CF-End frames.

cfendack 

Accept CF-End + CF-Ack frames.

Definition at line 432 of file wifi.hpp.

◆ promiscuous_filter

Promiscuous mode filter flags.

Can be combined using bitwise operators via the flags<promiscuous_filter> type.

Enumerator
all 

Accept all packet types.

mgmt 

Accept management packets.

ctrl 

Accept control packets.

data 

Accept data packets.

misc 

Accept miscellaneous packets.

data_mpdu 

Accept data MPDU packets.

data_ampdu 

Accept data AMPDU packets.

fcsfail 

Accept FCS-failed packets.

Definition at line 413 of file wifi.hpp.

◆ promiscuous_pkt_type

Promiscuous mode packet type.

Enumerator
mgmt 

Management frame.

ctrl 

Control frame.

data 

Data frame.

misc 

Miscellaneous frame.

Definition at line 398 of file wifi.hpp.

◆ protocol

WiFi protocol flags.

Can be combined using bitwise operators via the flags<protocol> type.

Enumerator
b11b 

802.11b protocol.

b11g 

802.11g protocol.

b11n 

802.11n protocol.

lr 

Long Range protocol.

b11a 

802.11a protocol.

b11ac 

802.11ac protocol.

b11ax 

802.11ax protocol.

Definition at line 382 of file wifi.hpp.

◆ role

WiFi role (station and/or access point).

Combined via flags<role> to specify which roles are active (e.g. set_roles(role::sta | role::ap)), or passed individually to functions that operate on one interface (e.g. set_bandwidth(role::sta, …)).

Enumerator
sta 

Station role.

ap 

Access point role.

Definition at line 52 of file wifi.hpp.

◆ sae_pk_mode

SAE-PK (Public Key) mode.

Enumerator
automatic 

Automatic SAE-PK mode.

only 

SAE-PK only mode.

disabled 

SAE-PK disabled.

Definition at line 368 of file wifi.hpp.

◆ sae_pwe_method

SAE PWE (Password Element) derivation method.

Enumerator
hunt_and_peck 

Hunting and Pecking method.

hash_to_element 

Hash-to-Element method.

Definition at line 357 of file wifi.hpp.

◆ scan_method

WiFi scan method.

Enumerator
fast 

Fast scan (stop on first match).

all_channel 

Scan all channels.

Definition at line 346 of file wifi.hpp.

◆ scan_type

WiFi scan type.

Enumerator
active 

Active scan (sends probe requests).

passive 

Passive scan (listens for beacons).

Definition at line 113 of file wifi.hpp.

◆ second_channel

WiFi secondary channel position relative to the primary channel.

Enumerator
above 

Secondary channel is above the primary channel.

below 

Secondary channel is below the primary channel.

Definition at line 124 of file wifi.hpp.

◆ sort_method

WiFi AP sort method for connection.

Enumerator
by_rssi 

Sort by signal strength (RSSI).

by_security 

Sort by security mode.

Definition at line 135 of file wifi.hpp.

◆ statis_module

WiFi statistics module flags.

Identifies which internal WiFi modules should dump their statistics. Can be combined using bitwise operators via the flags<statis_module> type.

Enumerator
buffer 

Buffer allocation statistics.

rxtx 

RX/TX statistics.

hw 

Hardware statistics.

diag 

Diagnostic statistics.

ps 

Power-save statistics.

all 

All modules.

Definition at line 469 of file wifi.hpp.

◆ storage

WiFi configuration storage location.

Enumerator
flash 

Store configuration in flash (NVS).

ram 

Store configuration in RAM only.

Definition at line 324 of file wifi.hpp.

◆ vendor_ie_id

Vendor-specific IE index.

Enumerator
id_0 

Vendor IE index 0.

id_1 

Vendor IE index 1.

Definition at line 498 of file wifi.hpp.

◆ vendor_ie_type

Vendor-specific IE type.

Enumerator
beacon 

Beacon frame.

probe_req 

Probe request frame.

probe_resp 

Probe response frame.

assoc_req 

Association request frame.

assoc_resp 

Association response frame.

Definition at line 484 of file wifi.hpp.

Function Documentation

◆ ap_get_sta_aid()

uint16_t idfxx::wifi::ap_get_sta_aid ( mac_address  mac)

Gets the association ID for a station connected to the soft-AP.

Parameters
macMAC address of the station.
Returns
The association ID.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ clear_ap_list()

void idfxx::wifi::clear_ap_list ( )

Clears the AP list stored from a previous scan.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ clear_fast_connect()

void idfxx::wifi::clear_fast_connect ( )

Clears the fast-connect data stored in memory.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ config_11b_rate()

void idfxx::wifi::config_11b_rate ( enum role  iface,
bool  disable 
)

Enables or disables 802.11b rate for the specified interface.

Parameters
ifaceThe WiFi interface.
disableTrue to disable 11b rate, false to enable.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ config_80211_tx_rate()

void idfxx::wifi::config_80211_tx_rate ( enum role  iface,
enum phy_rate  rate 
)

Sets the 802.11 TX rate for the specified interface.

Parameters
ifaceThe WiFi interface.
rateThe PHY transmission rate.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ connect()

void idfxx::wifi::connect ( )

Connects to the configured access point.

The WiFi subsystem must be started before connecting. Connection progress is reported via WiFi and IP events.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ connectionless_module_set_wake_interval()

void idfxx::wifi::connectionless_module_set_wake_interval ( uint16_t  interval)

Sets the connectionless module wake interval.

Parameters
intervalThe wake interval value.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ create_default_ap_netif()

netif::interface idfxx::wifi::create_default_ap_netif ( )

Creates a default WiFi access point network interface.

Creates and returns an RAII netif configured as a WiFi access point with default settings. Must be called after netif::init().

Returns
The network interface.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_errorif the interface could not be created.

◆ create_default_sta_netif()

netif::interface idfxx::wifi::create_default_sta_netif ( )

Creates a default WiFi station network interface.

Creates and returns an RAII netif configured as a WiFi station with default settings. Must be called after netif::init().

Returns
The network interface.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_errorif the interface could not be created.

◆ deauth_sta()

void idfxx::wifi::deauth_sta ( uint16_t  aid)

Deauthenticates a station from the soft-AP.

Parameters
aidAssociation ID of the station to deauthenticate (0 = all).
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ deinit()

void idfxx::wifi::deinit ( )

Deinitializes the WiFi subsystem and frees resources.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ disable_pmf_config()

void idfxx::wifi::disable_pmf_config ( enum role  iface)

Disables PMF (Protected Management Frames) for the specified interface.

Parameters
ifaceThe WiFi interface.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ disconnect()

void idfxx::wifi::disconnect ( )

Disconnects from the current access point.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ force_wakeup_acquire()

void idfxx::wifi::force_wakeup_acquire ( )

Acquires a WiFi wakeup lock.

Prevents the WiFi modem from entering sleep while the lock is held.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ force_wakeup_release()

void idfxx::wifi::force_wakeup_release ( )

Releases a WiFi wakeup lock.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ ftm_end_session()

void idfxx::wifi::ftm_end_session ( )

Ends the current FTM session.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ ftm_get_report()

std::vector< ftm_report_entry > idfxx::wifi::ftm_get_report ( size_t  max_entries)

Retrieves the FTM measurement report entries.

Only valid when ftm_initiator_config::use_get_report_api is true.

Parameters
max_entriesMaximum number of entries to retrieve.
Returns
A vector of FTM report entries.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ ftm_initiate_session()

void idfxx::wifi::ftm_initiate_session ( const ftm_initiator_config cfg)

Initiates an FTM (Fine Timing Measurement) session.

Parameters
cfgThe FTM initiator configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ ftm_resp_set_offset()

void idfxx::wifi::ftm_resp_set_offset ( int16_t  offset)

Sets the FTM responder offset.

Parameters
offsetThe offset value in nanoseconds.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_ap_config()

ap_config idfxx::wifi::get_ap_config ( )

Gets the current WiFi access point configuration.

Returns
The current access point configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_ap_info()

ap_record idfxx::wifi::get_ap_info ( )

Gets information about the currently connected access point.

Returns
The AP information.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_band()

enum band idfxx::wifi::get_band ( )

Gets the current WiFi band.

Returns
The current frequency band.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_band_mode()

enum band_mode idfxx::wifi::get_band_mode ( )

Gets the current WiFi band mode.

Returns
The current band mode.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_bandwidth()

enum bandwidth idfxx::wifi::get_bandwidth ( enum role  iface)

Gets the current channel bandwidth for the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
The current bandwidth.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_bandwidths()

bandwidths_config idfxx::wifi::get_bandwidths ( enum role  iface)

Gets bandwidths for dual-band operation on the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
The bandwidth configuration for both bands.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_channel()

channel_info idfxx::wifi::get_channel ( )

Gets the current primary and secondary channel.

Returns
The channel information.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_country()

country_config idfxx::wifi::get_country ( )

Gets the current WiFi country configuration.

Returns
The country configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_country_code()

std::string idfxx::wifi::get_country_code ( )

Gets the current country code.

Returns
The current country code string.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_csi_config()

csi_config idfxx::wifi::get_csi_config ( )

Gets the current CSI configuration.

Returns
The current CSI configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_event_mask()

flags< event_mask > idfxx::wifi::get_event_mask ( )

Gets the current WiFi event mask.

Returns
The current event mask.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_inactive_time()

uint16_t idfxx::wifi::get_inactive_time ( enum role  iface)

Gets the inactive time before a station is deauthenticated.

Parameters
ifaceThe WiFi interface.
Returns
The inactive time in seconds.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_mac()

mac_address idfxx::wifi::get_mac ( enum role  iface)

Gets the MAC address for the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
The MAC address.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_max_tx_power()

int8_t idfxx::wifi::get_max_tx_power ( )

Gets the current maximum transmit power.

Returns
The maximum TX power in 0.25 dBm units.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_negotiated_phymode()

enum phy_mode idfxx::wifi::get_negotiated_phymode ( )

Gets the PHY mode negotiated with the connected AP.

Returns
The negotiated PHY mode.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_power_save()

enum power_save idfxx::wifi::get_power_save ( )

Gets the current power save mode.

Returns
The current power save mode.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_promiscuous()

bool idfxx::wifi::get_promiscuous ( )

Gets whether promiscuous mode is enabled.

Returns
True if promiscuous mode is enabled.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_promiscuous_ctrl_filter()

flags< promiscuous_ctrl_filter > idfxx::wifi::get_promiscuous_ctrl_filter ( )

Gets the current promiscuous mode control frame sub-type filter.

Returns
The current control frame filter flags.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_promiscuous_filter()

flags< promiscuous_filter > idfxx::wifi::get_promiscuous_filter ( )

Gets the current promiscuous mode packet type filter.

Returns
The current filter flags.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_protocol()

flags< protocol > idfxx::wifi::get_protocol ( enum role  iface)

Gets the enabled WiFi protocols for the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
The enabled protocol flags.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_protocols()

protocols_config idfxx::wifi::get_protocols ( enum role  iface)

Gets the enabled WiFi protocols for dual-band operation.

Parameters
ifaceThe WiFi interface.
Returns
The protocol configuration for both bands.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_roles()

flags< role > idfxx::wifi::get_roles ( )

Gets the currently active WiFi roles.

Returns
The active roles.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_rssi()

int idfxx::wifi::get_rssi ( )

Gets the current RSSI of the connected AP.

Returns
The RSSI value (dBm).
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_scan_parameters()

scan_default_params idfxx::wifi::get_scan_parameters ( )

Gets the current default scan timing parameters.

Returns
The current scan timing parameters.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_sta_config()

sta_config idfxx::wifi::get_sta_config ( )

Gets the current WiFi station configuration.

Returns
The current station configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_sta_list()

std::vector< sta_info > idfxx::wifi::get_sta_list ( )

Gets the list of stations connected to the soft-AP.

Returns
A vector of connected station information.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ get_tsf_time()

int64_t idfxx::wifi::get_tsf_time ( enum role  iface)

Gets the TSF (Timing Synchronization Function) time for the specified interface.

This function does not return an error; it always returns a timestamp.

Parameters
ifaceThe WiFi interface.
Returns
The TSF time in microseconds.

◆ init()

void idfxx::wifi::init ( const init_config cfg = {})

Initializes the WiFi subsystem.

Must be called before any other WiFi functions. When called with no arguments or an empty config, all Kconfig defaults are used.

Parameters
cfgInitialization configuration. Defaults to Kconfig values.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ make_error_code()

std::error_code idfxx::wifi::make_error_code ( errc  e)
inlinenoexcept

Creates an error code from an idfxx::wifi::errc value.

Parameters
eThe WiFi error code enumerator.
Returns
The corresponding std::error_code.

Definition at line 3488 of file wifi.hpp.

References idfxx::make_error_code(), and idfxx::wifi_category().

◆ register_80211_tx_cb()

void idfxx::wifi::register_80211_tx_cb ( void(*)(const void *)  cb)

Registers a callback for 802.11 TX completion.

The callback receives a pointer to TX info (cast from esp_wifi_80211_tx_info_t).

Parameters
cbCallback function pointer.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ restore()

void idfxx::wifi::restore ( )

Restores WiFi stack persistent settings to defaults.

Resets configuration stored in NVS to factory defaults.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ scan()

std::vector< ap_record > idfxx::wifi::scan ( const scan_config cfg = {})

Performs a blocking scan for access points.

Starts a scan and waits for it to complete before returning results.

Parameters
cfgScan configuration. Defaults to scanning all channels.
Returns
A vector of discovered access points sorted by RSSI.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ scan_get_ap_num()

uint16_t idfxx::wifi::scan_get_ap_num ( )

Gets the number of APs found in the last scan.

Returns
The number of APs found.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ scan_get_results()

std::vector< ap_record > idfxx::wifi::scan_get_results ( )

Retrieves results from a completed scan.

Call this after receiving the wifi::event_id::scan_done event.

Returns
A vector of discovered access points.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ scan_start()

void idfxx::wifi::scan_start ( const scan_config cfg = {})

Starts a non-blocking scan for access points.

Initiates a scan that runs asynchronously. Listen for the wifi::event_id::scan_done event, then call scan_get_results() to retrieve the results.

Parameters
cfgScan configuration. Defaults to scanning all channels.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ scan_stop()

void idfxx::wifi::scan_stop ( )

Stops an in-progress scan.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_ap_config()

void idfxx::wifi::set_ap_config ( const ap_config cfg)

Sets the WiFi access point configuration.

Parameters
cfgThe access point configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_band()

void idfxx::wifi::set_band ( enum band  b)

Sets the WiFi band.

Parameters
bThe frequency band.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_band_mode()

void idfxx::wifi::set_band_mode ( enum band_mode  m)

Sets the WiFi band mode.

Parameters
mThe band mode.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_bandwidth()

void idfxx::wifi::set_bandwidth ( enum role  iface,
enum bandwidth  bw 
)

Sets the channel bandwidth for the specified interface.

Parameters
ifaceThe WiFi interface.
bwThe bandwidth.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_bandwidths()

void idfxx::wifi::set_bandwidths ( enum role  iface,
const bandwidths_config bw 
)

Sets bandwidths for dual-band operation on the specified interface.

Parameters
ifaceThe WiFi interface.
bwThe bandwidth configuration for both bands.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_channel()

void idfxx::wifi::set_channel ( uint8_t  primary,
std::optional< enum second_channel second = std::nullopt 
)

Sets the primary and secondary channel.

Parameters
primaryThe primary channel number.
secondThe secondary channel position, or nullopt for HT20 (no secondary channel).
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_country()

void idfxx::wifi::set_country ( const country_config cfg)

Sets the WiFi country configuration.

Parameters
cfgThe country configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_country_code()

void idfxx::wifi::set_country_code ( std::string_view  cc,
bool  ieee80211d_enabled 
)

Sets the country code.

Parameters
ccTwo-character country code string.
ieee80211d_enabledWhether to enable IEEE 802.11d.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_csi()

void idfxx::wifi::set_csi ( bool  en)

Enables or disables CSI (Channel State Information) collection.

Parameters
enTrue to enable, false to disable.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_csi_config()

void idfxx::wifi::set_csi_config ( const csi_config cfg)

Sets the CSI configuration.

Parameters
cfgThe CSI configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_csi_rx_cb()

void idfxx::wifi::set_csi_rx_cb ( void(*)(void *, void *)  cb,
void ctx 
)

Registers a callback for CSI data reception.

Parameters
cbCallback function: (ctx, csi_data).
ctxUser context pointer passed to the callback.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_dynamic_cs()

void idfxx::wifi::set_dynamic_cs ( bool  enabled)

Enables or disables dynamic CS (Carrier Sense).

Parameters
enabledTrue to enable, false to disable.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_event_mask()

void idfxx::wifi::set_event_mask ( flags< event_mask mask)

Sets the WiFi event mask.

Controls which events are sent to the event loop.

Parameters
maskEvent mask flags indicating which events to suppress.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_inactive_time()

void idfxx::wifi::set_inactive_time ( enum role  iface,
uint16_t  sec 
)

Sets the inactive time before a station is deauthenticated.

Parameters
ifaceThe WiFi interface.
secInactive time in seconds.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_mac()

void idfxx::wifi::set_mac ( enum role  iface,
mac_address  mac 
)

Sets the MAC address for the specified interface.

Parameters
ifaceThe WiFi interface.
macThe MAC address as a 6-byte array.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_max_tx_power()

void idfxx::wifi::set_max_tx_power ( int8_t  power)

Sets the maximum transmit power.

Parameters
powerMaximum TX power in 0.25 dBm units (range: [8, 84]).
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_power_save()

void idfxx::wifi::set_power_save ( enum power_save  ps)

Sets the power save mode.

Parameters
psThe power save mode.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_promiscuous()

void idfxx::wifi::set_promiscuous ( bool  en)

Enables or disables promiscuous mode.

Parameters
enTrue to enable, false to disable.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_promiscuous_ctrl_filter()

void idfxx::wifi::set_promiscuous_ctrl_filter ( flags< promiscuous_ctrl_filter filter)

Sets the promiscuous mode control frame sub-type filter.

Parameters
filterThe control frame filter flags to apply.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_promiscuous_filter()

void idfxx::wifi::set_promiscuous_filter ( flags< promiscuous_filter filter)

Sets the promiscuous mode packet type filter.

Parameters
filterThe filter flags to apply.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_promiscuous_rx_cb()

void idfxx::wifi::set_promiscuous_rx_cb ( void(*)(void *, int cb)

Sets the promiscuous mode receive callback.

The callback receives a buffer pointer and a packet type integer (cast to promiscuous_pkt_type). See ESP-IDF documentation for buffer format.

Parameters
cbCallback function pointer, or nullptr to clear.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_protocol()

void idfxx::wifi::set_protocol ( enum role  iface,
flags< protocol protos 
)

Sets the enabled WiFi protocols for the specified interface.

Parameters
ifaceThe WiFi interface.
protosThe protocol flags to enable.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_protocols()

void idfxx::wifi::set_protocols ( enum role  iface,
const protocols_config cfg 
)

Sets the enabled WiFi protocols for dual-band operation.

Parameters
ifaceThe WiFi interface.
cfgThe protocol configuration for both bands.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_roles()

void idfxx::wifi::set_roles ( flags< role roles)

Sets the active WiFi roles.

Parameters
rolesThe roles to activate (e.g. role::sta, role::sta | role::ap).
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_rssi_threshold()

void idfxx::wifi::set_rssi_threshold ( int32_t  rssi)

Sets the RSSI threshold for the sta_bss_rssi_low event.

Parameters
rssiThe RSSI threshold value (dBm).
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_scan_parameters()

void idfxx::wifi::set_scan_parameters ( const scan_default_params params)

Sets the default scan timing parameters.

Parameters
paramsThe scan timing parameters.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_sta_config()

void idfxx::wifi::set_sta_config ( const sta_config cfg)

Sets the WiFi station configuration.

Parameters
cfgThe station configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_storage()

void idfxx::wifi::set_storage ( enum storage  s)

Sets the WiFi configuration storage location.

Parameters
sThe storage location (flash or RAM).
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_vendor_ie()

void idfxx::wifi::set_vendor_ie ( bool  enable,
enum vendor_ie_type  type,
enum vendor_ie_id  id,
const void vnd_ie 
)

Sets a vendor-specific information element.

Parameters
enableWhether to enable or disable the vendor IE.
typeThe frame type for the vendor IE.
idThe vendor IE index.
vnd_iePointer to the vendor IE data.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ set_vendor_ie_cb()

void idfxx::wifi::set_vendor_ie_cb ( void(*)(void *, int, const uint8_t *, const void *, int cb,
void ctx 
)

Registers a callback for received vendor-specific IEs.

Parameters
cbCallback function: (ctx, type, source_mac, vendor_ie_data, rssi).
ctxUser context pointer passed to the callback.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ sta_get_aid()

uint16_t idfxx::wifi::sta_get_aid ( )

Gets the association ID assigned by the AP in station mode.

Returns
The association ID.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ start()

void idfxx::wifi::start ( )

Starts the WiFi subsystem.

After starting, configured interfaces become active. A mode must be set before starting.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ statis_dump()

void idfxx::wifi::statis_dump ( flags< statis_module modules)

Dumps WiFi statistics for the specified modules.

Parameters
modulesFlags indicating which modules to dump statistics for.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ stop()

void idfxx::wifi::stop ( )

Stops the WiFi subsystem.

Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

◆ try_ap_get_sta_aid()

result< uint16_t > idfxx::wifi::try_ap_get_sta_aid ( mac_address  mac)

Gets the association ID for a station connected to the soft-AP.

Parameters
macMAC address of the station.
Returns
The association ID, or an error.

◆ try_clear_ap_list()

result< void > idfxx::wifi::try_clear_ap_list ( )

Clears the AP list stored from a previous scan.

Returns
Success, or an error.

◆ try_clear_fast_connect()

result< void > idfxx::wifi::try_clear_fast_connect ( )

Clears the fast-connect data stored in memory.

Returns
Success, or an error.

◆ try_config_11b_rate()

result< void > idfxx::wifi::try_config_11b_rate ( enum role  iface,
bool  disable 
)

Enables or disables 802.11b rate for the specified interface.

Parameters
ifaceThe WiFi interface.
disableTrue to disable 11b rate, false to enable.
Returns
Success, or an error.

◆ try_config_80211_tx_rate()

result< void > idfxx::wifi::try_config_80211_tx_rate ( enum role  iface,
enum phy_rate  rate 
)

Sets the 802.11 TX rate for the specified interface.

Parameters
ifaceThe WiFi interface.
rateThe PHY transmission rate.
Returns
Success, or an error.

◆ try_connect()

result< void > idfxx::wifi::try_connect ( )

Connects to the configured access point.

The WiFi subsystem must be started before connecting. Connection progress is reported via WiFi and IP events.

Returns
Success, or an error.

◆ try_connectionless_module_set_wake_interval()

result< void > idfxx::wifi::try_connectionless_module_set_wake_interval ( uint16_t  interval)

Sets the connectionless module wake interval.

Parameters
intervalThe wake interval value.
Returns
Success, or an error.

◆ try_create_default_ap_netif()

result< netif::interface > idfxx::wifi::try_create_default_ap_netif ( )

Creates a default WiFi access point network interface.

Creates and returns an RAII netif configured as a WiFi access point with default settings. Must be called after netif::init().

Returns
Result containing the network interface, or an error code.

◆ try_create_default_sta_netif()

result< netif::interface > idfxx::wifi::try_create_default_sta_netif ( )

Creates a default WiFi station network interface.

Creates and returns an RAII netif configured as a WiFi station with default settings. Must be called after netif::init().

Returns
Result containing the network interface, or an error code.

◆ try_deauth_sta()

result< void > idfxx::wifi::try_deauth_sta ( uint16_t  aid)

Deauthenticates a station from the soft-AP.

Parameters
aidAssociation ID of the station to deauthenticate (0 = all).
Returns
Success, or an error.

◆ try_deinit()

result< void > idfxx::wifi::try_deinit ( )

Deinitializes the WiFi subsystem and frees resources.

Returns
Success, or an error.

◆ try_disable_pmf_config()

result< void > idfxx::wifi::try_disable_pmf_config ( enum role  iface)

Disables PMF (Protected Management Frames) for the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
Success, or an error.

◆ try_disconnect()

result< void > idfxx::wifi::try_disconnect ( )

Disconnects from the current access point.

Returns
Success, or an error.

◆ try_force_wakeup_acquire()

result< void > idfxx::wifi::try_force_wakeup_acquire ( )

Acquires a WiFi wakeup lock.

Prevents the WiFi modem from entering sleep while the lock is held.

Returns
Success, or an error.

◆ try_force_wakeup_release()

result< void > idfxx::wifi::try_force_wakeup_release ( )

Releases a WiFi wakeup lock.

Returns
Success, or an error.

◆ try_ftm_end_session()

result< void > idfxx::wifi::try_ftm_end_session ( )

Ends the current FTM session.

Returns
Success, or an error.

◆ try_ftm_get_report()

result< std::vector< ftm_report_entry > > idfxx::wifi::try_ftm_get_report ( size_t  max_entries)

Retrieves the FTM measurement report entries.

Only valid when ftm_initiator_config::use_get_report_api is true.

Parameters
max_entriesMaximum number of entries to retrieve.
Returns
A vector of FTM report entries, or an error.

◆ try_ftm_initiate_session()

result< void > idfxx::wifi::try_ftm_initiate_session ( const ftm_initiator_config cfg)

Initiates an FTM (Fine Timing Measurement) session.

Parameters
cfgThe FTM initiator configuration.
Returns
Success, or an error.

◆ try_ftm_resp_set_offset()

result< void > idfxx::wifi::try_ftm_resp_set_offset ( int16_t  offset)

Sets the FTM responder offset.

Parameters
offsetThe offset value in nanoseconds.
Returns
Success, or an error.

◆ try_get_ap_config()

result< ap_config > idfxx::wifi::try_get_ap_config ( )

Gets the current WiFi access point configuration.

Returns
The current access point configuration, or an error.

◆ try_get_ap_info()

result< ap_record > idfxx::wifi::try_get_ap_info ( )

Gets information about the currently connected access point.

Returns
The AP information, or an error.

◆ try_get_band()

result< enum band > idfxx::wifi::try_get_band ( )

Gets the current WiFi band.

Returns
The current frequency band, or an error.

◆ try_get_band_mode()

result< enum band_mode > idfxx::wifi::try_get_band_mode ( )

Gets the current WiFi band mode.

Returns
The current band mode, or an error.

◆ try_get_bandwidth()

result< enum bandwidth > idfxx::wifi::try_get_bandwidth ( enum role  iface)

Gets the current channel bandwidth for the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
The current bandwidth, or an error.

◆ try_get_bandwidths()

result< bandwidths_config > idfxx::wifi::try_get_bandwidths ( enum role  iface)

Gets bandwidths for dual-band operation on the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
The bandwidth configuration for both bands, or an error.

◆ try_get_channel()

result< channel_info > idfxx::wifi::try_get_channel ( )

Gets the current primary and secondary channel.

Returns
The channel information, or an error.

◆ try_get_country()

result< country_config > idfxx::wifi::try_get_country ( )

Gets the current WiFi country configuration.

Returns
The country configuration, or an error.

◆ try_get_country_code()

result< std::string > idfxx::wifi::try_get_country_code ( )

Gets the current country code.

Returns
The current country code string, or an error.

◆ try_get_csi_config()

result< csi_config > idfxx::wifi::try_get_csi_config ( )

Gets the current CSI configuration.

Returns
The current CSI configuration, or an error.

◆ try_get_event_mask()

result< flags< event_mask > > idfxx::wifi::try_get_event_mask ( )

Gets the current WiFi event mask.

Returns
The current event mask, or an error.

◆ try_get_inactive_time()

result< uint16_t > idfxx::wifi::try_get_inactive_time ( enum role  iface)

Gets the inactive time before a station is deauthenticated.

Parameters
ifaceThe WiFi interface.
Returns
The inactive time in seconds, or an error.

◆ try_get_mac()

result< mac_address > idfxx::wifi::try_get_mac ( enum role  iface)

Gets the MAC address for the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
The MAC address, or an error.

◆ try_get_max_tx_power()

result< int8_t > idfxx::wifi::try_get_max_tx_power ( )

Gets the current maximum transmit power.

Returns
The maximum TX power in 0.25 dBm units, or an error.

◆ try_get_negotiated_phymode()

result< enum phy_mode > idfxx::wifi::try_get_negotiated_phymode ( )

Gets the PHY mode negotiated with the connected AP.

Returns
The negotiated PHY mode, or an error.

◆ try_get_power_save()

result< enum power_save > idfxx::wifi::try_get_power_save ( )

Gets the current power save mode.

Returns
The current power save mode, or an error.

◆ try_get_promiscuous()

result< bool > idfxx::wifi::try_get_promiscuous ( )

Gets whether promiscuous mode is enabled.

Returns
True if promiscuous mode is enabled, or an error.

◆ try_get_promiscuous_ctrl_filter()

result< flags< promiscuous_ctrl_filter > > idfxx::wifi::try_get_promiscuous_ctrl_filter ( )

Gets the current promiscuous mode control frame sub-type filter.

Returns
The current control frame filter flags, or an error.

◆ try_get_promiscuous_filter()

result< flags< promiscuous_filter > > idfxx::wifi::try_get_promiscuous_filter ( )

Gets the current promiscuous mode packet type filter.

Returns
The current filter flags, or an error.

◆ try_get_protocol()

result< flags< protocol > > idfxx::wifi::try_get_protocol ( enum role  iface)

Gets the enabled WiFi protocols for the specified interface.

Parameters
ifaceThe WiFi interface.
Returns
The enabled protocol flags, or an error.

◆ try_get_protocols()

result< protocols_config > idfxx::wifi::try_get_protocols ( enum role  iface)

Gets the enabled WiFi protocols for dual-band operation.

Parameters
ifaceThe WiFi interface.
Returns
The protocol configuration for both bands, or an error.

◆ try_get_roles()

result< flags< role > > idfxx::wifi::try_get_roles ( )

Gets the currently active WiFi roles.

Returns
The active roles, or an error.

◆ try_get_rssi()

result< int > idfxx::wifi::try_get_rssi ( )

Gets the current RSSI of the connected AP.

Returns
The RSSI value (dBm), or an error.

◆ try_get_scan_parameters()

result< scan_default_params > idfxx::wifi::try_get_scan_parameters ( )

Gets the current default scan timing parameters.

Returns
The current scan timing parameters, or an error.

◆ try_get_sta_config()

result< sta_config > idfxx::wifi::try_get_sta_config ( )

Gets the current WiFi station configuration.

Returns
The current station configuration, or an error.

◆ try_get_sta_list()

result< std::vector< sta_info > > idfxx::wifi::try_get_sta_list ( )

Gets the list of stations connected to the soft-AP.

Returns
A vector of connected station information, or an error.

◆ try_init()

result< void > idfxx::wifi::try_init ( const init_config cfg = {})

Initializes the WiFi subsystem.

Must be called before any other WiFi functions. When called with no arguments or an empty config, all Kconfig defaults are used.

Parameters
cfgInitialization configuration. Defaults to Kconfig values.
Returns
Success, or an error.

◆ try_register_80211_tx_cb()

result< void > idfxx::wifi::try_register_80211_tx_cb ( void(*)(const void *)  cb)

Registers a callback for 802.11 TX completion.

The callback receives a pointer to TX info (cast from esp_wifi_80211_tx_info_t).

Parameters
cbCallback function pointer.
Returns
Success, or an error.

◆ try_restore()

result< void > idfxx::wifi::try_restore ( )

Restores WiFi stack persistent settings to defaults.

Resets configuration stored in NVS to factory defaults.

Returns
Success, or an error.

◆ try_scan()

result< std::vector< ap_record > > idfxx::wifi::try_scan ( const scan_config cfg = {})

Performs a blocking scan for access points.

Starts a scan and waits for it to complete before returning results.

Parameters
cfgScan configuration. Defaults to scanning all channels.
Returns
A vector of discovered access points sorted by RSSI, or an error.

◆ try_scan_get_ap_num()

result< uint16_t > idfxx::wifi::try_scan_get_ap_num ( )

Gets the number of APs found in the last scan.

Returns
The number of APs found, or an error.

◆ try_scan_get_results()

result< std::vector< ap_record > > idfxx::wifi::try_scan_get_results ( )

Retrieves results from a completed scan.

Call this after receiving the wifi::event_id::scan_done event.

Returns
A vector of discovered access points, or an error.

◆ try_scan_start()

result< void > idfxx::wifi::try_scan_start ( const scan_config cfg = {})

Starts a non-blocking scan for access points.

Initiates a scan that runs asynchronously. Listen for the wifi::event_id::scan_done event, then call try_scan_get_results() to retrieve the results.

Parameters
cfgScan configuration. Defaults to scanning all channels.
Returns
Success, or an error.

◆ try_scan_stop()

result< void > idfxx::wifi::try_scan_stop ( )

Stops an in-progress scan.

Returns
Success, or an error.

◆ try_set_ap_config()

result< void > idfxx::wifi::try_set_ap_config ( const ap_config cfg)

Sets the WiFi access point configuration.

Parameters
cfgThe access point configuration.
Returns
Success, or an error.

◆ try_set_band()

result< void > idfxx::wifi::try_set_band ( enum band  b)

Sets the WiFi band.

Parameters
bThe frequency band.
Returns
Success, or an error.

◆ try_set_band_mode()

result< void > idfxx::wifi::try_set_band_mode ( enum band_mode  m)

Sets the WiFi band mode.

Parameters
mThe band mode.
Returns
Success, or an error.

◆ try_set_bandwidth()

result< void > idfxx::wifi::try_set_bandwidth ( enum role  iface,
enum bandwidth  bw 
)

Sets the channel bandwidth for the specified interface.

Parameters
ifaceThe WiFi interface.
bwThe bandwidth.
Returns
Success, or an error.

◆ try_set_bandwidths()

result< void > idfxx::wifi::try_set_bandwidths ( enum role  iface,
const bandwidths_config bw 
)

Sets bandwidths for dual-band operation on the specified interface.

Parameters
ifaceThe WiFi interface.
bwThe bandwidth configuration for both bands.
Returns
Success, or an error.

◆ try_set_channel()

result< void > idfxx::wifi::try_set_channel ( uint8_t  primary,
std::optional< enum second_channel second = std::nullopt 
)

Sets the primary and secondary channel.

Parameters
primaryThe primary channel number.
secondThe secondary channel position, or nullopt for HT20 (no secondary channel).
Returns
Success, or an error.

◆ try_set_country()

result< void > idfxx::wifi::try_set_country ( const country_config cfg)

Sets the WiFi country configuration.

Parameters
cfgThe country configuration.
Returns
Success, or an error.

◆ try_set_country_code()

result< void > idfxx::wifi::try_set_country_code ( std::string_view  cc,
bool  ieee80211d_enabled 
)

Sets the country code.

Parameters
ccTwo-character country code string.
ieee80211d_enabledWhether to enable IEEE 802.11d.
Returns
Success, or an error.

◆ try_set_csi()

result< void > idfxx::wifi::try_set_csi ( bool  en)

Enables or disables CSI (Channel State Information) collection.

Parameters
enTrue to enable, false to disable.
Returns
Success, or an error.

◆ try_set_csi_config()

result< void > idfxx::wifi::try_set_csi_config ( const csi_config cfg)

Sets the CSI configuration.

Parameters
cfgThe CSI configuration.
Returns
Success, or an error.

◆ try_set_csi_rx_cb()

result< void > idfxx::wifi::try_set_csi_rx_cb ( void(*)(void *, void *)  cb,
void ctx 
)

Registers a callback for CSI data reception.

Parameters
cbCallback function: (ctx, csi_data).
ctxUser context pointer passed to the callback.
Returns
Success, or an error.

◆ try_set_dynamic_cs()

result< void > idfxx::wifi::try_set_dynamic_cs ( bool  enabled)

Enables or disables dynamic CS (Carrier Sense).

Parameters
enabledTrue to enable, false to disable.
Returns
Success, or an error.

◆ try_set_event_mask()

result< void > idfxx::wifi::try_set_event_mask ( flags< event_mask mask)

Sets the WiFi event mask.

Controls which events are sent to the event loop.

Parameters
maskEvent mask flags indicating which events to suppress.
Returns
Success, or an error.

◆ try_set_inactive_time()

result< void > idfxx::wifi::try_set_inactive_time ( enum role  iface,
uint16_t  sec 
)

Sets the inactive time before a station is deauthenticated.

Parameters
ifaceThe WiFi interface.
secInactive time in seconds.
Returns
Success, or an error.

◆ try_set_mac()

result< void > idfxx::wifi::try_set_mac ( enum role  iface,
mac_address  mac 
)

Sets the MAC address for the specified interface.

Parameters
ifaceThe WiFi interface.
macThe MAC address.
Returns
Success, or an error.

◆ try_set_max_tx_power()

result< void > idfxx::wifi::try_set_max_tx_power ( int8_t  power)

Sets the maximum transmit power.

Parameters
powerMaximum TX power in 0.25 dBm units (range: [8, 84]).
Returns
Success, or an error.

◆ try_set_power_save()

result< void > idfxx::wifi::try_set_power_save ( enum power_save  ps)

Sets the power save mode.

Parameters
psThe power save mode.
Returns
Success, or an error.

◆ try_set_promiscuous()

result< void > idfxx::wifi::try_set_promiscuous ( bool  en)

Enables or disables promiscuous mode.

Parameters
enTrue to enable, false to disable.
Returns
Success, or an error.

◆ try_set_promiscuous_ctrl_filter()

result< void > idfxx::wifi::try_set_promiscuous_ctrl_filter ( flags< promiscuous_ctrl_filter filter)

Sets the promiscuous mode control frame sub-type filter.

Parameters
filterThe control frame filter flags to apply.
Returns
Success, or an error.

◆ try_set_promiscuous_filter()

result< void > idfxx::wifi::try_set_promiscuous_filter ( flags< promiscuous_filter filter)

Sets the promiscuous mode packet type filter.

Parameters
filterThe filter flags to apply.
Returns
Success, or an error.

◆ try_set_promiscuous_rx_cb()

result< void > idfxx::wifi::try_set_promiscuous_rx_cb ( void(*)(void *, int cb)

Sets the promiscuous mode receive callback.

The callback receives a buffer pointer and a packet type integer (cast to promiscuous_pkt_type). See ESP-IDF documentation for buffer format.

Parameters
cbCallback function pointer, or nullptr to clear.
Returns
Success, or an error.

◆ try_set_protocol()

result< void > idfxx::wifi::try_set_protocol ( enum role  iface,
flags< protocol protos 
)

Sets the enabled WiFi protocols for the specified interface.

Parameters
ifaceThe WiFi interface.
protosThe protocol flags to enable.
Returns
Success, or an error.

◆ try_set_protocols()

result< void > idfxx::wifi::try_set_protocols ( enum role  iface,
const protocols_config cfg 
)

Sets the enabled WiFi protocols for dual-band operation.

Parameters
ifaceThe WiFi interface.
cfgThe protocol configuration for both bands.
Returns
Success, or an error.

◆ try_set_roles()

result< void > idfxx::wifi::try_set_roles ( flags< role roles)

Sets the active WiFi roles.

Parameters
rolesThe roles to activate (e.g. role::sta, role::sta | role::ap).
Returns
Success, or an error.

◆ try_set_rssi_threshold()

result< void > idfxx::wifi::try_set_rssi_threshold ( int32_t  rssi)

Sets the RSSI threshold for the sta_bss_rssi_low event.

Parameters
rssiThe RSSI threshold value (dBm).
Returns
Success, or an error.

◆ try_set_scan_parameters()

result< void > idfxx::wifi::try_set_scan_parameters ( const scan_default_params params)

Sets the default scan timing parameters.

Parameters
paramsThe scan timing parameters.
Returns
Success, or an error.

◆ try_set_sta_config()

result< void > idfxx::wifi::try_set_sta_config ( const sta_config cfg)

Sets the WiFi station configuration.

Parameters
cfgThe station configuration.
Returns
Success, or an error.

◆ try_set_storage()

result< void > idfxx::wifi::try_set_storage ( enum storage  s)

Sets the WiFi configuration storage location.

Parameters
sThe storage location (flash or RAM).
Returns
Success, or an error.

◆ try_set_vendor_ie()

result< void > idfxx::wifi::try_set_vendor_ie ( bool  enable,
enum vendor_ie_type  type,
enum vendor_ie_id  id,
const void vnd_ie 
)

Sets a vendor-specific information element.

Parameters
enableWhether to enable or disable the vendor IE.
typeThe frame type for the vendor IE.
idThe vendor IE index.
vnd_iePointer to the vendor IE data.
Returns
Success, or an error.

◆ try_set_vendor_ie_cb()

result< void > idfxx::wifi::try_set_vendor_ie_cb ( void(*)(void *, int, const uint8_t *, const void *, int cb,
void ctx 
)

Registers a callback for received vendor-specific IEs.

Parameters
cbCallback function: (ctx, type, source_mac, vendor_ie_data, rssi).
ctxUser context pointer passed to the callback.
Returns
Success, or an error.

◆ try_sta_get_aid()

result< uint16_t > idfxx::wifi::try_sta_get_aid ( )

Gets the association ID assigned by the AP in station mode.

Returns
The association ID, or an error.

◆ try_start()

result< void > idfxx::wifi::try_start ( )

Starts the WiFi subsystem.

After starting, configured interfaces become active. A mode must be set before starting.

Returns
Success, or an error.

◆ try_statis_dump()

result< void > idfxx::wifi::try_statis_dump ( flags< statis_module modules)

Dumps WiFi statistics for the specified modules.

Parameters
modulesFlags indicating which modules to dump statistics for.
Returns
Success, or an error.

◆ try_stop()

result< void > idfxx::wifi::try_stop ( )

Stops the WiFi subsystem.

Returns
Success, or an error.

◆ try_tx_80211()

result< void > idfxx::wifi::try_tx_80211 ( enum role  iface,
std::span< const uint8_t buffer,
bool  en_sys_seq 
)

Transmits a raw 802.11 frame.

Parameters
ifaceThe WiFi interface to transmit on.
bufferThe raw frame data.
en_sys_seqWhether to use system-managed sequence numbers.
Returns
Success, or an error.

◆ tx_80211()

void idfxx::wifi::tx_80211 ( enum role  iface,
std::span< const uint8_t buffer,
bool  en_sys_seq 
)

Transmits a raw 802.11 frame.

Parameters
ifaceThe WiFi interface to transmit on.
bufferThe raw frame data.
en_sys_seqWhether to use system-managed sequence numbers.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled.
Exceptions
std::system_erroron failure.

Variable Documentation

◆ action_tx_status

constexpr idfxx::event<event_id> idfxx::wifi::action_tx_status {event_id::action_tx_status}
inlineconstexpr

Action frame TX status event.

Definition at line 1221 of file wifi.hpp.

◆ ap_probe_req_received

constexpr idfxx::event<event_id, ap_probe_req_event_data> idfxx::wifi::ap_probe_req_received {event_id::ap_probe_req_received}
inlineconstexpr

Probe request received by soft-AP event.

Definition at line 1187 of file wifi.hpp.

◆ ap_sta_connected

constexpr idfxx::event<event_id, ap_sta_connected_event_data> idfxx::wifi::ap_sta_connected {event_id::ap_sta_connected}
inlineconstexpr

Station connected to soft-AP event.

Definition at line 1181 of file wifi.hpp.

◆ ap_sta_disconnected

constexpr idfxx::event<event_id, ap_sta_disconnected_event_data> idfxx::wifi::ap_sta_disconnected
inlineconstexpr
Initial value:
{
event_id::ap_sta_disconnected
}

Station disconnected from soft-AP event.

Definition at line 1183 of file wifi.hpp.

◆ ap_start

constexpr idfxx::event<event_id> idfxx::wifi::ap_start {event_id::ap_start}
inlineconstexpr

Soft-AP started event.

Definition at line 1205 of file wifi.hpp.

◆ ap_stop

constexpr idfxx::event<event_id> idfxx::wifi::ap_stop {event_id::ap_stop}
inlineconstexpr

Soft-AP stopped event.

Definition at line 1207 of file wifi.hpp.

◆ ap_wps_rg_failed

constexpr idfxx::event<event_id> idfxx::wifi::ap_wps_rg_failed {event_id::ap_wps_rg_failed}
inlineconstexpr

AP WPS registrar failed event.

Definition at line 1231 of file wifi.hpp.

◆ ap_wps_rg_pbc_overlap

constexpr idfxx::event<event_id> idfxx::wifi::ap_wps_rg_pbc_overlap {event_id::ap_wps_rg_pbc_overlap}
inlineconstexpr

AP WPS PBC overlap detected event.

Definition at line 1237 of file wifi.hpp.

◆ ap_wps_rg_pin

constexpr idfxx::event<event_id> idfxx::wifi::ap_wps_rg_pin {event_id::ap_wps_rg_pin}
inlineconstexpr

AP WPS registrar PIN received event.

Definition at line 1235 of file wifi.hpp.

◆ ap_wps_rg_success

constexpr idfxx::event<event_id> idfxx::wifi::ap_wps_rg_success {event_id::ap_wps_rg_success}
inlineconstexpr

AP WPS registrar success event.

Definition at line 1229 of file wifi.hpp.

◆ ap_wps_rg_timeout

constexpr idfxx::event<event_id> idfxx::wifi::ap_wps_rg_timeout {event_id::ap_wps_rg_timeout}
inlineconstexpr

AP WPS registrar timeout event.

Definition at line 1233 of file wifi.hpp.

◆ ap_wrong_password

constexpr idfxx::event<event_id> idfxx::wifi::ap_wrong_password {event_id::ap_wrong_password}
inlineconstexpr

AP detected wrong password from station event.

Definition at line 1271 of file wifi.hpp.

◆ btwt_setup

constexpr idfxx::event<event_id> idfxx::wifi::btwt_setup {event_id::btwt_setup}
inlineconstexpr

Broadcast TWT setup event.

Definition at line 1249 of file wifi.hpp.

◆ btwt_teardown

constexpr idfxx::event<event_id> idfxx::wifi::btwt_teardown {event_id::btwt_teardown}
inlineconstexpr

Broadcast TWT teardown event.

Definition at line 1251 of file wifi.hpp.

◆ connectionless_module_wake_interval_start

constexpr idfxx::event<event_id> idfxx::wifi::connectionless_module_wake_interval_start
inlineconstexpr
Initial value:
{
event_id::connectionless_module_wake_interval_start
}

Connectionless module wake interval start event.

Definition at line 1225 of file wifi.hpp.

◆ dpp_cfg_recvd

constexpr idfxx::event<event_id> idfxx::wifi::dpp_cfg_recvd {event_id::dpp_cfg_recvd}
inlineconstexpr

DPP configuration received event.

Definition at line 1277 of file wifi.hpp.

◆ dpp_failed

constexpr idfxx::event<event_id> idfxx::wifi::dpp_failed {event_id::dpp_failed}
inlineconstexpr

DPP failed event.

Definition at line 1279 of file wifi.hpp.

◆ dpp_uri_ready

constexpr idfxx::event<event_id> idfxx::wifi::dpp_uri_ready {event_id::dpp_uri_ready}
inlineconstexpr

DPP URI ready event.

Definition at line 1275 of file wifi.hpp.

◆ events

const event_base<event_id> idfxx::wifi::events
extern

WiFi event base.

Event base for WiFi events. Use with the idfxx event loop to register listeners for WiFi lifecycle, connection, and scan events.

◆ ftm_report

constexpr idfxx::event<event_id, ftm_report_event_data> idfxx::wifi::ftm_report {event_id::ftm_report}
inlineconstexpr

FTM report received event.

Definition at line 1195 of file wifi.hpp.

◆ home_channel_change

constexpr idfxx::event<event_id, home_channel_change_event_data> idfxx::wifi::home_channel_change
inlineconstexpr
Initial value:
{
event_id::home_channel_change
}

Home channel changed event.

Definition at line 1191 of file wifi.hpp.

◆ itwt_probe

constexpr idfxx::event<event_id> idfxx::wifi::itwt_probe {event_id::itwt_probe}
inlineconstexpr

Individual TWT probe event.

Definition at line 1243 of file wifi.hpp.

◆ itwt_setup

constexpr idfxx::event<event_id> idfxx::wifi::itwt_setup {event_id::itwt_setup}
inlineconstexpr

Individual TWT setup event.

Definition at line 1239 of file wifi.hpp.

◆ itwt_suspend

constexpr idfxx::event<event_id> idfxx::wifi::itwt_suspend {event_id::itwt_suspend}
inlineconstexpr

Individual TWT suspend event.

Definition at line 1245 of file wifi.hpp.

◆ itwt_teardown

constexpr idfxx::event<event_id> idfxx::wifi::itwt_teardown {event_id::itwt_teardown}
inlineconstexpr

Individual TWT teardown event.

Definition at line 1241 of file wifi.hpp.

◆ nan_receive

constexpr idfxx::event<event_id> idfxx::wifi::nan_receive {event_id::nan_receive}
inlineconstexpr

NAN receive event.

Definition at line 1261 of file wifi.hpp.

◆ nan_replied

constexpr idfxx::event<event_id> idfxx::wifi::nan_replied {event_id::nan_replied}
inlineconstexpr

NAN replied event.

Definition at line 1259 of file wifi.hpp.

◆ nan_started

constexpr idfxx::event<event_id> idfxx::wifi::nan_started {event_id::nan_started}
inlineconstexpr

NAN started event.

Definition at line 1253 of file wifi.hpp.

◆ nan_stopped

constexpr idfxx::event<event_id> idfxx::wifi::nan_stopped {event_id::nan_stopped}
inlineconstexpr

NAN stopped event.

Definition at line 1255 of file wifi.hpp.

◆ nan_svc_match

constexpr idfxx::event<event_id> idfxx::wifi::nan_svc_match {event_id::nan_svc_match}
inlineconstexpr

NAN service match event.

Definition at line 1257 of file wifi.hpp.

◆ ndp_confirm

constexpr idfxx::event<event_id> idfxx::wifi::ndp_confirm {event_id::ndp_confirm}
inlineconstexpr

NDP confirm event.

Definition at line 1265 of file wifi.hpp.

◆ ndp_indication

constexpr idfxx::event<event_id> idfxx::wifi::ndp_indication {event_id::ndp_indication}
inlineconstexpr

NDP indication event.

Definition at line 1263 of file wifi.hpp.

◆ ndp_terminated

constexpr idfxx::event<event_id> idfxx::wifi::ndp_terminated {event_id::ndp_terminated}
inlineconstexpr

NDP terminated event.

Definition at line 1267 of file wifi.hpp.

◆ ready

constexpr idfxx::event<event_id> idfxx::wifi::ready {event_id::ready}
inlineconstexpr

WiFi ready event.

Definition at line 1199 of file wifi.hpp.

◆ roc_done

constexpr idfxx::event<event_id> idfxx::wifi::roc_done {event_id::roc_done}
inlineconstexpr

Remain-on-channel done event.

Definition at line 1223 of file wifi.hpp.

◆ scan_done

constexpr idfxx::event<event_id, scan_done_event_data> idfxx::wifi::scan_done {event_id::scan_done}
inlineconstexpr

Scan completed event with scan results summary.

Definition at line 1177 of file wifi.hpp.

◆ sta_authmode_change

constexpr idfxx::event<event_id, authmode_change_event_data> idfxx::wifi::sta_authmode_change {event_id::sta_authmode_change}
inlineconstexpr

Station authentication mode changed event.

Definition at line 1179 of file wifi.hpp.

◆ sta_beacon_offset_unstable

constexpr idfxx::event<event_id> idfxx::wifi::sta_beacon_offset_unstable {event_id::sta_beacon_offset_unstable}
inlineconstexpr

Station beacon offset unstable event.

Definition at line 1273 of file wifi.hpp.

◆ sta_beacon_timeout

constexpr idfxx::event<event_id> idfxx::wifi::sta_beacon_timeout {event_id::sta_beacon_timeout}
inlineconstexpr

Station beacon timeout event.

Definition at line 1209 of file wifi.hpp.

◆ sta_bss_rssi_low

constexpr idfxx::event<event_id, bss_rssi_low_event_data> idfxx::wifi::sta_bss_rssi_low {event_id::sta_bss_rssi_low}
inlineconstexpr

BSS RSSI dropped below threshold event.

Definition at line 1189 of file wifi.hpp.

◆ sta_connected

constexpr idfxx::event<event_id, connected_event_data> idfxx::wifi::sta_connected {event_id::sta_connected}
inlineconstexpr

Station connected event with connection details.

Definition at line 1173 of file wifi.hpp.

◆ sta_disconnected

constexpr idfxx::event<event_id, disconnected_event_data> idfxx::wifi::sta_disconnected {event_id::sta_disconnected}
inlineconstexpr

Station disconnected event with disconnection details.

Definition at line 1175 of file wifi.hpp.

◆ sta_neighbor_rep

constexpr idfxx::event<event_id> idfxx::wifi::sta_neighbor_rep {event_id::sta_neighbor_rep}
inlineconstexpr

Station neighbor report received event.

Definition at line 1269 of file wifi.hpp.

◆ sta_start

constexpr idfxx::event<event_id> idfxx::wifi::sta_start {event_id::sta_start}
inlineconstexpr

Station started event.

Definition at line 1201 of file wifi.hpp.

◆ sta_stop

constexpr idfxx::event<event_id> idfxx::wifi::sta_stop {event_id::sta_stop}
inlineconstexpr

Station stopped event.

Definition at line 1203 of file wifi.hpp.

◆ sta_wps_er_failed

constexpr idfxx::event<event_id> idfxx::wifi::sta_wps_er_failed {event_id::sta_wps_er_failed}
inlineconstexpr

WPS enrollee failed event.

Definition at line 1213 of file wifi.hpp.

◆ sta_wps_er_pbc_overlap

constexpr idfxx::event<event_id> idfxx::wifi::sta_wps_er_pbc_overlap {event_id::sta_wps_er_pbc_overlap}
inlineconstexpr

WPS PBC overlap detected event.

Definition at line 1219 of file wifi.hpp.

◆ sta_wps_er_pin

constexpr idfxx::event<event_id> idfxx::wifi::sta_wps_er_pin {event_id::sta_wps_er_pin}
inlineconstexpr

WPS enrollee PIN received event.

Definition at line 1217 of file wifi.hpp.

◆ sta_wps_er_success

constexpr idfxx::event<event_id> idfxx::wifi::sta_wps_er_success {event_id::sta_wps_er_success}
inlineconstexpr

WPS enrollee success event.

Definition at line 1211 of file wifi.hpp.

◆ sta_wps_er_timeout

constexpr idfxx::event<event_id> idfxx::wifi::sta_wps_er_timeout {event_id::sta_wps_er_timeout}
inlineconstexpr

WPS enrollee timeout event.

Definition at line 1215 of file wifi.hpp.

◆ twt_wakeup

constexpr idfxx::event<event_id> idfxx::wifi::twt_wakeup {event_id::twt_wakeup}
inlineconstexpr

TWT wakeup event.

Definition at line 1247 of file wifi.hpp.