|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
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... | |
Typedefs | |
| using | promiscuous_rx_cb = void(*)(const wifi_promiscuous_pkt_t *pkt, promiscuous_pkt_type type) |
| Callback invoked for each packet received in promiscuous mode. | |
| using | tx_80211_done_cb = void(*)(const esp_80211_tx_info_t *tx_info) |
| Callback invoked when a raw 802.11 frame transmission completes. | |
| using | vendor_ie_cb = void(*)(void *ctx, enum vendor_ie_type type, mac_address sa, const vendor_ie_data_t *ie, electro::dbm rssi) |
| Callback invoked when a matching vendor-specific IE is received. | |
| using | csi_rx_cb = void(*)(void *ctx, const wifi_csi_info_t *info) |
| Callback invoked for each received CSI (Channel State Information) record. | |
Enumerations | |
| enum class | role : uint32_t { 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 , value_too_large = 1 } |
| 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< void > | try_init (const init_config &cfg={}) |
| Initializes the WiFi subsystem. | |
| result< void > | try_deinit () |
| Deinitializes the WiFi subsystem and frees resources. | |
| result< void > | try_start () |
| Starts the WiFi subsystem. | |
| result< void > | try_stop () |
| Stops the WiFi subsystem. | |
| result< void > | try_restore () |
| Restores WiFi stack persistent settings to defaults. | |
| void | set_roles (flags< role > roles) |
| Sets the active WiFi roles. | |
| flags< role > | get_roles () |
| Gets the currently active WiFi roles. | |
| result< void > | try_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< void > | try_set_sta_config (const sta_config &cfg) |
| Sets the WiFi station configuration. | |
| result< sta_config > | try_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_info > | get_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< void > | try_set_ap_config (const ap_config &cfg) |
| Sets the WiFi access point configuration. | |
| result< ap_config > | try_get_ap_config () |
| Gets the current WiFi access point configuration. | |
| result< void > | try_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_t > | try_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. | |
| template<typename Rep , typename Period > | |
| net::ipv4_info | connect_sta (const sta_config &cfg, std::chrono::duration< Rep, Period > timeout) |
| Connects to an access point as a station and waits for an IPv4 address. | |
| 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< void > | try_connect () |
| Connects to the configured access point. | |
| result< net::ipv4_info > | try_connect_sta (const sta_config &cfg, std::chrono::milliseconds timeout) |
| Connects to an access point as a station and waits for an IPv4 address. | |
| template<typename Rep , typename Period > | |
| result< net::ipv4_info > | try_connect_sta (const sta_config &cfg, std::chrono::duration< Rep, Period > timeout) |
| Connects to an access point as a station and waits for an IPv4 address. | |
| result< void > | try_disconnect () |
| Disconnects from the current access point. | |
| result< void > | try_clear_fast_connect () |
| Clears the fast-connect data stored in memory. | |
| result< uint16_t > | try_sta_get_aid () |
| Gets the association ID assigned by the AP in station mode. | |
| result< enum phy_mode > | try_get_negotiated_phymode () |
| Gets the PHY mode negotiated with the connected AP. | |
| std::vector< ap_record > | scan (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_record > | scan_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 ¶ms) |
| 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< void > | try_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< void > | try_scan_stop () |
| Stops an in-progress scan. | |
| result< uint16_t > | try_scan_get_ap_num () |
| Gets the number of APs found in the last scan. | |
| result< void > | try_clear_ap_list () |
| Clears the AP list stored from a previous scan. | |
| result< void > | try_set_scan_parameters (const scan_default_params ¶ms) |
| Sets the default scan timing parameters. | |
| result< scan_default_params > | try_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< void > | try_set_power_save (enum power_save ps) |
| Sets the power save mode. | |
| result< enum power_save > | try_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< void > | try_set_bandwidth (enum role iface, enum bandwidth bw) |
| Sets the channel bandwidth for the specified interface. | |
| result< enum bandwidth > | try_get_bandwidth (enum role iface) |
| Gets the current channel bandwidth for the specified interface. | |
| result< void > | try_set_bandwidths (enum role iface, const bandwidths_config &bw) |
| Sets bandwidths for dual-band operation on the specified interface. | |
| result< bandwidths_config > | try_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< void > | try_set_mac (enum role iface, mac_address mac) |
| Sets the MAC address for the specified interface. | |
| result< mac_address > | try_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_record > | try_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< void > | try_set_channel (uint8_t primary, std::optional< enum second_channel > second=std::nullopt) |
| Sets the primary and secondary channel. | |
| result< channel_info > | try_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< void > | try_set_country (const country_config &cfg) |
| Sets the WiFi country configuration. | |
| result< country_config > | try_get_country () |
| Gets the current WiFi country configuration. | |
| result< void > | try_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 (electro::centi_dbm power) |
| Sets the maximum transmit power. | |
| electro::centi_dbm | get_max_tx_power () |
| Gets the current maximum transmit power. | |
| result< void > | try_set_max_tx_power (electro::centi_dbm power) |
| Sets the maximum transmit power. | |
| result< electro::centi_dbm > | try_get_max_tx_power () |
| Gets the current maximum transmit power. | |
| void | set_rssi_threshold (electro::dbm threshold) |
| Sets the RSSI threshold for the sta_bss_rssi_low event. | |
| electro::dbm | get_rssi () |
| Gets the current RSSI of the connected AP. | |
| result< void > | try_set_rssi_threshold (electro::dbm threshold) |
| Sets the RSSI threshold for the sta_bss_rssi_low event. | |
| result< electro::dbm > | try_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< protocol > | get_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< void > | try_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< void > | try_set_protocols (enum role iface, const protocols_config &cfg) |
| Sets the enabled WiFi protocols for dual-band operation. | |
| result< protocols_config > | try_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< void > | try_set_band (enum band b) |
| Sets the WiFi band. | |
| result< enum band > | try_get_band () |
| Gets the current WiFi band. | |
| result< void > | try_set_band_mode (enum band_mode m) |
| Sets the WiFi band mode. | |
| result< enum band_mode > | try_get_band_mode () |
| Gets the current WiFi band mode. | |
| void | set_storage (enum storage s) |
| Sets the WiFi configuration storage location. | |
| result< void > | try_set_storage (enum storage s) |
| Sets the WiFi configuration storage location. | |
| void | set_inactive_time (enum role iface, std::chrono::seconds timeout) |
| Sets the inactive time before a station is deauthenticated. | |
| std::chrono::seconds | get_inactive_time (enum role iface) |
| Gets the inactive time before a station is deauthenticated. | |
| result< void > | try_set_inactive_time (enum role iface, std::chrono::seconds timeout) |
| Sets the inactive time before a station is deauthenticated. | |
| result< std::chrono::seconds > | try_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_mask > | get_event_mask () |
| Gets the current WiFi event mask. | |
| result< void > | try_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< void > | try_force_wakeup_acquire () |
| Acquires a WiFi wakeup lock. | |
| result< void > | try_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 (promiscuous_rx_cb cb) |
| Sets the promiscuous mode receive callback. | |
| void | set_promiscuous_filter (flags< promiscuous_filter > filter) |
| Sets the promiscuous mode packet type filter. | |
| flags< promiscuous_filter > | get_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_filter > | get_promiscuous_ctrl_filter () |
| Gets the current promiscuous mode control frame sub-type filter. | |
| result< void > | try_set_promiscuous (bool en) |
| Enables or disables promiscuous mode. | |
| result< bool > | try_get_promiscuous () |
| Gets whether promiscuous mode is enabled. | |
| result< void > | try_set_promiscuous_rx_cb (promiscuous_rx_cb cb) |
| Sets the promiscuous mode receive callback. | |
| result< void > | try_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< void > | try_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 (tx_80211_done_cb cb) |
| Registers a callback for 802.11 TX completion. | |
| result< void > | try_tx_80211 (enum role iface, std::span< const uint8_t > buffer, bool en_sys_seq) |
| Transmits a raw 802.11 frame. | |
| result< void > | try_register_80211_tx_cb (tx_80211_done_cb cb) |
| 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 (vendor_ie_cb cb, void *ctx) |
| Registers a callback for received vendor-specific IEs. | |
| result< void > | 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. | |
| result< void > | try_set_vendor_ie_cb (vendor_ie_cb cb, 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 (csi_rx_cb cb, void *ctx) |
| Registers a callback for CSI data reception. | |
| result< void > | try_set_csi (bool en) |
| Enables or disables CSI (Channel State Information) collection. | |
| result< void > | try_set_csi_config (const csi_config &cfg) |
| Sets the CSI configuration. | |
| result< csi_config > | try_get_csi_config () |
| Gets the current CSI configuration. | |
| result< void > | try_set_csi_rx_cb (csi_rx_cb cb, 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_entry > | ftm_get_report (size_t max_entries) |
| Retrieves the FTM measurement report entries. | |
| result< void > | try_ftm_initiate_session (const ftm_initiator_config &cfg) |
| Initiates an FTM (Fine Timing Measurement) session. | |
| result< void > | try_ftm_end_session () |
| Ends the current FTM session. | |
| result< void > | try_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 (std::chrono::milliseconds interval) |
| Sets the connectionless module wake interval. | |
| result< void > | try_statis_dump (flags< statis_module > modules) |
| Dumps WiFi statistics for the specified modules. | |
| result< void > | try_config_11b_rate (enum role iface, bool disable) |
| Enables or disables 802.11b rate for the specified interface. | |
| result< void > | try_config_80211_tx_rate (enum role iface, enum phy_rate rate) |
| Sets the 802.11 TX rate for the specified interface. | |
| result< void > | try_disable_pmf_config (enum role iface) |
| Disables PMF (Protected Management Frames) for the specified interface. | |
| result< void > | try_set_dynamic_cs (bool enabled) |
| Enables or disables dynamic CS (Carrier Sense). | |
| result< void > | try_connectionless_module_set_wake_interval (std::chrono::milliseconds interval) |
| Sets the connectionless module wake interval. | |
| netif::interface | make_sta_netif () |
| Creates a default WiFi station network interface. | |
| netif::interface | make_ap_netif () |
| Creates a default WiFi access point network interface. | |
| result< netif::interface > | try_make_sta_netif () |
| Creates a default WiFi station network interface. | |
| result< netif::interface > | try_make_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_id > | events |
| WiFi event base. | |
| constexpr idfxx::event< event_id, connected_event_data > | sta_connected {event_id::sta_connected} |
| Station connected event with connection details. | |
| constexpr idfxx::event< event_id, disconnected_event_data > | sta_disconnected {event_id::sta_disconnected} |
| Station disconnected event with disconnection details. | |
| constexpr idfxx::event< event_id, scan_done_event_data > | scan_done {event_id::scan_done} |
| Scan completed event with scan results summary. | |
| constexpr idfxx::event< event_id, authmode_change_event_data > | sta_authmode_change {event_id::sta_authmode_change} |
| Station authentication mode changed event. | |
| constexpr idfxx::event< event_id, ap_sta_connected_event_data > | ap_sta_connected {event_id::ap_sta_connected} |
| Station connected to soft-AP event. | |
| constexpr idfxx::event< event_id, ap_sta_disconnected_event_data > | ap_sta_disconnected |
| Station disconnected from soft-AP event. | |
| constexpr idfxx::event< event_id, ap_probe_req_event_data > | ap_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_data > | sta_bss_rssi_low {event_id::sta_bss_rssi_low} |
| BSS RSSI dropped below threshold event. | |
| constexpr idfxx::event< event_id, home_channel_change_event_data > | home_channel_change |
| Home channel changed event. | |
| constexpr idfxx::event< event_id, ftm_report_event_data > | ftm_report {event_id::ftm_report} |
| FTM report received event. | |
| constexpr idfxx::event< event_id > | ready {event_id::ready} |
| WiFi ready event. | |
| constexpr idfxx::event< event_id > | sta_start {event_id::sta_start} |
| Station started event. | |
| constexpr idfxx::event< event_id > | sta_stop {event_id::sta_stop} |
| Station stopped event. | |
| constexpr idfxx::event< event_id > | ap_start {event_id::ap_start} |
| Soft-AP started event. | |
| constexpr idfxx::event< event_id > | ap_stop {event_id::ap_stop} |
| Soft-AP stopped event. | |
| constexpr idfxx::event< event_id > | sta_beacon_timeout {event_id::sta_beacon_timeout} |
| Station beacon timeout event. | |
| constexpr idfxx::event< event_id > | sta_wps_er_success {event_id::sta_wps_er_success} |
| WPS enrollee success event. | |
| constexpr idfxx::event< event_id > | sta_wps_er_failed {event_id::sta_wps_er_failed} |
| WPS enrollee failed event. | |
| constexpr idfxx::event< event_id > | sta_wps_er_timeout {event_id::sta_wps_er_timeout} |
| WPS enrollee timeout event. | |
| constexpr idfxx::event< event_id > | sta_wps_er_pin {event_id::sta_wps_er_pin} |
| WPS enrollee PIN received event. | |
| constexpr idfxx::event< event_id > | sta_wps_er_pbc_overlap {event_id::sta_wps_er_pbc_overlap} |
| WPS PBC overlap detected event. | |
| constexpr idfxx::event< event_id > | action_tx_status {event_id::action_tx_status} |
| Action frame TX status event. | |
| constexpr idfxx::event< event_id > | roc_done {event_id::roc_done} |
| Remain-on-channel done event. | |
| constexpr idfxx::event< event_id > | connectionless_module_wake_interval_start |
| Connectionless module wake interval start event. | |
| constexpr idfxx::event< event_id > | ap_wps_rg_success {event_id::ap_wps_rg_success} |
| AP WPS registrar success event. | |
| constexpr idfxx::event< event_id > | ap_wps_rg_failed {event_id::ap_wps_rg_failed} |
| AP WPS registrar failed event. | |
| constexpr idfxx::event< event_id > | ap_wps_rg_timeout {event_id::ap_wps_rg_timeout} |
| AP WPS registrar timeout event. | |
| constexpr idfxx::event< event_id > | ap_wps_rg_pin {event_id::ap_wps_rg_pin} |
| AP WPS registrar PIN received event. | |
| constexpr idfxx::event< event_id > | ap_wps_rg_pbc_overlap {event_id::ap_wps_rg_pbc_overlap} |
| AP WPS PBC overlap detected event. | |
| constexpr idfxx::event< event_id > | itwt_setup {event_id::itwt_setup} |
| Individual TWT setup event. | |
| constexpr idfxx::event< event_id > | itwt_teardown {event_id::itwt_teardown} |
| Individual TWT teardown event. | |
| constexpr idfxx::event< event_id > | itwt_probe {event_id::itwt_probe} |
| Individual TWT probe event. | |
| constexpr idfxx::event< event_id > | itwt_suspend {event_id::itwt_suspend} |
| Individual TWT suspend event. | |
| constexpr idfxx::event< event_id > | twt_wakeup {event_id::twt_wakeup} |
| TWT wakeup event. | |
| constexpr idfxx::event< event_id > | btwt_setup {event_id::btwt_setup} |
| Broadcast TWT setup event. | |
| constexpr idfxx::event< event_id > | btwt_teardown {event_id::btwt_teardown} |
| Broadcast TWT teardown event. | |
| constexpr idfxx::event< event_id > | nan_started {event_id::nan_started} |
| NAN started event. | |
| constexpr idfxx::event< event_id > | nan_stopped {event_id::nan_stopped} |
| NAN stopped event. | |
| constexpr idfxx::event< event_id > | nan_svc_match {event_id::nan_svc_match} |
| NAN service match event. | |
| constexpr idfxx::event< event_id > | nan_replied {event_id::nan_replied} |
| NAN replied event. | |
| constexpr idfxx::event< event_id > | nan_receive {event_id::nan_receive} |
| NAN receive event. | |
| constexpr idfxx::event< event_id > | ndp_indication {event_id::ndp_indication} |
| NDP indication event. | |
| constexpr idfxx::event< event_id > | ndp_confirm {event_id::ndp_confirm} |
| NDP confirm event. | |
| constexpr idfxx::event< event_id > | ndp_terminated {event_id::ndp_terminated} |
| NDP terminated event. | |
| constexpr idfxx::event< event_id > | sta_neighbor_rep {event_id::sta_neighbor_rep} |
| Station neighbor report received event. | |
| constexpr idfxx::event< event_id > | ap_wrong_password {event_id::ap_wrong_password} |
| AP detected wrong password from station event. | |
| constexpr idfxx::event< event_id > | sta_beacon_offset_unstable {event_id::sta_beacon_offset_unstable} |
| Station beacon offset unstable event. | |
| constexpr idfxx::event< event_id > | dpp_uri_ready {event_id::dpp_uri_ready} |
| DPP URI ready event. | |
| constexpr idfxx::event< event_id > | dpp_cfg_recvd {event_id::dpp_cfg_recvd} |
| DPP configuration received event. | |
| constexpr idfxx::event< event_id > | dpp_failed {event_id::dpp_failed} |
| DPP failed event. | |
| using idfxx::wifi::csi_rx_cb = typedef void (*)(void* ctx, const wifi_csi_info_t* info) |
| using idfxx::wifi::promiscuous_rx_cb = typedef void (*)(const wifi_promiscuous_pkt_t* pkt, promiscuous_pkt_type type) |
Callback invoked for each packet received in promiscuous mode.
pkt points to the received frame and its radio metadata; type identifies the packet category. For management and data packets the frame payload is present; for other categories it may be absent (see the ESP-IDF promiscuous-mode documentation).
| using idfxx::wifi::tx_80211_done_cb = typedef void (*)(const esp_80211_tx_info_t* tx_info) |
| using idfxx::wifi::vendor_ie_cb = typedef void (*)(void* ctx, enum vendor_ie_type type, mac_address sa, const vendor_ie_data_t* ie, electro::dbm rssi) |
|
strong |
WiFi authentication mode.
|
strong |
|
strong |
|
strong |
|
strong |
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.
|
strong |
WiFi cipher type.
|
strong |
|
strong |
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.
|
strong |
Error codes for WiFi operations.
The category's equivalent() member recognises codes that map to standard std::errc synonyms (e.g. value_too_large), so callers can compare error codes against either the domain-specific errc value or the portable POSIX name.
|
strong |
WiFi event IDs.
Used with the wifi::events event base to register listeners and post events.
|
strong |
|
strong |
FTM (Fine Timing Measurement) session status.
|
strong |
|
strong |
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.
|
strong |
|
strong |
Promiscuous mode control frame sub-type filter flags.
Can be combined using bitwise operators via the flags<promiscuous_ctrl_filter> type.
|
strong |
Promiscuous mode filter flags.
Can be combined using bitwise operators via the flags<promiscuous_filter> type.
|
strong |
|
strong |
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. |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
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. |
|
strong |
|
strong |
|
strong |
| uint16_t idfxx::wifi::ap_get_sta_aid | ( | mac_address | mac | ) |
Gets the association ID for a station connected to the soft-AP.
| mac | MAC address of the station. |
| std::system_error | on failure. |
| void idfxx::wifi::clear_ap_list | ( | ) |
Clears the AP list stored from a previous scan.
| std::system_error | on failure. |
| void idfxx::wifi::clear_fast_connect | ( | ) |
Clears the fast-connect data stored in memory.
| std::system_error | on failure. |
| void idfxx::wifi::config_11b_rate | ( | enum role | iface, |
| bool | disable | ||
| ) |
Enables or disables 802.11b rate for the specified interface.
| iface | The WiFi interface. |
| disable | True to disable 11b rate, false to enable. |
| std::system_error | on failure. |
Sets the 802.11 TX rate for the specified interface.
| iface | The WiFi interface. |
| rate | The PHY transmission rate. |
| std::system_error | on failure. |
| 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.
| std::system_error | on failure. |
| net::ipv4_info idfxx::wifi::connect_sta | ( | const sta_config & | cfg, |
| std::chrono::duration< Rep, Period > | timeout | ||
| ) |
Connects to an access point as a station and waits for an IPv4 address.
Composes the common station bring-up: enables the station role (preserving any other active roles), applies cfg, starts WiFi, initiates the connection, and blocks until the station acquires an IPv4 address or timeout elapses.
Requires the system event loop (event_loop::create_system()), a station netif (make_sta_netif()), and an initialized WiFi subsystem (init()) before calling. The step-by-step API (set_roles, set_sta_config, start, connect) remains available for full control over the sequence.
| cfg | The station configuration (SSID, credentials, etc.). |
| timeout | Maximum time to wait for an IPv4 address. |
| std::system_error | on failure, disconnection during the attempt, or timeout. |
| void idfxx::wifi::connectionless_module_set_wake_interval | ( | std::chrono::milliseconds | interval | ) |
Sets the connectionless module wake interval.
| interval | The wake interval, 1 ms to 65535 ms (multiples of 100 ms recommended; 0 selects the default mode). |
| std::system_error | on failure. |
| void idfxx::wifi::deauth_sta | ( | uint16_t | aid | ) |
Deauthenticates a station from the soft-AP.
| aid | Association ID of the station to deauthenticate (0 = all). |
| std::system_error | on failure. |
| void idfxx::wifi::deinit | ( | ) |
Deinitializes the WiFi subsystem and frees resources.
| std::system_error | on failure. |
| void idfxx::wifi::disable_pmf_config | ( | enum role | iface | ) |
Disables PMF (Protected Management Frames) for the specified interface.
| iface | The WiFi interface. |
| std::system_error | on failure. |
| void idfxx::wifi::disconnect | ( | ) |
Disconnects from the current access point.
| std::system_error | on failure. |
| void idfxx::wifi::force_wakeup_acquire | ( | ) |
Acquires a WiFi wakeup lock.
Prevents the WiFi modem from entering sleep while the lock is held.
| std::system_error | on failure. |
| void idfxx::wifi::force_wakeup_release | ( | ) |
Releases a WiFi wakeup lock.
| std::system_error | on failure. |
| void idfxx::wifi::ftm_end_session | ( | ) |
Ends the current FTM session.
| std::system_error | on failure. |
| std::vector< ftm_report_entry > idfxx::wifi::ftm_get_report | ( | size_t | max_entries | ) |
Retrieves the FTM measurement report entries.
| max_entries | Maximum number of entries to retrieve. |
| std::system_error | on failure. |
| void idfxx::wifi::ftm_initiate_session | ( | const ftm_initiator_config & | cfg | ) |
Initiates an FTM (Fine Timing Measurement) session.
| cfg | The FTM initiator configuration. |
| std::system_error | on failure. |
| void idfxx::wifi::ftm_resp_set_offset | ( | int16_t | offset | ) |
Sets the FTM responder offset.
| offset | The offset value in nanoseconds. |
| std::system_error | on failure. |
| ap_config idfxx::wifi::get_ap_config | ( | ) |
Gets the current WiFi access point configuration.
| std::system_error | on failure. |
| ap_record idfxx::wifi::get_ap_info | ( | ) |
Gets information about the currently connected access point.
| std::system_error | on failure. |
| enum band idfxx::wifi::get_band | ( | ) |
Gets the current WiFi band.
| std::system_error | on failure. |
| enum band_mode idfxx::wifi::get_band_mode | ( | ) |
Gets the current WiFi band mode.
| std::system_error | on failure. |
Gets the current channel bandwidth for the specified interface.
| iface | The WiFi interface. |
| std::system_error | on failure. |
| bandwidths_config idfxx::wifi::get_bandwidths | ( | enum role | iface | ) |
Gets bandwidths for dual-band operation on the specified interface.
| iface | The WiFi interface. |
| std::system_error | on failure. |
| channel_info idfxx::wifi::get_channel | ( | ) |
Gets the current primary and secondary channel.
| std::system_error | on failure. |
| country_config idfxx::wifi::get_country | ( | ) |
Gets the current WiFi country configuration.
| std::system_error | on failure. |
| std::string idfxx::wifi::get_country_code | ( | ) |
Gets the current country code.
| std::system_error | on failure. |
| csi_config idfxx::wifi::get_csi_config | ( | ) |
Gets the current CSI configuration.
| std::system_error | on failure. |
| flags< event_mask > idfxx::wifi::get_event_mask | ( | ) |
Gets the current WiFi event mask.
| std::system_error | on failure. |
| std::chrono::seconds idfxx::wifi::get_inactive_time | ( | enum role | iface | ) |
Gets the inactive time before a station is deauthenticated.
| iface | The WiFi interface. |
| std::system_error | on failure. |
| mac_address idfxx::wifi::get_mac | ( | enum role | iface | ) |
Gets the MAC address for the specified interface.
| iface | The WiFi interface. |
| std::system_error | on failure. |
| electro::centi_dbm idfxx::wifi::get_max_tx_power | ( | ) |
Gets the current maximum transmit power.
| std::system_error | on failure. |
| enum phy_mode idfxx::wifi::get_negotiated_phymode | ( | ) |
Gets the PHY mode negotiated with the connected AP.
| std::system_error | on failure. |
| enum power_save idfxx::wifi::get_power_save | ( | ) |
Gets the current power save mode.
| std::system_error | on failure. |
| bool idfxx::wifi::get_promiscuous | ( | ) |
Gets whether promiscuous mode is enabled.
| std::system_error | on failure. |
| flags< promiscuous_ctrl_filter > idfxx::wifi::get_promiscuous_ctrl_filter | ( | ) |
Gets the current promiscuous mode control frame sub-type filter.
| std::system_error | on failure. |
| flags< promiscuous_filter > idfxx::wifi::get_promiscuous_filter | ( | ) |
Gets the current promiscuous mode packet type filter.
| std::system_error | on failure. |
Gets the enabled WiFi protocols for the specified interface.
| iface | The WiFi interface. |
| std::system_error | on failure. |
| protocols_config idfxx::wifi::get_protocols | ( | enum role | iface | ) |
Gets the enabled WiFi protocols for dual-band operation.
| iface | The WiFi interface. |
| std::system_error | on failure. |
Gets the currently active WiFi roles.
| std::system_error | on failure. |
| electro::dbm idfxx::wifi::get_rssi | ( | ) |
Gets the current RSSI of the connected AP.
| std::system_error | on failure. |
| scan_default_params idfxx::wifi::get_scan_parameters | ( | ) |
Gets the current default scan timing parameters.
| std::system_error | on failure. |
| sta_config idfxx::wifi::get_sta_config | ( | ) |
Gets the current WiFi station configuration.
| std::system_error | on failure. |
| std::vector< sta_info > idfxx::wifi::get_sta_list | ( | ) |
Gets the list of stations connected to the soft-AP.
| std::system_error | on failure. |
| 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.
| iface | The WiFi interface. |
| 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.
| cfg | Initialization configuration. Defaults to Kconfig values. |
| std::system_error | on failure. |
| netif::interface idfxx::wifi::make_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().
| std::system_error | if the interface could not be created. |
|
inlinenoexcept |
Creates an error code from an idfxx::wifi::errc value.
| e | The WiFi error code enumerator. |
Definition at line 3727 of file wifi.hpp.
References idfxx::make_error_code(), and idfxx::wifi_category().
| netif::interface idfxx::wifi::make_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().
| std::system_error | if the interface could not be created. |
| void idfxx::wifi::register_80211_tx_cb | ( | tx_80211_done_cb | cb | ) |
Registers a callback for 802.11 TX completion.
The callback is invoked when a frame sent with tx_80211 completes, with the transmission's result and frame details.
| cb | Callback function pointer, or nullptr to unregister. |
| std::system_error | on failure. |
| void idfxx::wifi::restore | ( | ) |
Restores WiFi stack persistent settings to defaults.
Resets configuration stored in NVS to factory defaults.
| std::system_error | on failure. |
| 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.
| cfg | Scan configuration. Defaults to scanning all channels. |
| std::system_error | on failure. |
| uint16_t idfxx::wifi::scan_get_ap_num | ( | ) |
Gets the number of APs found in the last scan.
| std::system_error | on failure. |
| 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.
| std::system_error | on failure. |
| 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.
| cfg | Scan configuration. Defaults to scanning all channels. |
| std::system_error | on failure. |
| void idfxx::wifi::scan_stop | ( | ) |
Stops an in-progress scan.
| std::system_error | on failure. |
| void idfxx::wifi::set_ap_config | ( | const ap_config & | cfg | ) |
Sets the WiFi access point configuration.
| cfg | The access point configuration. |
| std::system_error | on failure. |
| void idfxx::wifi::set_band | ( | enum band | b | ) |
Sets the WiFi band.
| b | The frequency band. |
| std::system_error | on failure. |
| void idfxx::wifi::set_band_mode | ( | enum band_mode | m | ) |
Sets the WiFi band mode.
| m | The band mode. |
| std::system_error | on failure. |
Sets the channel bandwidth for the specified interface.
| iface | The WiFi interface. |
| bw | The bandwidth. |
| std::system_error | on failure. |
| void idfxx::wifi::set_bandwidths | ( | enum role | iface, |
| const bandwidths_config & | bw | ||
| ) |
Sets bandwidths for dual-band operation on the specified interface.
| iface | The WiFi interface. |
| bw | The bandwidth configuration for both bands. |
| std::system_error | on failure. |
| void idfxx::wifi::set_channel | ( | uint8_t | primary, |
| std::optional< enum second_channel > | second = std::nullopt |
||
| ) |
Sets the primary and secondary channel.
| primary | The primary channel number. |
| second | The secondary channel position, or nullopt for HT20 (no secondary channel). |
| std::system_error | on failure. |
| void idfxx::wifi::set_country | ( | const country_config & | cfg | ) |
Sets the WiFi country configuration.
| cfg | The country configuration. |
| std::system_error | on failure. |
| void idfxx::wifi::set_country_code | ( | std::string_view | cc, |
| bool | ieee80211d_enabled | ||
| ) |
Sets the country code.
| cc | Two-character country code string. |
| ieee80211d_enabled | Whether to enable IEEE 802.11d. |
| std::system_error | on failure. |
| void idfxx::wifi::set_csi | ( | bool | en | ) |
Enables or disables CSI (Channel State Information) collection.
| en | True to enable, false to disable. |
| std::system_error | on failure. |
| void idfxx::wifi::set_csi_config | ( | const csi_config & | cfg | ) |
Sets the CSI configuration.
| cfg | The CSI configuration. |
| std::system_error | on failure. |
| void idfxx::wifi::set_csi_rx_cb | ( | csi_rx_cb | cb, |
| void * | ctx | ||
| ) |
Registers a callback for CSI data reception.
| cb | Callback function pointer, or nullptr to clear. |
| ctx | User context pointer passed to the callback. |
| std::system_error | on failure. |
| void idfxx::wifi::set_dynamic_cs | ( | bool | enabled | ) |
Enables or disables dynamic CS (Carrier Sense).
| enabled | True to enable, false to disable. |
| std::system_error | on failure. |
| void idfxx::wifi::set_event_mask | ( | flags< event_mask > | mask | ) |
Sets the WiFi event mask.
Controls which events are sent to the event loop.
| mask | Event mask flags indicating which events to suppress. |
| std::system_error | on failure. |
| void idfxx::wifi::set_inactive_time | ( | enum role | iface, |
| std::chrono::seconds | timeout | ||
| ) |
Sets the inactive time before a station is deauthenticated.
| iface | The WiFi interface. |
| timeout | Inactive time before deauthentication (whole seconds; max 65535 s). |
| std::system_error | on failure. |
| void idfxx::wifi::set_mac | ( | enum role | iface, |
| mac_address | mac | ||
| ) |
Sets the MAC address for the specified interface.
| iface | The WiFi interface. |
| mac | The MAC address as a 6-byte array. |
| std::system_error | on failure. |
| void idfxx::wifi::set_max_tx_power | ( | electro::centi_dbm | power | ) |
Sets the maximum transmit power.
| power | Maximum TX power (range: 2–20 dBm). The hardware applies the power in 0.25 dBm steps; the value is rounded to the nearest step. |
| std::system_error | on failure. |
| void idfxx::wifi::set_power_save | ( | enum power_save | ps | ) |
Sets the power save mode.
| ps | The power save mode. |
| std::system_error | on failure. |
| void idfxx::wifi::set_promiscuous | ( | bool | en | ) |
Enables or disables promiscuous mode.
| en | True to enable, false to disable. |
| std::system_error | on failure. |
| void idfxx::wifi::set_promiscuous_ctrl_filter | ( | flags< promiscuous_ctrl_filter > | filter | ) |
Sets the promiscuous mode control frame sub-type filter.
| filter | The control frame filter flags to apply. |
| std::system_error | on failure. |
| void idfxx::wifi::set_promiscuous_filter | ( | flags< promiscuous_filter > | filter | ) |
Sets the promiscuous mode packet type filter.
| filter | The filter flags to apply. |
| std::system_error | on failure. |
| void idfxx::wifi::set_promiscuous_rx_cb | ( | promiscuous_rx_cb | cb | ) |
Sets the promiscuous mode receive callback.
For management and data packets, pkt points to the received frame with metadata. For other packet types the payload may be absent; see the ESP-IDF promiscuous-mode documentation for details.
| cb | Callback function pointer, or nullptr to clear. |
| std::system_error | on failure. |
Sets the enabled WiFi protocols for the specified interface.
| iface | The WiFi interface. |
| protos | The protocol flags to enable. |
| std::system_error | on failure. |
| void idfxx::wifi::set_protocols | ( | enum role | iface, |
| const protocols_config & | cfg | ||
| ) |
Sets the enabled WiFi protocols for dual-band operation.
| iface | The WiFi interface. |
| cfg | The protocol configuration for both bands. |
| std::system_error | on failure. |
| void idfxx::wifi::set_rssi_threshold | ( | electro::dbm | threshold | ) |
Sets the RSSI threshold for the sta_bss_rssi_low event.
| threshold | The RSSI threshold. |
| std::system_error | on failure. |
| void idfxx::wifi::set_scan_parameters | ( | const scan_default_params & | params | ) |
Sets the default scan timing parameters.
| params | The scan timing parameters. |
| std::system_error | on failure. |
| void idfxx::wifi::set_sta_config | ( | const sta_config & | cfg | ) |
Sets the WiFi station configuration.
| cfg | The station configuration. |
| std::system_error | on failure. |
| void idfxx::wifi::set_storage | ( | enum storage | s | ) |
Sets the WiFi configuration storage location.
| s | The storage location (flash or RAM). |
| std::system_error | on failure. |
| 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.
| enable | Whether to enable or disable the vendor IE. |
| type | The frame type for the vendor IE. |
| id | The vendor IE index. |
| vnd_ie | Pointer to the vendor IE data. |
| std::system_error | on failure. |
| void idfxx::wifi::set_vendor_ie_cb | ( | vendor_ie_cb | cb, |
| void * | ctx | ||
| ) |
Registers a callback for received vendor-specific IEs.
| cb | Callback function pointer, or nullptr to clear. |
| ctx | User context pointer passed to the callback. |
| std::system_error | on failure. |
| uint16_t idfxx::wifi::sta_get_aid | ( | ) |
Gets the association ID assigned by the AP in station mode.
| std::system_error | on failure. |
| void idfxx::wifi::start | ( | ) |
Starts the WiFi subsystem.
After starting, configured interfaces become active. A mode must be set before starting.
| std::system_error | on failure. |
| void idfxx::wifi::statis_dump | ( | flags< statis_module > | modules | ) |
Dumps WiFi statistics for the specified modules.
| modules | Flags indicating which modules to dump statistics for. |
| std::system_error | on failure. |
| void idfxx::wifi::stop | ( | ) |
Stops the WiFi subsystem.
| std::system_error | on failure. |
| 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.
| mac | MAC address of the station. |
| result< void > idfxx::wifi::try_clear_ap_list | ( | ) |
Clears the AP list stored from a previous scan.
| result< void > idfxx::wifi::try_clear_fast_connect | ( | ) |
Clears the fast-connect data stored in memory.
Enables or disables 802.11b rate for the specified interface.
| iface | The WiFi interface. |
| disable | True to disable 11b rate, false to enable. |
Sets the 802.11 TX rate for the specified interface.
| iface | The WiFi interface. |
| rate | The PHY transmission rate. |
| 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.
| result< net::ipv4_info > idfxx::wifi::try_connect_sta | ( | const sta_config & | cfg, |
| std::chrono::duration< Rep, Period > | timeout | ||
| ) |
Connects to an access point as a station and waits for an IPv4 address.
Composes the common station bring-up: enables the station role (preserving any other active roles), applies cfg, starts WiFi, initiates the connection, and blocks until the station acquires an IPv4 address or timeout elapses.
Requires the system event loop (event_loop::try_create_system()), a station netif (try_make_sta_netif()), and an initialized WiFi subsystem (try_init()) before calling. The step-by-step API (try_set_roles, try_set_sta_config, try_start, try_connect) remains available for full control over the sequence.
| cfg | The station configuration (SSID, credentials, etc.). |
| timeout | Maximum time to wait for an IPv4 address. |
timeout elapses. Definition at line 1813 of file wifi.hpp.
References timeout, and try_connect_sta().
| result< net::ipv4_info > idfxx::wifi::try_connect_sta | ( | const sta_config & | cfg, |
| std::chrono::milliseconds | timeout | ||
| ) |
Connects to an access point as a station and waits for an IPv4 address.
Composes the common station bring-up: enables the station role (preserving any other active roles), applies cfg, starts WiFi, initiates the connection, and blocks until the station acquires an IPv4 address or timeout elapses.
Requires the system event loop (event_loop::try_create_system()), a station netif (try_make_sta_netif()), and an initialized WiFi subsystem (try_init()) before calling. The step-by-step API (try_set_roles, try_set_sta_config, try_start, try_connect) remains available for full control over the sequence.
| cfg | The station configuration (SSID, credentials, etc.). |
| timeout | Maximum time to wait for an IPv4 address. |
timeout elapses. Referenced by try_connect_sta().
| result< void > idfxx::wifi::try_connectionless_module_set_wake_interval | ( | std::chrono::milliseconds | interval | ) |
Sets the connectionless module wake interval.
| interval | The wake interval, 1 ms to 65535 ms (multiples of 100 ms recommended; 0 selects the default mode). |
| result< void > idfxx::wifi::try_deauth_sta | ( | uint16_t | aid | ) |
Deauthenticates a station from the soft-AP.
| aid | Association ID of the station to deauthenticate (0 = all). |
| result< void > idfxx::wifi::try_deinit | ( | ) |
Deinitializes the WiFi subsystem and frees resources.
Disables PMF (Protected Management Frames) for the specified interface.
| iface | The WiFi interface. |
| result< void > idfxx::wifi::try_disconnect | ( | ) |
Disconnects from the current access point.
| 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.
| result< void > idfxx::wifi::try_force_wakeup_release | ( | ) |
Releases a WiFi wakeup lock.
| result< void > idfxx::wifi::try_ftm_end_session | ( | ) |
Ends the current FTM session.
| result< std::vector< ftm_report_entry > > idfxx::wifi::try_ftm_get_report | ( | size_t | max_entries | ) |
Retrieves the FTM measurement report entries.
| max_entries | Maximum number of entries to retrieve. |
| result< void > idfxx::wifi::try_ftm_initiate_session | ( | const ftm_initiator_config & | cfg | ) |
Initiates an FTM (Fine Timing Measurement) session.
| cfg | The FTM initiator configuration. |
| result< void > idfxx::wifi::try_ftm_resp_set_offset | ( | int16_t | offset | ) |
Sets the FTM responder offset.
| offset | The offset value in nanoseconds. |
Gets the current WiFi access point configuration.
Gets information about the currently connected access point.
Gets the current WiFi band.
Gets the current WiFi band mode.
Gets the current channel bandwidth for the specified interface.
| iface | The WiFi interface. |
| result< bandwidths_config > idfxx::wifi::try_get_bandwidths | ( | enum role | iface | ) |
Gets bandwidths for dual-band operation on the specified interface.
| iface | The WiFi interface. |
| result< channel_info > idfxx::wifi::try_get_channel | ( | ) |
Gets the current primary and secondary channel.
| result< country_config > idfxx::wifi::try_get_country | ( | ) |
Gets the current WiFi country configuration.
| result< std::string > idfxx::wifi::try_get_country_code | ( | ) |
Gets the current country code.
| result< csi_config > idfxx::wifi::try_get_csi_config | ( | ) |
Gets the current CSI configuration.
| result< flags< event_mask > > idfxx::wifi::try_get_event_mask | ( | ) |
Gets the current WiFi event mask.
Gets the inactive time before a station is deauthenticated.
| iface | The WiFi interface. |
| result< mac_address > idfxx::wifi::try_get_mac | ( | enum role | iface | ) |
Gets the MAC address for the specified interface.
| iface | The WiFi interface. |
| result< electro::centi_dbm > idfxx::wifi::try_get_max_tx_power | ( | ) |
Gets the current maximum transmit power.
Gets the PHY mode negotiated with the connected AP.
| result< enum power_save > idfxx::wifi::try_get_power_save | ( | ) |
Gets the current power save mode.
| result< bool > idfxx::wifi::try_get_promiscuous | ( | ) |
Gets whether promiscuous mode is enabled.
| result< flags< promiscuous_ctrl_filter > > idfxx::wifi::try_get_promiscuous_ctrl_filter | ( | ) |
Gets the current promiscuous mode control frame sub-type filter.
| result< flags< promiscuous_filter > > idfxx::wifi::try_get_promiscuous_filter | ( | ) |
Gets the current promiscuous mode packet type filter.
Gets the enabled WiFi protocols for the specified interface.
| iface | The WiFi interface. |
| result< protocols_config > idfxx::wifi::try_get_protocols | ( | enum role | iface | ) |
Gets the enabled WiFi protocols for dual-band operation.
| iface | The WiFi interface. |
Gets the currently active WiFi roles.
| result< electro::dbm > idfxx::wifi::try_get_rssi | ( | ) |
Gets the current RSSI of the connected AP.
| result< scan_default_params > idfxx::wifi::try_get_scan_parameters | ( | ) |
Gets the current default scan timing parameters.
| result< sta_config > idfxx::wifi::try_get_sta_config | ( | ) |
Gets the current WiFi station configuration.
Gets the list of stations connected to the soft-AP.
| 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.
| cfg | Initialization configuration. Defaults to Kconfig values. |
| result< netif::interface > idfxx::wifi::try_make_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().
| result< netif::interface > idfxx::wifi::try_make_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().
| result< void > idfxx::wifi::try_register_80211_tx_cb | ( | tx_80211_done_cb | cb | ) |
Registers a callback for 802.11 TX completion.
The callback is invoked when a frame sent with try_tx_80211 completes, with the transmission's result and frame details.
| cb | Callback function pointer, or nullptr to unregister. |
| result< void > idfxx::wifi::try_restore | ( | ) |
Restores WiFi stack persistent settings to defaults.
Resets configuration stored in NVS to factory defaults.
| 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.
| cfg | Scan configuration. Defaults to scanning all channels. |
| result< uint16_t > idfxx::wifi::try_scan_get_ap_num | ( | ) |
Gets the number of APs found in the last scan.
Retrieves results from a completed scan.
Call this after receiving the wifi::event_id::scan_done event.
| 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.
| cfg | Scan configuration. Defaults to scanning all channels. |
| result< void > idfxx::wifi::try_scan_stop | ( | ) |
Stops an in-progress scan.
Sets the WiFi access point configuration.
| cfg | The access point configuration. |
Sets the WiFi band.
| b | The frequency band. |
Sets the WiFi band mode.
| m | The band mode. |
Sets the channel bandwidth for the specified interface.
| iface | The WiFi interface. |
| bw | The bandwidth. |
| result< void > idfxx::wifi::try_set_bandwidths | ( | enum role | iface, |
| const bandwidths_config & | bw | ||
| ) |
Sets bandwidths for dual-band operation on the specified interface.
| iface | The WiFi interface. |
| bw | The bandwidth configuration for both bands. |
| result< void > idfxx::wifi::try_set_channel | ( | uint8_t | primary, |
| std::optional< enum second_channel > | second = std::nullopt |
||
| ) |
Sets the primary and secondary channel.
| primary | The primary channel number. |
| second | The secondary channel position, or nullopt for HT20 (no secondary channel). |
| result< void > idfxx::wifi::try_set_country | ( | const country_config & | cfg | ) |
Sets the WiFi country configuration.
| cfg | The country configuration. |
| result< void > idfxx::wifi::try_set_country_code | ( | std::string_view | cc, |
| bool | ieee80211d_enabled | ||
| ) |
Sets the country code.
| cc | Two-character country code string. |
| ieee80211d_enabled | Whether to enable IEEE 802.11d. |
| result< void > idfxx::wifi::try_set_csi | ( | bool | en | ) |
Enables or disables CSI (Channel State Information) collection.
| en | True to enable, false to disable. |
| result< void > idfxx::wifi::try_set_csi_config | ( | const csi_config & | cfg | ) |
Sets the CSI configuration.
| cfg | The CSI configuration. |
Registers a callback for CSI data reception.
| cb | Callback function pointer, or nullptr to clear. |
| ctx | User context pointer passed to the callback. |
| result< void > idfxx::wifi::try_set_dynamic_cs | ( | bool | enabled | ) |
Enables or disables dynamic CS (Carrier Sense).
| enabled | True to enable, false to disable. |
| 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.
| mask | Event mask flags indicating which events to suppress. |
Sets the inactive time before a station is deauthenticated.
| iface | The WiFi interface. |
| timeout | Inactive time before deauthentication (whole seconds; max 65535 s). |
| result< void > idfxx::wifi::try_set_mac | ( | enum role | iface, |
| mac_address | mac | ||
| ) |
Sets the MAC address for the specified interface.
| iface | The WiFi interface. |
| mac | The MAC address. |
| result< void > idfxx::wifi::try_set_max_tx_power | ( | electro::centi_dbm | power | ) |
Sets the maximum transmit power.
| power | Maximum TX power (range: 2–20 dBm). The hardware applies the power in 0.25 dBm steps; the value is rounded to the nearest step. |
| result< void > idfxx::wifi::try_set_power_save | ( | enum power_save | ps | ) |
Sets the power save mode.
| ps | The power save mode. |
| result< void > idfxx::wifi::try_set_promiscuous | ( | bool | en | ) |
Enables or disables promiscuous mode.
| en | True to enable, false to disable. |
| result< void > idfxx::wifi::try_set_promiscuous_ctrl_filter | ( | flags< promiscuous_ctrl_filter > | filter | ) |
Sets the promiscuous mode control frame sub-type filter.
| filter | The control frame filter flags to apply. |
| result< void > idfxx::wifi::try_set_promiscuous_filter | ( | flags< promiscuous_filter > | filter | ) |
Sets the promiscuous mode packet type filter.
| filter | The filter flags to apply. |
| result< void > idfxx::wifi::try_set_promiscuous_rx_cb | ( | promiscuous_rx_cb | cb | ) |
Sets the promiscuous mode receive callback.
For management and data packets, pkt points to the received frame with metadata. For other packet types the payload may be absent; see the ESP-IDF promiscuous-mode documentation for details.
| cb | Callback function pointer, or nullptr to clear. |
Sets the enabled WiFi protocols for the specified interface.
| iface | The WiFi interface. |
| protos | The protocol flags to enable. |
| result< void > idfxx::wifi::try_set_protocols | ( | enum role | iface, |
| const protocols_config & | cfg | ||
| ) |
Sets the enabled WiFi protocols for dual-band operation.
| iface | The WiFi interface. |
| cfg | The protocol configuration for both bands. |
| result< void > idfxx::wifi::try_set_rssi_threshold | ( | electro::dbm | threshold | ) |
Sets the RSSI threshold for the sta_bss_rssi_low event.
| threshold | The RSSI threshold. |
| result< void > idfxx::wifi::try_set_scan_parameters | ( | const scan_default_params & | params | ) |
Sets the default scan timing parameters.
| params | The scan timing parameters. |
| result< void > idfxx::wifi::try_set_sta_config | ( | const sta_config & | cfg | ) |
Sets the WiFi station configuration.
| cfg | The station configuration. |
Sets the WiFi configuration storage location.
| s | The storage location (flash or RAM). |
| 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.
| enable | Whether to enable or disable the vendor IE. |
| type | The frame type for the vendor IE. |
| id | The vendor IE index. |
| vnd_ie | Pointer to the vendor IE data. |
| result< void > idfxx::wifi::try_set_vendor_ie_cb | ( | vendor_ie_cb | cb, |
| void * | ctx | ||
| ) |
Registers a callback for received vendor-specific IEs.
| cb | Callback function pointer, or nullptr to clear. |
| ctx | User context pointer passed to the callback. |
| result< uint16_t > idfxx::wifi::try_sta_get_aid | ( | ) |
Gets the association ID assigned by the AP in station mode.
| result< void > idfxx::wifi::try_start | ( | ) |
Starts the WiFi subsystem.
After starting, configured interfaces become active. A mode must be set before starting.
| result< void > idfxx::wifi::try_statis_dump | ( | flags< statis_module > | modules | ) |
Dumps WiFi statistics for the specified modules.
| modules | Flags indicating which modules to dump statistics for. |
| result< void > idfxx::wifi::try_stop | ( | ) |
Stops the WiFi subsystem.
| 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.
| iface | The WiFi interface to transmit on. |
| buffer | The raw frame data. |
| en_sys_seq | Whether to use system-managed sequence numbers. |
| void idfxx::wifi::tx_80211 | ( | enum role | iface, |
| std::span< const uint8_t > | buffer, | ||
| bool | en_sys_seq | ||
| ) |
Transmits a raw 802.11 frame.
| iface | The WiFi interface to transmit on. |
| buffer | The raw frame data. |
| en_sys_seq | Whether to use system-managed sequence numbers. |
| std::system_error | on failure. |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
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.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |