1 /* 2 * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 8 #ifndef __ESP_WIFI_TYPES_H__ 9 #define __ESP_WIFI_TYPES_H__ 10 11 #include "esp_private/esp_wifi_types_private.h" 12 #if CONFIG_SOC_WIFI_HE_SUPPORT 13 #include "esp_wifi_he_types.h" 14 #endif 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 typedef enum { 21 ESP32_WIFI_MODE_NULL = 0, /**< null mode */ 22 ESP32_WIFI_MODE_STA, /**< WiFi station mode */ 23 ESP32_WIFI_MODE_AP, /**< WiFi soft-AP mode */ 24 ESP32_WIFI_MODE_APSTA, /**< WiFi station + soft-AP mode */ 25 ESP32_WIFI_MODE_NAN, /**< WiFi NAN mode */ 26 ESP32_WIFI_MODE_MAX 27 } wifi_mode_t; 28 29 typedef enum { 30 WIFI_IF_STA = ESP_IF_WIFI_STA, 31 WIFI_IF_AP = ESP_IF_WIFI_AP, 32 #if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) 33 WIFI_IF_NAN = ESP_IF_WIFI_NAN, 34 #endif 35 WIFI_IF_MAX 36 } wifi_interface_t; 37 38 #define WIFI_OFFCHAN_TX_REQ 1 39 #define WIFI_OFFCHAN_TX_CANCEL 0 40 41 #define WIFI_ROC_REQ 1 42 #define WIFI_ROC_CANCEL 0 43 44 typedef enum { 45 WIFI_COUNTRY_POLICY_AUTO, /**< Country policy is auto, use the country info of AP to which the station is connected */ 46 WIFI_COUNTRY_POLICY_MANUAL, /**< Country policy is manual, always use the configured country info */ 47 } wifi_country_policy_t; 48 49 /** @brief Structure describing WiFi country-based regional restrictions. */ 50 typedef struct { 51 char cc[3]; /**< country code string */ 52 uint8_t schan; /**< start channel */ 53 uint8_t nchan; /**< total channel number */ 54 int8_t max_tx_power; /**< This field is used for getting WiFi maximum transmitting power, call esp_wifi_set_max_tx_power to set the maximum transmitting power. */ 55 wifi_country_policy_t policy; /**< country policy */ 56 } wifi_country_t; 57 58 /** 59 * @brief Wi-Fi authmode type 60 * Strength of authmodes 61 * Personal Networks : OPEN < WEP < WPA_PSK < OWE < WPA2_PSK = WPA_WPA2_PSK < WAPI_PSK < WPA3_PSK = WPA2_WPA3_PSK 62 * Enterprise Networks : WIFI_AUTH_WPA2_ENTERPRISE < WIFI_AUTH_WPA3_ENTERPRISE = WIFI_AUTH_WPA2_WPA3_ENTERPRISE < WIFI_AUTH_WPA3_ENT_192 63 */ 64 typedef enum { 65 WIFI_AUTH_OPEN = 0, /**< authenticate mode : open */ 66 WIFI_AUTH_WEP, /**< authenticate mode : WEP */ 67 WIFI_AUTH_WPA_PSK, /**< authenticate mode : WPA_PSK */ 68 WIFI_AUTH_WPA2_PSK, /**< authenticate mode : WPA2_PSK */ 69 WIFI_AUTH_WPA_WPA2_PSK, /**< authenticate mode : WPA_WPA2_PSK */ 70 WIFI_AUTH_ENTERPRISE, /**< authenticate mode : WiFi EAP security */ 71 WIFI_AUTH_WPA2_ENTERPRISE = WIFI_AUTH_ENTERPRISE, /**< authenticate mode : WiFi EAP security */ 72 WIFI_AUTH_WPA3_PSK, /**< authenticate mode : WPA3_PSK */ 73 WIFI_AUTH_WPA2_WPA3_PSK, /**< authenticate mode : WPA2_WPA3_PSK */ 74 WIFI_AUTH_WAPI_PSK, /**< authenticate mode : WAPI_PSK */ 75 WIFI_AUTH_OWE, /**< authenticate mode : OWE */ 76 WIFI_AUTH_WPA3_ENT_192, /**< authenticate mode : WPA3_ENT_SUITE_B_192_BIT */ 77 WIFI_AUTH_DUMMY_1, /**< Dummy placeholder authenticate mode for WIFI_AUTH_WPA3_EXT_PSK */ 78 WIFI_AUTH_DUMMY_2, /**< Dummy placeholder authenticate mode for WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE */ 79 WIFI_AUTH_DUMMY_3, /**< Dummy placeholder authenticate mode for WIFI_AUTH_DPP */ 80 WIFI_AUTH_WPA3_ENTERPRISE, /**< authenticate mode : WPA3-Enterprise Only Mode */ 81 WIFI_AUTH_WPA2_WPA3_ENTERPRISE, /**< authenticate mode : WPA3-Enterprise Transition Mode */ 82 WIFI_AUTH_MAX 83 } wifi_auth_mode_t; 84 85 typedef enum { 86 WIFI_REASON_UNSPECIFIED = 1, 87 WIFI_REASON_AUTH_EXPIRE = 2, 88 WIFI_REASON_AUTH_LEAVE = 3, 89 WIFI_REASON_ASSOC_EXPIRE = 4, /* Deprecated, will be removed in next IDF major release */ 90 WIFI_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, 91 WIFI_REASON_ASSOC_TOOMANY = 5, 92 WIFI_REASON_NOT_AUTHED = 6, /* Deprecated, will be removed in next IDF major release */ 93 WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, 94 WIFI_REASON_NOT_ASSOCED = 7, /* Deprecated, will be removed in next IDF major release */ 95 WIFI_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, 96 WIFI_REASON_ASSOC_LEAVE = 8, 97 WIFI_REASON_ASSOC_NOT_AUTHED = 9, 98 WIFI_REASON_DISASSOC_PWRCAP_BAD = 10, 99 WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11, 100 WIFI_REASON_BSS_TRANSITION_DISASSOC = 12, 101 WIFI_REASON_IE_INVALID = 13, 102 WIFI_REASON_MIC_FAILURE = 14, 103 WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, 104 WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, 105 WIFI_REASON_IE_IN_4WAY_DIFFERS = 17, 106 WIFI_REASON_GROUP_CIPHER_INVALID = 18, 107 WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19, 108 WIFI_REASON_AKMP_INVALID = 20, 109 WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21, 110 WIFI_REASON_INVALID_RSN_IE_CAP = 22, 111 WIFI_REASON_802_1X_AUTH_FAILED = 23, 112 WIFI_REASON_CIPHER_SUITE_REJECTED = 24, 113 WIFI_REASON_TDLS_PEER_UNREACHABLE = 25, 114 WIFI_REASON_TDLS_UNSPECIFIED = 26, 115 WIFI_REASON_SSP_REQUESTED_DISASSOC = 27, 116 WIFI_REASON_NO_SSP_ROAMING_AGREEMENT = 28, 117 WIFI_REASON_BAD_CIPHER_OR_AKM = 29, 118 WIFI_REASON_NOT_AUTHORIZED_THIS_LOCATION = 30, 119 WIFI_REASON_SERVICE_CHANGE_PERCLUDES_TS = 31, 120 WIFI_REASON_UNSPECIFIED_QOS = 32, 121 WIFI_REASON_NOT_ENOUGH_BANDWIDTH = 33, 122 WIFI_REASON_MISSING_ACKS = 34, 123 WIFI_REASON_EXCEEDED_TXOP = 35, 124 WIFI_REASON_STA_LEAVING = 36, 125 WIFI_REASON_END_BA = 37, 126 WIFI_REASON_UNKNOWN_BA = 38, 127 WIFI_REASON_TIMEOUT = 39, 128 WIFI_REASON_PEER_INITIATED = 46, 129 WIFI_REASON_AP_INITIATED = 47, 130 WIFI_REASON_INVALID_FT_ACTION_FRAME_COUNT = 48, 131 WIFI_REASON_INVALID_PMKID = 49, 132 WIFI_REASON_INVALID_MDE = 50, 133 WIFI_REASON_INVALID_FTE = 51, 134 WIFI_REASON_TRANSMISSION_LINK_ESTABLISH_FAILED = 67, 135 WIFI_REASON_ALTERATIVE_CHANNEL_OCCUPIED = 68, 136 137 WIFI_REASON_BEACON_TIMEOUT = 200, 138 WIFI_REASON_NO_AP_FOUND = 201, 139 WIFI_REASON_AUTH_FAIL = 202, 140 WIFI_REASON_ASSOC_FAIL = 203, 141 WIFI_REASON_HANDSHAKE_TIMEOUT = 204, 142 WIFI_REASON_CONNECTION_FAIL = 205, 143 WIFI_REASON_AP_TSF_RESET = 206, 144 WIFI_REASON_ROAMING = 207, 145 WIFI_REASON_ASSOC_COMEBACK_TIME_TOO_LONG = 208, 146 WIFI_REASON_SA_QUERY_TIMEOUT = 209, 147 } wifi_err_reason_t; 148 149 typedef enum { 150 WIFI_SECOND_CHAN_NONE = 0, /**< the channel width is HT20 */ 151 WIFI_SECOND_CHAN_ABOVE, /**< the channel width is HT40 and the secondary channel is above the primary channel */ 152 WIFI_SECOND_CHAN_BELOW, /**< the channel width is HT40 and the secondary channel is below the primary channel */ 153 } wifi_second_chan_t; 154 155 typedef enum { 156 ESP32_WIFI_SCAN_TYPE_ACTIVE = 0, /**< active scan */ 157 ESP32_WIFI_SCAN_TYPE_PASSIVE, /**< passive scan */ 158 } wifi_scan_type_t; 159 160 /** @brief Range of active scan times per channel */ 161 typedef struct { 162 uint32_t min; /**< minimum active scan time per channel, units: millisecond */ 163 uint32_t max; /**< maximum active scan time per channel, units: millisecond, values above 1500ms may 164 cause station to disconnect from AP and are not recommended. */ 165 } wifi_active_scan_time_t; 166 167 /** @brief Aggregate of active & passive scan time per channel */ 168 typedef struct { 169 wifi_active_scan_time_t active; /**< active scan time per channel, units: millisecond. */ 170 uint32_t passive; /**< passive scan time per channel, units: millisecond, values above 1500ms may 171 cause station to disconnect from AP and are not recommended. */ 172 } wifi_scan_time_t; 173 174 /** @brief Parameters for an SSID scan. */ 175 typedef struct { 176 uint8_t *ssid; /**< SSID of AP */ 177 uint8_t *bssid; /**< MAC address of AP */ 178 uint8_t channel; /**< channel, scan the specific channel */ 179 bool show_hidden; /**< enable to scan AP whose SSID is hidden */ 180 wifi_scan_type_t scan_type; /**< scan type, active or passive */ 181 wifi_scan_time_t scan_time; /**< scan time per channel */ 182 uint8_t home_chan_dwell_time;/**< time spent at home channel between scanning consecutive channels.*/ 183 } wifi_scan_config_t; 184 185 typedef enum { 186 WIFI_CIPHER_TYPE_NONE = 0, /**< the cipher type is none */ 187 WIFI_CIPHER_TYPE_WEP40, /**< the cipher type is WEP40 */ 188 WIFI_CIPHER_TYPE_WEP104, /**< the cipher type is WEP104 */ 189 WIFI_CIPHER_TYPE_TKIP, /**< the cipher type is TKIP */ 190 WIFI_CIPHER_TYPE_CCMP, /**< the cipher type is CCMP */ 191 WIFI_CIPHER_TYPE_TKIP_CCMP, /**< the cipher type is TKIP and CCMP */ 192 WIFI_CIPHER_TYPE_AES_CMAC128,/**< the cipher type is AES-CMAC-128 */ 193 WIFI_CIPHER_TYPE_SMS4, /**< the cipher type is SMS4 */ 194 WIFI_CIPHER_TYPE_GCMP, /**< the cipher type is GCMP */ 195 WIFI_CIPHER_TYPE_GCMP256, /**< the cipher type is GCMP-256 */ 196 WIFI_CIPHER_TYPE_AES_GMAC128,/**< the cipher type is AES-GMAC-128 */ 197 WIFI_CIPHER_TYPE_AES_GMAC256,/**< the cipher type is AES-GMAC-256 */ 198 WIFI_CIPHER_TYPE_UNKNOWN, /**< the cipher type is unknown */ 199 } wifi_cipher_type_t; 200 201 /** 202 * @brief WiFi antenna 203 * 204 */ 205 typedef enum { 206 WIFI_ANT_ANT0, /**< WiFi antenna 0 */ 207 WIFI_ANT_ANT1, /**< WiFi antenna 1 */ 208 WIFI_ANT_MAX, /**< Invalid WiFi antenna */ 209 } wifi_ant_t; 210 211 /** @brief Description of a WiFi AP HE Info */ 212 typedef struct { 213 uint8_t bss_color:6; /**< an unsigned integer whose value is the BSS Color of the BSS corresponding to the AP */ 214 uint8_t partial_bss_color:1; /**< indicate if an AID assignment rule based on the BSS color */ 215 uint8_t bss_color_disabled:1; /**< indicate if the use of BSS color is disabled */ 216 uint8_t bssid_index; /**< in M-BSSID set, identifies the nontransmitted BSSID */ 217 } wifi_he_ap_info_t; 218 219 /** @brief Description of a WiFi AP */ 220 typedef struct { 221 uint8_t bssid[6]; /**< MAC address of AP */ 222 uint8_t ssid[33]; /**< SSID of AP */ 223 uint8_t primary; /**< channel of AP */ 224 wifi_second_chan_t second; /**< secondary channel of AP */ 225 int8_t rssi; /**< signal strength of AP. Note that in some rare cases where signal strength is very strong, rssi values can be slightly positive */ 226 wifi_auth_mode_t authmode; /**< authmode of AP */ 227 wifi_cipher_type_t pairwise_cipher; /**< pairwise cipher of AP */ 228 wifi_cipher_type_t group_cipher; /**< group cipher of AP */ 229 wifi_ant_t ant; /**< antenna used to receive beacon from AP */ 230 uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */ 231 uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */ 232 uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */ 233 uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */ 234 uint32_t phy_11ax:1; /**< bit: 4 flag to identify if 11ax mode is enabled or not */ 235 uint32_t wps:1; /**< bit: 5 flag to identify if WPS is supported or not */ 236 uint32_t ftm_responder:1; /**< bit: 6 flag to identify if FTM is supported in responder mode */ 237 uint32_t ftm_initiator:1; /**< bit: 7 flag to identify if FTM is supported in initiator mode */ 238 uint32_t reserved:24; /**< bit: 8..31 reserved */ 239 wifi_country_t country; /**< country information of AP */ 240 wifi_he_ap_info_t he_ap; /**< HE AP info */ 241 } wifi_ap_record_t; 242 243 typedef enum { 244 WIFI_FAST_SCAN = 0, /**< Do fast scan, scan will end after find SSID match AP */ 245 WIFI_ALL_CHANNEL_SCAN, /**< All channel scan, scan will end after scan all the channel */ 246 }wifi_scan_method_t; 247 248 typedef enum { 249 WIFI_CONNECT_AP_BY_SIGNAL = 0, /**< Sort match AP in scan list by RSSI */ 250 WIFI_CONNECT_AP_BY_SECURITY, /**< Sort match AP in scan list by security mode */ 251 }wifi_sort_method_t; 252 253 /** @brief Structure describing parameters for a WiFi fast scan */ 254 typedef struct { 255 int8_t rssi; /**< The minimum rssi to accept in the fast scan mode */ 256 wifi_auth_mode_t authmode; /**< The weakest authmode to accept in the fast scan mode 257 Note: Incase this value is not set and password is set as per WPA2 standards(password len >= 8), it will be defaulted to WPA2 and device won't connect to deprecated WEP/WPA networks. Please set authmode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */ 258 }wifi_scan_threshold_t; 259 260 typedef enum { 261 WIFI_PS_NONE, /**< No power save */ 262 WIFI_PS_MIN_MODEM, /**< Minimum modem power saving. In this mode, station wakes up to receive beacon every DTIM period */ 263 WIFI_PS_MAX_MODEM, /**< Maximum modem power saving. In this mode, interval to receive beacons is determined by the listen_interval parameter in wifi_sta_config_t */ 264 } wifi_ps_type_t; 265 266 #define WIFI_PROTOCOL_11B 1 267 #define WIFI_PROTOCOL_11G 2 268 #define WIFI_PROTOCOL_11N 4 269 #define WIFI_PROTOCOL_LR 8 270 #define WIFI_PROTOCOL_11AX 16 271 272 typedef enum { 273 WIFI_BW_HT20 = 1, /* Bandwidth is HT20 */ 274 WIFI_BW_HT40, /* Bandwidth is HT40 */ 275 } wifi_bandwidth_t; 276 277 /** Configuration structure for Protected Management Frame */ 278 typedef struct { 279 bool capable; /**< Deprecated variable. Device will always connect in PMF mode if other device also advertizes PMF capability. */ 280 bool required; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ 281 } wifi_pmf_config_t; 282 283 /** Configuration for SAE PWE derivation */ 284 typedef enum { 285 WPA3_SAE_PWE_UNSPECIFIED, 286 WPA3_SAE_PWE_HUNT_AND_PECK, 287 WPA3_SAE_PWE_HASH_TO_ELEMENT, 288 WPA3_SAE_PWE_BOTH, 289 } wifi_sae_pwe_method_t; 290 291 /** Configuration for SAE-PK */ 292 typedef enum { 293 WPA3_SAE_PK_MODE_AUTOMATIC = 0, 294 WPA3_SAE_PK_MODE_ONLY = 1, 295 WPA3_SAE_PK_MODE_DISABLED = 2, 296 } wifi_sae_pk_mode_t; 297 298 /** @brief Soft-AP configuration settings for the device */ 299 typedef struct { 300 uint8_t ssid[32]; /**< SSID of soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. */ 301 uint8_t password[64]; /**< Password of soft-AP. */ 302 uint8_t ssid_len; /**< Optional length of SSID field. */ 303 uint8_t channel; /**< Channel of soft-AP */ 304 wifi_auth_mode_t authmode; /**< Auth mode of soft-AP. Do not support AUTH_WEP, AUTH_WAPI_PSK and AUTH_OWE in soft-AP mode. When the auth mode is set to WPA2_PSK, WPA2_WPA3_PSK or WPA3_PSK, the pairwise cipher will be overwritten with WIFI_CIPHER_TYPE_CCMP. */ 305 uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */ 306 uint8_t max_connection; /**< Max number of stations allowed to connect in */ 307 uint16_t beacon_interval; /**< Beacon interval which should be multiples of 100. Unit: TU(time unit, 1 TU = 1024 us). Range: 100 ~ 60000. Default value: 100 */ 308 uint8_t csa_count; /**< Channel Switch Announcement Count. Notify the station that the channel will switch after the csa_count beacon intervals. Range: 1 ~ 30. Default value: 3 */ 309 uint8_t dtim_period; /**< Dtim period of soft-AP. Range: 1 ~ 10. Default value: 1 */ 310 wifi_cipher_type_t pairwise_cipher; /**< Pairwise cipher of SoftAP, group cipher will be derived using this. Cipher values are valid starting from WIFI_CIPHER_TYPE_TKIP, enum values before that will be considered as invalid and default cipher suites(TKIP+CCMP) will be used. Valid cipher suites in softAP mode are WIFI_CIPHER_TYPE_TKIP, WIFI_CIPHER_TYPE_CCMP and WIFI_CIPHER_TYPE_TKIP_CCMP. */ 311 bool ftm_responder; /**< Enable FTM Responder mode */ 312 wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame */ 313 wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method */ 314 } wifi_ap_config_t; 315 316 #define SAE_H2E_IDENTIFIER_LEN 32 317 /** @brief STA configuration settings for the device */ 318 typedef struct { 319 uint8_t ssid[32]; /**< SSID of target AP. */ 320 uint8_t password[64]; /**< Password of target AP. */ 321 wifi_scan_method_t scan_method; /**< do all channel scan or fast scan */ 322 bool bssid_set; /**< whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP.*/ 323 uint8_t bssid[6]; /**< MAC address of target AP*/ 324 uint8_t channel; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/ 325 uint16_t listen_interval; /**< Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0. */ 326 wifi_sort_method_t sort_method; /**< sort the connect AP in the list by rssi or security mode */ 327 wifi_scan_threshold_t threshold; /**< When scan_threshold is set, only APs which have an auth mode that is more secure than the selected auth mode and a signal stronger than the minimum RSSI will be used. */ 328 wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame. Will be advertised in RSN Capabilities in RSN IE. */ 329 uint32_t rm_enabled:1; /**< Whether Radio Measurements are enabled for the connection */ 330 uint32_t btm_enabled:1; /**< Whether BSS Transition Management is enabled for the connection */ 331 uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */ 332 uint32_t ft_enabled:1; /**< Whether FT is enabled for the connection */ 333 uint32_t owe_enabled:1; /**< Whether OWE is enabled for the connection */ 334 uint32_t transition_disable:1; /**< Whether to enable transition disable feature */ 335 uint32_t reserved:26; /**< Reserved for future feature set */ 336 wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method */ 337 wifi_sae_pk_mode_t sae_pk_mode; /**< Configuration for SAE-PK (Public Key) Authentication method */ 338 uint8_t failure_retry_cnt; /**< Number of connection retries station will do before moving to next AP. scan_method should be set as WIFI_ALL_CHANNEL_SCAN to use this config. 339 Note: Enabling this may cause connection time to increase incase best AP doesn't behave properly. */ 340 uint32_t he_dcm_set:1; /**< Whether DCM max.constellation for transmission and reception is set. */ 341 uint32_t he_dcm_max_constellation_tx:2; /**< Indicate the max.constellation for DCM in TB PPDU the STA supported. 0: not supported. 1: BPSK, 2: QPSK, 3: 16-QAM. The default value is 3. */ 342 uint32_t he_dcm_max_constellation_rx:2; /**< Indicate the max.constellation for DCM in both Data field and HE-SIG-B field the STA supported. 0: not supported. 1: BPSK, 2: QPSK, 3: 16-QAM. The default value is 3. */ 343 uint32_t he_mcs9_enabled:1; /**< Whether to support HE-MCS 0 to 9. The default value is 0. */ 344 uint32_t he_su_beamformee_disabled:1; /**< Whether to disable support for operation as an SU beamformee. */ 345 uint32_t he_trig_su_bmforming_feedback_disabled:1; /**< Whether to disable support the transmission of SU feedback in an HE TB sounding sequence. */ 346 uint32_t he_trig_mu_bmforming_partial_feedback_disabled:1; /**< Whether to disable support the transmission of partial-bandwidth MU feedback in an HE TB sounding sequence. */ 347 uint32_t he_trig_cqi_feedback_disabled:1; /**< Whether to disable support the transmission of CQI feedback in an HE TB sounding sequence. */ 348 uint32_t he_reserved:22; /**< Reserved for future feature set */ 349 uint8_t sae_h2e_identifier[SAE_H2E_IDENTIFIER_LEN];/**< Password identifier for H2E. this needs to be null terminated string */ 350 } wifi_sta_config_t; 351 352 /** 353 * @brief NAN Discovery start configuration 354 * 355 */ 356 typedef struct { 357 uint8_t op_channel; /**< NAN Discovery operating channel */ 358 uint8_t master_pref; /**< Device's preference value to serve as NAN Master */ 359 uint8_t scan_time; /**< Scan time in seconds while searching for a NAN cluster */ 360 uint16_t warm_up_sec; /**< Warm up time before assuming NAN Anchor Master role */ 361 } wifi_nan_config_t; 362 363 /** @brief Configuration data for device's AP or STA or NAN. 364 * 365 * The usage of this union (for ap, sta or nan configuration) is determined by the accompanying 366 * interface argument passed to esp_wifi_set_config() or esp_wifi_get_config() 367 * 368 */ 369 typedef union { 370 wifi_ap_config_t ap; /**< configuration of AP */ 371 wifi_sta_config_t sta; /**< configuration of STA */ 372 wifi_nan_config_t nan; /**< configuration of NAN */ 373 } wifi_config_t; 374 375 /** @brief Description of STA associated with AP */ 376 typedef struct { 377 uint8_t mac[6]; /**< mac address */ 378 int8_t rssi; /**< current average rssi of sta connected */ 379 uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */ 380 uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */ 381 uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */ 382 uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */ 383 uint32_t phy_11ax:1; /**< bit: 4 flag to identify if 11ax mode is enabled or not */ 384 uint32_t is_mesh_child:1;/**< bit: 5 flag to identify mesh child */ 385 uint32_t reserved:26; /**< bit: 6..31 reserved */ 386 } wifi_sta_info_t; 387 388 #if CONFIG_IDF_TARGET_ESP32C2 389 #define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */ 390 #elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 391 #define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 soft-AP */ 392 #else 393 #define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */ 394 #endif 395 396 /** @brief List of stations associated with the Soft-AP */ 397 typedef struct { 398 wifi_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< station list */ 399 int num; /**< number of stations in the list (other entries are invalid) */ 400 } wifi_sta_list_t; 401 402 typedef enum { 403 WIFI_STORAGE_FLASH, /**< all configuration will store in both memory and flash */ 404 WIFI_STORAGE_RAM, /**< all configuration will only store in the memory */ 405 } wifi_storage_t; 406 407 /** 408 * @brief Vendor Information Element type 409 * 410 * Determines the frame type that the IE will be associated with. 411 */ 412 typedef enum { 413 WIFI_VND_IE_TYPE_BEACON, 414 WIFI_VND_IE_TYPE_PROBE_REQ, 415 WIFI_VND_IE_TYPE_PROBE_RESP, 416 WIFI_VND_IE_TYPE_ASSOC_REQ, 417 WIFI_VND_IE_TYPE_ASSOC_RESP, 418 } wifi_vendor_ie_type_t; 419 420 /** 421 * @brief Vendor Information Element index 422 * 423 * Each IE type can have up to two associated vendor ID elements. 424 */ 425 typedef enum { 426 WIFI_VND_IE_ID_0, 427 WIFI_VND_IE_ID_1, 428 } wifi_vendor_ie_id_t; 429 430 #define WIFI_VENDOR_IE_ELEMENT_ID 0xDD 431 432 /** 433 * @brief Operation Phymode 434 */ 435 typedef enum 436 { 437 WIFI_PHY_MODE_LR, /**< PHY mode for Low Rate */ 438 WIFI_PHY_MODE_11B, /**< PHY mode for 11b */ 439 WIFI_PHY_MODE_11G, /**< PHY mode for 11g */ 440 WIFI_PHY_MODE_HT20, /**< PHY mode for Bandwidth HT20 */ 441 WIFI_PHY_MODE_HT40, /**< PHY mode for Bandwidth HT40 */ 442 WIFI_PHY_MODE_HE20, /**< PHY mode for Bandwidth HE20 */ 443 } wifi_phy_mode_t; 444 445 /** 446 * @brief Vendor Information Element header 447 * 448 * The first bytes of the Information Element will match this header. Payload follows. 449 */ 450 typedef struct { 451 uint8_t element_id; /**< Should be set to WIFI_VENDOR_IE_ELEMENT_ID (0xDD) */ 452 uint8_t length; /**< Length of all bytes in the element data following this field. Minimum 4. */ 453 uint8_t vendor_oui[3]; /**< Vendor identifier (OUI). */ 454 uint8_t vendor_oui_type; /**< Vendor-specific OUI type. */ 455 uint8_t payload[0]; /**< Payload. Length is equal to value in 'length' field, minus 4. */ 456 } vendor_ie_data_t; 457 458 #if CONFIG_SOC_WIFI_HE_SUPPORT 459 typedef esp_wifi_rxctrl_t wifi_pkt_rx_ctrl_t; 460 #else 461 /** @brief Received packet radio metadata header, this is the common header at the beginning of all promiscuous mode RX callback buffers */ 462 typedef struct { 463 signed rssi:8; /**< Received Signal Strength Indicator(RSSI) of packet. unit: dBm */ 464 unsigned rate:5; /**< PHY rate encoding of the packet. Only valid for non HT(11bg) packet */ 465 unsigned :1; /**< reserved */ 466 unsigned sig_mode:2; /**< Protocol of the reveived packet, 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */ 467 unsigned :16; /**< reserved */ 468 unsigned mcs:7; /**< Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */ 469 unsigned cwb:1; /**< Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */ 470 unsigned :16; /**< reserved */ 471 unsigned smoothing:1; /**< Set to 1 indicates that channel estimate smoothing is recommended. 472 Set to 0 indicates that only per-carrierindependent (unsmoothed) channel estimate is recommended. */ 473 unsigned not_sounding:1; /**< Set to 0 indicates that PPDU is a sounding PPDU. Set to 1indicates that the PPDU is not a sounding PPDU. 474 sounding PPDU is used for channel estimation by the request receiver */ 475 unsigned :1; /**< reserved */ 476 unsigned aggregation:1; /**< Aggregation. 0: MPDU packet; 1: AMPDU packet */ 477 unsigned stbc:2; /**< Space Time Block Code(STBC). 0: non STBC packet; 1: STBC packet */ 478 unsigned fec_coding:1; /**< Forward Error Correction(FEC). Flag is set for 11n packets which are LDPC */ 479 unsigned sgi:1; /**< Short Guide Interval(SGI). 0: Long GI; 1: Short GI */ 480 #if CONFIG_IDF_TARGET_ESP32 481 signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/ 482 #elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 483 unsigned :8; /**< reserved */ 484 #endif 485 unsigned ampdu_cnt:8; /**< the number of subframes aggregated in AMPDU */ 486 unsigned channel:4; /**< primary channel on which this packet is received */ 487 unsigned secondary_channel:4; /**< secondary channel on which this packet is received. 0: none; 1: above; 2: below */ 488 unsigned :8; /**< reserved */ 489 unsigned timestamp:32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */ 490 unsigned :32; /**< reserved */ 491 #if CONFIG_IDF_TARGET_ESP32S2 492 unsigned :32; /**< reserved */ 493 #elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 494 signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/ 495 unsigned :24; /**< reserved */ 496 unsigned :32; /**< reserved */ 497 #endif 498 unsigned :31; /**< reserved */ 499 unsigned ant:1; /**< antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */ 500 #if CONFIG_IDF_TARGET_ESP32S2 501 signed noise_floor:8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/ 502 unsigned :24; /**< reserved */ 503 #elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 504 unsigned :32; /**< reserved */ 505 unsigned :32; /**< reserved */ 506 unsigned :32; /**< reserved */ 507 #endif 508 unsigned sig_len:12; /**< length of packet including Frame Check Sequence(FCS) */ 509 unsigned :12; /**< reserved */ 510 unsigned rx_state:8; /**< state of the packet. 0: no error; others: error numbers which are not public */ 511 } wifi_pkt_rx_ctrl_t; 512 #endif 513 514 /** @brief Payload passed to 'buf' parameter of promiscuous mode RX callback. 515 */ 516 typedef struct { 517 wifi_pkt_rx_ctrl_t rx_ctrl; /**< metadata header */ 518 uint8_t payload[0]; /**< Data or management payload. Length of payload is described by rx_ctrl.sig_len. Type of content determined by packet type argument of callback. */ 519 } wifi_promiscuous_pkt_t; 520 521 /** 522 * @brief Promiscuous frame type 523 * 524 * Passed to promiscuous mode RX callback to indicate the type of parameter in the buffer. 525 * 526 */ 527 typedef enum { 528 WIFI_PKT_MGMT, /**< Management frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */ 529 WIFI_PKT_CTRL, /**< Control frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */ 530 WIFI_PKT_DATA, /**< Data frame, indiciates 'buf' argument is wifi_promiscuous_pkt_t */ 531 WIFI_PKT_MISC, /**< Other type, such as MIMO etc. 'buf' argument is wifi_promiscuous_pkt_t but the payload is zero length. */ 532 } wifi_promiscuous_pkt_type_t; 533 534 535 #define WIFI_PROMIS_FILTER_MASK_ALL (0xFFFFFFFF) /**< filter all packets */ 536 #define WIFI_PROMIS_FILTER_MASK_MGMT (1) /**< filter the packets with type of WIFI_PKT_MGMT */ 537 #define WIFI_PROMIS_FILTER_MASK_CTRL (1<<1) /**< filter the packets with type of WIFI_PKT_CTRL */ 538 #define WIFI_PROMIS_FILTER_MASK_DATA (1<<2) /**< filter the packets with type of WIFI_PKT_DATA */ 539 #define WIFI_PROMIS_FILTER_MASK_MISC (1<<3) /**< filter the packets with type of WIFI_PKT_MISC */ 540 #define WIFI_PROMIS_FILTER_MASK_DATA_MPDU (1<<4) /**< filter the MPDU which is a kind of WIFI_PKT_DATA */ 541 #define WIFI_PROMIS_FILTER_MASK_DATA_AMPDU (1<<5) /**< filter the AMPDU which is a kind of WIFI_PKT_DATA */ 542 #define WIFI_PROMIS_FILTER_MASK_FCSFAIL (1<<6) /**< filter the FCS failed packets, do not open it in general */ 543 544 #define WIFI_PROMIS_CTRL_FILTER_MASK_ALL (0xFF800000) /**< filter all control packets */ 545 #define WIFI_PROMIS_CTRL_FILTER_MASK_WRAPPER (1<<23) /**< filter the control packets with subtype of Control Wrapper */ 546 #define WIFI_PROMIS_CTRL_FILTER_MASK_BAR (1<<24) /**< filter the control packets with subtype of Block Ack Request */ 547 #define WIFI_PROMIS_CTRL_FILTER_MASK_BA (1<<25) /**< filter the control packets with subtype of Block Ack */ 548 #define WIFI_PROMIS_CTRL_FILTER_MASK_PSPOLL (1<<26) /**< filter the control packets with subtype of PS-Poll */ 549 #define WIFI_PROMIS_CTRL_FILTER_MASK_RTS (1<<27) /**< filter the control packets with subtype of RTS */ 550 #define WIFI_PROMIS_CTRL_FILTER_MASK_CTS (1<<28) /**< filter the control packets with subtype of CTS */ 551 #define WIFI_PROMIS_CTRL_FILTER_MASK_ACK (1<<29) /**< filter the control packets with subtype of ACK */ 552 #define WIFI_PROMIS_CTRL_FILTER_MASK_CFEND (1<<30) /**< filter the control packets with subtype of CF-END */ 553 #define WIFI_PROMIS_CTRL_FILTER_MASK_CFENDACK (1<<31) /**< filter the control packets with subtype of CF-END+CF-ACK */ 554 555 /** @brief Mask for filtering different packet types in promiscuous mode. */ 556 typedef struct { 557 uint32_t filter_mask; /**< OR of one or more filter values WIFI_PROMIS_FILTER_* */ 558 } wifi_promiscuous_filter_t; 559 560 #define WIFI_EVENT_MASK_ALL (0xFFFFFFFF) /**< mask all WiFi events */ 561 #define WIFI_EVENT_MASK_NONE (0) /**< mask none of the WiFi events */ 562 #define WIFI_EVENT_MASK_AP_PROBEREQRECVED (BIT(0)) /**< mask SYSTEM_EVENT_AP_PROBEREQRECVED event */ 563 564 /** 565 * @brief Channel state information(CSI) configuration type 566 * 567 */ 568 #if CONFIG_SOC_WIFI_HE_SUPPORT 569 typedef wifi_csi_acquire_config_t wifi_csi_config_t; 570 #else 571 typedef struct { 572 bool lltf_en; /**< enable to receive legacy long training field(lltf) data. Default enabled */ 573 bool htltf_en; /**< enable to receive HT long training field(htltf) data. Default enabled */ 574 bool stbc_htltf2_en; /**< enable to receive space time block code HT long training field(stbc-htltf2) data. Default enabled */ 575 bool ltf_merge_en; /**< enable to generate htlft data by averaging lltf and ht_ltf data when receiving HT packet. Otherwise, use ht_ltf data directly. Default enabled */ 576 bool channel_filter_en; /**< enable to turn on channel filter to smooth adjacent sub-carrier. Disable it to keep independence of adjacent sub-carrier. Default enabled */ 577 bool manu_scale; /**< manually scale the CSI data by left shifting or automatically scale the CSI data. If set true, please set the shift bits. false: automatically. true: manually. Default false */ 578 uint8_t shift; /**< manually left shift bits of the scale of the CSI data. The range of the left shift bits is 0~15 */ 579 bool dump_ack_en; /**< enable to dump 802.11 ACK frame, default disabled */ 580 } wifi_csi_config_t; 581 #endif 582 583 /** 584 * @brief CSI data type 585 * 586 */ 587 typedef struct { 588 wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */ 589 uint8_t mac[6]; /**< source MAC address of the CSI data */ 590 uint8_t dmac[6]; /**< destination MAC address of the CSI data */ 591 bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not, true indicates the first four bytes is invalid due to hardware limition */ 592 int8_t *buf; /**< valid buffer of CSI data */ 593 uint16_t len; /**< valid length of CSI data */ 594 uint8_t *hdr; /**< header of the wifi packet */ 595 uint8_t *payload; /**< payload of the wifi packet */ 596 uint16_t payload_len; /**< payload len of the wifi packet */ 597 uint16_t rx_seq; /**< rx sequence number of the wifi packet */ 598 } wifi_csi_info_t; 599 600 /** 601 * @brief WiFi GPIO configuration for antenna selection 602 * 603 */ 604 typedef struct { 605 uint8_t gpio_select: 1, /**< Whether this GPIO is connected to external antenna switch */ 606 gpio_num: 7; /**< The GPIO number that connects to external antenna switch */ 607 } wifi_ant_gpio_t; 608 609 /** 610 * @brief WiFi GPIOs configuration for antenna selection 611 * 612 */ 613 typedef struct { 614 wifi_ant_gpio_t gpio_cfg[4]; /**< The configurations of GPIOs that connect to external antenna switch */ 615 } wifi_ant_gpio_config_t; 616 617 /** 618 * @brief WiFi antenna mode 619 * 620 */ 621 typedef enum { 622 WIFI_ANT_MODE_ANT0, /**< Enable WiFi antenna 0 only */ 623 WIFI_ANT_MODE_ANT1, /**< Enable WiFi antenna 1 only */ 624 WIFI_ANT_MODE_AUTO, /**< Enable WiFi antenna 0 and 1, automatically select an antenna */ 625 WIFI_ANT_MODE_MAX, /**< Invalid WiFi enabled antenna */ 626 } wifi_ant_mode_t; 627 628 /** 629 * @brief WiFi antenna configuration 630 * 631 */ 632 typedef struct { 633 wifi_ant_mode_t rx_ant_mode; /**< WiFi antenna mode for receiving */ 634 wifi_ant_t rx_ant_default; /**< Default antenna mode for receiving, it's ignored if rx_ant_mode is not WIFI_ANT_MODE_AUTO */ 635 wifi_ant_mode_t tx_ant_mode; /**< WiFi antenna mode for transmission, it can be set to WIFI_ANT_MODE_AUTO only if rx_ant_mode is set to WIFI_ANT_MODE_AUTO */ 636 uint8_t enabled_ant0: 4, /**< Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT0 */ 637 enabled_ant1: 4; /**< Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT1 */ 638 } wifi_ant_config_t; 639 640 /** 641 * @brief The Rx callback function of Action Tx operations 642 * 643 * @param hdr pointer to the IEEE 802.11 Header structure 644 * @param payload pointer to the Payload following 802.11 Header 645 * @param len length of the Payload 646 * @param channel channel number the frame is received on 647 * 648 */ 649 typedef int (* wifi_action_rx_cb_t)(uint8_t *hdr, uint8_t *payload, 650 size_t len, uint8_t channel); 651 652 /** 653 * @brief Action Frame Tx Request 654 * 655 * 656 */ 657 typedef struct { 658 wifi_interface_t ifx; /**< WiFi interface to send request to */ 659 uint8_t dest_mac[6]; /**< Destination MAC address */ 660 bool no_ack; /**< Indicates no ack required */ 661 wifi_action_rx_cb_t rx_cb; /**< Rx Callback to receive any response */ 662 uint32_t data_len; /**< Length of the appended Data */ 663 uint8_t data[0]; /**< Appended Data payload */ 664 } wifi_action_tx_req_t; 665 666 /** 667 * @brief FTM Initiator configuration 668 * 669 */ 670 typedef struct { 671 uint8_t resp_mac[6]; /**< MAC address of the FTM Responder */ 672 uint8_t channel; /**< Primary channel of the FTM Responder */ 673 uint8_t frm_count; /**< No. of FTM frames requested in terms of 4 or 8 bursts (allowed values - 0(No pref), 16, 24, 32, 64) */ 674 uint16_t burst_period; /**< Requested period between FTM bursts in 100's of milliseconds (allowed values 0(No pref) - 100) */ 675 bool use_get_report_api; /**< True - Using esp_wifi_ftm_get_report to get FTM report, False - Using ftm_report_data from 676 WIFI_EVENT_FTM_REPORT to get FTM report */ 677 } wifi_ftm_initiator_cfg_t; 678 679 /** 680 * @brief WiFi beacon monitor parameter configuration 681 * 682 */ 683 typedef struct { 684 bool enable; /**< Enable or disable beacon monitor */ 685 uint8_t loss_timeout; /**< Beacon lost timeout */ 686 uint8_t loss_threshold; /**< Maximum number of consecutive lost beacons allowed */ 687 uint8_t delta_intr_early; /**< Delta early time for RF PHY on */ 688 uint8_t delta_loss_timeout; /**< Delta timeout time for RF PHY off */ 689 #if MAC_SUPPORT_PMU_MODEM_STATE 690 uint8_t beacon_abort: 1, /**< Enable or disable beacon abort */ 691 broadcast_wakeup: 1, /**< Enable or disable TIM element multicast wakeup */ 692 reserved: 6; /**< Reserved */ 693 uint8_t tsf_time_sync_deviation; /**< Deviation range to sync with AP TSF timestamp */ 694 uint16_t modem_state_consecutive; /**< PMU MODEM state consecutive count limit */ 695 uint16_t rf_ctrl_wait_cycle; /**< RF on wait time (unit: Modem APB clock cycle) */ 696 #endif 697 } wifi_beacon_monitor_config_t; 698 699 #define ESP_WIFI_NAN_MAX_SVC_SUPPORTED 2 700 #define ESP_WIFI_NAN_DATAPATH_MAX_PEERS 2 701 702 #define ESP_WIFI_NDP_ROLE_INITIATOR 1 703 #define ESP_WIFI_NDP_ROLE_RESPONDER 2 704 705 #define ESP_WIFI_MAX_SVC_NAME_LEN 256 706 #define ESP_WIFI_MAX_FILTER_LEN 256 707 #define ESP_WIFI_MAX_SVC_INFO_LEN 64 708 709 /** 710 * @brief NAN Services types 711 * 712 */ 713 typedef enum { 714 NAN_PUBLISH_SOLICITED, /**< Send unicast Publish frame to Subscribers that match the requirement */ 715 NAN_PUBLISH_UNSOLICITED,/**< Send broadcast Publish frames in every Discovery Window(DW) */ 716 NAN_SUBSCRIBE_ACTIVE, /**< Send broadcast Subscribe frames in every DW */ 717 NAN_SUBSCRIBE_PASSIVE, /**< Passively listens to Publish frames */ 718 } wifi_nan_service_type_t; 719 720 /** 721 * @brief NAN Publish service configuration parameters 722 * 723 */ 724 typedef struct { 725 char service_name[ESP_WIFI_MAX_SVC_NAME_LEN]; /**< Service name identifier */ 726 wifi_nan_service_type_t type; /**< Service type */ 727 char matching_filter[ESP_WIFI_MAX_FILTER_LEN]; /**< Comma separated filters for filtering services */ 728 char svc_info[ESP_WIFI_MAX_SVC_INFO_LEN]; /**< Service info shared in Publish frame */ 729 uint8_t single_replied_event:1; /**< Give single Replied event or every time */ 730 uint8_t datapath_reqd:1; /**< NAN Datapath required for the service */ 731 uint8_t reserved:6; /**< Reserved */ 732 } wifi_nan_publish_cfg_t; 733 734 /** 735 * @brief NAN Subscribe service configuration parameters 736 * 737 */ 738 typedef struct { 739 char service_name[ESP_WIFI_MAX_SVC_NAME_LEN]; /**< Service name identifier */ 740 wifi_nan_service_type_t type; /**< Service type */ 741 char matching_filter[ESP_WIFI_MAX_FILTER_LEN]; /**< Comma separated filters for filtering services */ 742 char svc_info[ESP_WIFI_MAX_SVC_INFO_LEN]; /**< Service info shared in Subscribe frame */ 743 uint8_t single_match_event:1; /**< Give single Match event or every time */ 744 uint8_t reserved:7; /**< Reserved */ 745 } wifi_nan_subscribe_cfg_t; 746 747 /** 748 * @brief NAN Follow-up parameters 749 * 750 */ 751 typedef struct { 752 uint8_t inst_id; /**< Own service instance id */ 753 uint8_t peer_inst_id; /**< Peer's service instance id */ 754 uint8_t peer_mac[6]; /**< Peer's MAC address */ 755 char svc_info[ESP_WIFI_MAX_SVC_INFO_LEN];/**< Service info(or message) to be shared */ 756 } wifi_nan_followup_params_t; 757 758 /** 759 * @brief NAN Datapath Request parameters 760 * 761 */ 762 typedef struct { 763 uint8_t pub_id; /**< Publisher's service instance id */ 764 uint8_t peer_mac[6]; /**< Peer's MAC address */ 765 bool confirm_required; /**< NDP Confirm frame required */ 766 } wifi_nan_datapath_req_t; 767 768 /** 769 * @brief NAN Datapath Response parameters 770 * 771 */ 772 typedef struct { 773 bool accept; /**< True - Accept incoming NDP, False - Reject it */ 774 uint8_t ndp_id; /**< NAN Datapath Identifier */ 775 uint8_t peer_mac[6]; /**< Peer's MAC address */ 776 } wifi_nan_datapath_resp_t; 777 778 /** 779 * @brief NAN Datapath End parameters 780 * 781 */ 782 typedef struct { 783 uint8_t ndp_id; /**< NAN Datapath Identifier */ 784 uint8_t peer_mac[6]; /**< Peer's MAC address */ 785 } wifi_nan_datapath_end_req_t; 786 787 /** 788 * @brief WiFi PHY rate encodings 789 * 790 */ 791 typedef enum { 792 WIFI_PHY_RATE_1M_L = 0x00, /**< 1 Mbps with long preamble */ 793 WIFI_PHY_RATE_2M_L = 0x01, /**< 2 Mbps with long preamble */ 794 WIFI_PHY_RATE_5M_L = 0x02, /**< 5.5 Mbps with long preamble */ 795 WIFI_PHY_RATE_11M_L = 0x03, /**< 11 Mbps with long preamble */ 796 WIFI_PHY_RATE_2M_S = 0x05, /**< 2 Mbps with short preamble */ 797 WIFI_PHY_RATE_5M_S = 0x06, /**< 5.5 Mbps with short preamble */ 798 WIFI_PHY_RATE_11M_S = 0x07, /**< 11 Mbps with short preamble */ 799 WIFI_PHY_RATE_48M = 0x08, /**< 48 Mbps */ 800 WIFI_PHY_RATE_24M = 0x09, /**< 24 Mbps */ 801 WIFI_PHY_RATE_12M = 0x0A, /**< 12 Mbps */ 802 WIFI_PHY_RATE_6M = 0x0B, /**< 6 Mbps */ 803 WIFI_PHY_RATE_54M = 0x0C, /**< 54 Mbps */ 804 WIFI_PHY_RATE_36M = 0x0D, /**< 36 Mbps */ 805 WIFI_PHY_RATE_18M = 0x0E, /**< 18 Mbps */ 806 WIFI_PHY_RATE_9M = 0x0F, /**< 9 Mbps */ 807 /**< rate table and guard interval information for each MCS rate*/ 808 /* 809 ----------------------------------------------------------------------------------------------------------- 810 MCS RATE | HT20 | HT40 | HE20 | 811 WIFI_PHY_RATE_MCS0_LGI | 6.5 Mbps (800ns) | 13.5 Mbps (800ns) | 8.1 Mbps (1600ns) | 812 WIFI_PHY_RATE_MCS1_LGI | 13 Mbps (800ns) | 27 Mbps (800ns) | 16.3 Mbps (1600ns) | 813 WIFI_PHY_RATE_MCS2_LGI | 19.5 Mbps (800ns) | 40.5 Mbps (800ns) | 24.4 Mbps (1600ns) | 814 WIFI_PHY_RATE_MCS3_LGI | 26 Mbps (800ns) | 54 Mbps (800ns) | 32.5 Mbps (1600ns) | 815 WIFI_PHY_RATE_MCS4_LGI | 39 Mbps (800ns) | 81 Mbps (800ns) | 48.8 Mbps (1600ns) | 816 WIFI_PHY_RATE_MCS5_LGI | 52 Mbps (800ns) | 108 Mbps (800ns) | 65 Mbps (1600ns) | 817 WIFI_PHY_RATE_MCS6_LGI | 58.5 Mbps (800ns) | 121.5 Mbps (800ns) | 73.1 Mbps (1600ns) | 818 WIFI_PHY_RATE_MCS7_LGI | 65 Mbps (800ns) | 135 Mbps (800ns) | 81.3 Mbps (1600ns) | 819 WIFI_PHY_RATE_MCS8_LGI | ----- | ----- | 97.5 Mbps (1600ns) | 820 WIFI_PHY_RATE_MCS9_LGI | ----- | ----- | 108.3 Mbps (1600ns) | 821 ----------------------------------------------------------------------------------------------------------- 822 */ 823 WIFI_PHY_RATE_MCS0_LGI = 0x10, /**< MCS0 with long GI */ 824 WIFI_PHY_RATE_MCS1_LGI = 0x11, /**< MCS1 with long GI */ 825 WIFI_PHY_RATE_MCS2_LGI = 0x12, /**< MCS2 with long GI */ 826 WIFI_PHY_RATE_MCS3_LGI = 0x13, /**< MCS3 with long GI */ 827 WIFI_PHY_RATE_MCS4_LGI = 0x14, /**< MCS4 with long GI */ 828 WIFI_PHY_RATE_MCS5_LGI = 0x15, /**< MCS5 with long GI */ 829 WIFI_PHY_RATE_MCS6_LGI = 0x16, /**< MCS6 with long GI */ 830 WIFI_PHY_RATE_MCS7_LGI = 0x17, /**< MCS7 with long GI */ 831 #if CONFIG_SOC_WIFI_HE_SUPPORT 832 WIFI_PHY_RATE_MCS8_LGI, /**< MCS8 with long GI */ 833 WIFI_PHY_RATE_MCS9_LGI, /**< MCS9 with long GI */ 834 #endif 835 /* 836 ----------------------------------------------------------------------------------------------------------- 837 MCS RATE | HT20 | HT40 | HE20 | 838 WIFI_PHY_RATE_MCS0_SGI | 7.2 Mbps (400ns) | 15 Mbps (400ns) | 8.6 Mbps (800ns) | 839 WIFI_PHY_RATE_MCS1_SGI | 14.4 Mbps (400ns) | 30 Mbps (400ns) | 17.2 Mbps (800ns) | 840 WIFI_PHY_RATE_MCS2_SGI | 21.7 Mbps (400ns) | 45 Mbps (400ns) | 25.8 Mbps (800ns) | 841 WIFI_PHY_RATE_MCS3_SGI | 28.9 Mbps (400ns) | 60 Mbps (400ns) | 34.4 Mbps (800ns) | 842 WIFI_PHY_RATE_MCS4_SGI | 43.3 Mbps (400ns) | 90 Mbps (400ns) | 51.6 Mbps (800ns) | 843 WIFI_PHY_RATE_MCS5_SGI | 57.8 Mbps (400ns) | 120 Mbps (400ns) | 68.8 Mbps (800ns) | 844 WIFI_PHY_RATE_MCS6_SGI | 65 Mbps (400ns) | 135 Mbps (400ns) | 77.4 Mbps (800ns) | 845 WIFI_PHY_RATE_MCS7_SGI | 72.2 Mbps (400ns) | 150 Mbps (400ns) | 86 Mbps (800ns) | 846 WIFI_PHY_RATE_MCS8_SGI | ----- | ----- | 103.2 Mbps (800ns) | 847 WIFI_PHY_RATE_MCS9_SGI | ----- | ----- | 114.7 Mbps (800ns) | 848 ----------------------------------------------------------------------------------------------------------- 849 */ 850 WIFI_PHY_RATE_MCS0_SGI, /**< MCS0 with short GI */ 851 WIFI_PHY_RATE_MCS1_SGI, /**< MCS1 with short GI */ 852 WIFI_PHY_RATE_MCS2_SGI, /**< MCS2 with short GI */ 853 WIFI_PHY_RATE_MCS3_SGI, /**< MCS3 with short GI */ 854 WIFI_PHY_RATE_MCS4_SGI, /**< MCS4 with short GI */ 855 WIFI_PHY_RATE_MCS5_SGI, /**< MCS5 with short GI */ 856 WIFI_PHY_RATE_MCS6_SGI, /**< MCS6 with short GI */ 857 WIFI_PHY_RATE_MCS7_SGI, /**< MCS7 with short GI */ 858 #if CONFIG_SOC_WIFI_HE_SUPPORT 859 WIFI_PHY_RATE_MCS8_SGI, /**< MCS8 with short GI */ 860 WIFI_PHY_RATE_MCS9_SGI, /**< MCS9 with short GI */ 861 #endif 862 WIFI_PHY_RATE_LORA_250K = 0x29, /**< 250 Kbps */ 863 WIFI_PHY_RATE_LORA_500K = 0x2A, /**< 500 Kbps */ 864 WIFI_PHY_RATE_MAX, 865 } wifi_phy_rate_t; 866 867 /** WiFi event declarations */ 868 typedef enum { 869 WIFI_EVENT_WIFI_READY = 0, /**< WiFi ready */ 870 WIFI_EVENT_SCAN_DONE, /**< Finished scanning AP */ 871 WIFI_EVENT_STA_START, /**< Station start */ 872 WIFI_EVENT_STA_STOP, /**< Station stop */ 873 WIFI_EVENT_STA_CONNECTED, /**< Station connected to AP */ 874 WIFI_EVENT_STA_DISCONNECTED, /**< Station disconnected from AP */ 875 WIFI_EVENT_STA_AUTHMODE_CHANGE, /**< the auth mode of AP connected by device's station changed */ 876 877 WIFI_EVENT_STA_WPS_ER_SUCCESS, /**< Station wps succeeds in enrollee mode */ 878 WIFI_EVENT_STA_WPS_ER_FAILED, /**< Station wps fails in enrollee mode */ 879 WIFI_EVENT_STA_WPS_ER_TIMEOUT, /**< Station wps timeout in enrollee mode */ 880 WIFI_EVENT_STA_WPS_ER_PIN, /**< Station wps pin code in enrollee mode */ 881 WIFI_EVENT_STA_WPS_ER_PBC_OVERLAP, /**< Station wps overlap in enrollee mode */ 882 883 WIFI_EVENT_AP_START, /**< Soft-AP start */ 884 WIFI_EVENT_AP_STOP, /**< Soft-AP stop */ 885 WIFI_EVENT_AP_STACONNECTED, /**< a station connected to Soft-AP */ 886 WIFI_EVENT_AP_STADISCONNECTED, /**< a station disconnected from Soft-AP */ 887 WIFI_EVENT_AP_PROBEREQRECVED, /**< Receive probe request packet in soft-AP interface */ 888 889 WIFI_EVENT_FTM_REPORT, /**< Receive report of FTM procedure */ 890 891 /* Add next events after this only */ 892 WIFI_EVENT_STA_BSS_RSSI_LOW, /**< AP's RSSI crossed configured threshold */ 893 WIFI_EVENT_ACTION_TX_STATUS, /**< Status indication of Action Tx operation */ 894 WIFI_EVENT_ROC_DONE, /**< Remain-on-Channel operation complete */ 895 896 WIFI_EVENT_STA_BEACON_TIMEOUT, /**< Station beacon timeout */ 897 898 WIFI_EVENT_CONNECTIONLESS_MODULE_WAKE_INTERVAL_START, /**< Connectionless module wake interval start */ 899 /* Add next events after this only */ 900 901 WIFI_EVENT_AP_WPS_RG_SUCCESS, /**< Soft-AP wps succeeds in registrar mode */ 902 WIFI_EVENT_AP_WPS_RG_FAILED, /**< Soft-AP wps fails in registrar mode */ 903 WIFI_EVENT_AP_WPS_RG_TIMEOUT, /**< Soft-AP wps timeout in registrar mode */ 904 WIFI_EVENT_AP_WPS_RG_PIN, /**< Soft-AP wps pin code in registrar mode */ 905 WIFI_EVENT_AP_WPS_RG_PBC_OVERLAP, /**< Soft-AP wps overlap in registrar mode */ 906 907 WIFI_EVENT_ITWT_SETUP, /**< iTWT setup */ 908 WIFI_EVENT_ITWT_TEARDOWN, /**< iTWT teardown */ 909 WIFI_EVENT_ITWT_PROBE, /**< iTWT probe */ 910 WIFI_EVENT_ITWT_SUSPEND, /**< iTWT suspend */ 911 WIFI_EVENT_TWT_WAKEUP, /**< TWT wakeup */ 912 913 WIFI_EVENT_NAN_STARTED, /**< NAN Discovery has started */ 914 WIFI_EVENT_NAN_STOPPED, /**< NAN Discovery has stopped */ 915 WIFI_EVENT_NAN_SVC_MATCH, /**< NAN Service Discovery match found */ 916 WIFI_EVENT_NAN_REPLIED, /**< Replied to a NAN peer with Service Discovery match */ 917 WIFI_EVENT_NAN_RECEIVE, /**< Received a Follow-up message */ 918 WIFI_EVENT_NDP_INDICATION, /**< Received NDP Request from a NAN Peer */ 919 WIFI_EVENT_NDP_CONFIRM, /**< NDP Confirm Indication */ 920 WIFI_EVENT_NDP_TERMINATED, /**< NAN Datapath terminated indication */ 921 922 WIFI_EVENT_MAX, /**< Invalid WiFi event ID */ 923 } wifi_event_t; 924 925 /** @cond **/ 926 /** @brief WiFi event base declaration */ 927 ESP_EVENT_DECLARE_BASE(WIFI_EVENT); 928 /** @endcond **/ 929 930 /** Argument structure for WIFI_EVENT_SCAN_DONE event */ 931 typedef struct { 932 uint32_t status; /**< status of scanning APs: 0 — success, 1 - failure */ 933 uint8_t number; /**< number of scan results */ 934 uint8_t scan_id; /**< scan sequence number, used for block scan */ 935 } wifi_event_sta_scan_done_t; 936 937 /** Argument structure for WIFI_EVENT_STA_CONNECTED event */ 938 typedef struct { 939 uint8_t ssid[32]; /**< SSID of connected AP */ 940 uint8_t ssid_len; /**< SSID length of connected AP */ 941 uint8_t bssid[6]; /**< BSSID of connected AP*/ 942 uint8_t channel; /**< channel of connected AP*/ 943 wifi_auth_mode_t authmode;/**< authentication mode used by AP*/ 944 uint16_t aid; /**< authentication id assigned by the connected AP */ 945 } wifi_event_sta_connected_t; 946 947 /** Argument structure for WIFI_EVENT_STA_DISCONNECTED event */ 948 typedef struct { 949 uint8_t ssid[32]; /**< SSID of disconnected AP */ 950 uint8_t ssid_len; /**< SSID length of disconnected AP */ 951 uint8_t bssid[6]; /**< BSSID of disconnected AP */ 952 uint8_t reason; /**< reason of disconnection */ 953 int8_t rssi; /**< rssi of disconnection */ 954 } wifi_event_sta_disconnected_t; 955 956 /** Argument structure for WIFI_EVENT_STA_AUTHMODE_CHANGE event */ 957 typedef struct { 958 wifi_auth_mode_t old_mode; /**< the old auth mode of AP */ 959 wifi_auth_mode_t new_mode; /**< the new auth mode of AP */ 960 } wifi_event_sta_authmode_change_t; 961 962 /** Argument structure for WIFI_EVENT_STA_WPS_ER_PIN event */ 963 typedef struct { 964 uint8_t pin_code[8]; /**< PIN code of station in enrollee mode */ 965 } wifi_event_sta_wps_er_pin_t; 966 967 /** Argument structure for WIFI_EVENT_STA_WPS_ER_FAILED event */ 968 typedef enum { 969 WPS_FAIL_REASON_NORMAL = 0, /**< WPS normal fail reason */ 970 WPS_FAIL_REASON_RECV_M2D, /**< WPS receive M2D frame */ 971 WPS_FAIL_REASON_RECV_DEAUTH, /**< Recv deauth from AP while wps handshake */ 972 WPS_FAIL_REASON_MAX 973 } wifi_event_sta_wps_fail_reason_t; 974 975 #define MAX_SSID_LEN 32 976 #define MAX_PASSPHRASE_LEN 64 977 #define MAX_WPS_AP_CRED 3 978 979 /** Argument structure for WIFI_EVENT_STA_WPS_ER_SUCCESS event */ 980 typedef struct { 981 uint8_t ap_cred_cnt; /**< Number of AP credentials received */ 982 struct { 983 uint8_t ssid[MAX_SSID_LEN]; /**< SSID of AP */ 984 uint8_t passphrase[MAX_PASSPHRASE_LEN]; /**< Passphrase for the AP */ 985 } ap_cred[MAX_WPS_AP_CRED]; /**< All AP credentials received from WPS handshake */ 986 } wifi_event_sta_wps_er_success_t; 987 988 /** Argument structure for WIFI_EVENT_AP_STACONNECTED event */ 989 typedef struct { 990 uint8_t mac[6]; /**< MAC address of the station connected to Soft-AP */ 991 uint8_t aid; /**< the aid that soft-AP gives to the station connected to */ 992 bool is_mesh_child; /**< flag to identify mesh child */ 993 } wifi_event_ap_staconnected_t; 994 995 /** Argument structure for WIFI_EVENT_AP_STADISCONNECTED event */ 996 typedef struct { 997 uint8_t mac[6]; /**< MAC address of the station disconnects to soft-AP */ 998 uint8_t aid; /**< the aid that soft-AP gave to the station disconnects to */ 999 bool is_mesh_child; /**< flag to identify mesh child */ 1000 uint8_t reason; /**< reason of disconnection */ 1001 } wifi_event_ap_stadisconnected_t; 1002 1003 /** Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event */ 1004 typedef struct { 1005 int rssi; /**< Received probe request signal strength */ 1006 uint8_t mac[6]; /**< MAC address of the station which send probe request */ 1007 } wifi_event_ap_probe_req_rx_t; 1008 1009 /** Argument structure for WIFI_EVENT_STA_BSS_RSSI_LOW event */ 1010 typedef struct { 1011 int32_t rssi; /**< RSSI value of bss */ 1012 } wifi_event_bss_rssi_low_t; 1013 1014 /** 1015 * @brief FTM operation status types 1016 * 1017 */ 1018 typedef enum { 1019 FTM_STATUS_SUCCESS = 0, /**< FTM exchange is successful */ 1020 FTM_STATUS_UNSUPPORTED, /**< Peer does not support FTM */ 1021 FTM_STATUS_CONF_REJECTED, /**< Peer rejected FTM configuration in FTM Request */ 1022 FTM_STATUS_NO_RESPONSE, /**< Peer did not respond to FTM Requests */ 1023 FTM_STATUS_FAIL, /**< Unknown error during FTM exchange */ 1024 FTM_STATUS_NO_VALID_MSMT, /**< FTM session did not result in any valid measurements */ 1025 FTM_STATUS_USER_TERM, /**< User triggered termination */ 1026 } wifi_ftm_status_t; 1027 1028 /** Argument structure for */ 1029 typedef struct { 1030 uint8_t dlog_token; /**< Dialog Token of the FTM frame */ 1031 int8_t rssi; /**< RSSI of the FTM frame received */ 1032 uint32_t rtt; /**< Round Trip Time in pSec with a peer */ 1033 uint64_t t1; /**< Time of departure of FTM frame from FTM Responder in pSec */ 1034 uint64_t t2; /**< Time of arrival of FTM frame at FTM Initiator in pSec */ 1035 uint64_t t3; /**< Time of departure of ACK from FTM Initiator in pSec */ 1036 uint64_t t4; /**< Time of arrival of ACK at FTM Responder in pSec */ 1037 } wifi_ftm_report_entry_t; 1038 1039 /** Argument structure for WIFI_EVENT_FTM_REPORT event */ 1040 typedef struct { 1041 uint8_t peer_mac[6]; /**< MAC address of the FTM Peer */ 1042 wifi_ftm_status_t status; /**< Status of the FTM operation */ 1043 uint32_t rtt_raw; /**< Raw average Round-Trip-Time with peer in Nano-Seconds */ 1044 uint32_t rtt_est; /**< Estimated Round-Trip-Time with peer in Nano-Seconds */ 1045 uint32_t dist_est; /**< Estimated one-way distance in Centi-Meters */ 1046 wifi_ftm_report_entry_t *ftm_report_data; /**< Pointer to FTM Report, should be freed after use. Note: Highly recommended 1047 to use API esp_wifi_ftm_get_report to get the report instead of using this */ 1048 uint8_t ftm_report_num_entries; /**< Number of entries in the FTM Report data */ 1049 } wifi_event_ftm_report_t; 1050 1051 #define WIFI_STATIS_BUFFER (1<<0) 1052 #define WIFI_STATIS_RXTX (1<<1) 1053 #define WIFI_STATIS_HW (1<<2) 1054 #define WIFI_STATIS_DIAG (1<<3) 1055 #define WIFI_STATIS_PS (1<<4) 1056 #define WIFI_STATIS_ALL (-1) 1057 1058 /** Argument structure for WIFI_EVENT_ACTION_TX_STATUS event */ 1059 typedef struct { 1060 wifi_interface_t ifx; /**< WiFi interface to send request to */ 1061 uint32_t context; /**< Context to identify the request */ 1062 uint8_t da[6]; /**< Destination MAC address */ 1063 uint8_t status; /**< Status of the operation */ 1064 } wifi_event_action_tx_status_t; 1065 1066 /** Argument structure for WIFI_EVENT_ROC_DONE event */ 1067 typedef struct { 1068 uint32_t context; /**< Context to identify the request */ 1069 } wifi_event_roc_done_t; 1070 1071 /** Argument structure for WIFI_EVENT_AP_WPS_RG_PIN event */ 1072 typedef struct { 1073 uint8_t pin_code[8]; /**< PIN code of station in enrollee mode */ 1074 } wifi_event_ap_wps_rg_pin_t; 1075 1076 typedef enum { 1077 WPS_AP_FAIL_REASON_NORMAL = 0, /**< WPS normal fail reason */ 1078 WPS_AP_FAIL_REASON_CONFIG, /**< WPS failed due to incorrect config */ 1079 WPS_AP_FAIL_REASON_AUTH, /**< WPS failed during auth */ 1080 WPS_AP_FAIL_REASON_MAX, 1081 } wps_fail_reason_t; 1082 1083 /** Argument structure for WIFI_EVENT_AP_WPS_RG_FAILED event */ 1084 typedef struct { 1085 wps_fail_reason_t reason; /**< WPS failure reason wps_fail_reason_t */ 1086 uint8_t peer_macaddr[6]; /**< Enrollee mac address */ 1087 } wifi_event_ap_wps_rg_fail_reason_t; 1088 1089 /** Argument structure for WIFI_EVENT_AP_WPS_RG_SUCCESS event */ 1090 typedef struct { 1091 uint8_t peer_macaddr[6]; /**< Enrollee mac address */ 1092 } wifi_event_ap_wps_rg_success_t; 1093 1094 /** Argument structure for WIFI_EVENT_NAN_SVC_MATCH event */ 1095 typedef struct { 1096 uint8_t subscribe_id; /**< Subscribe Service Identifier */ 1097 uint8_t publish_id; /**< Publish Service Identifier */ 1098 uint8_t pub_if_mac[6]; /**< NAN Interface MAC of the Publisher */ 1099 bool update_pub_id; /**< Indicates whether publisher's service ID needs to be updated */ 1100 } wifi_event_nan_svc_match_t; 1101 1102 /** Argument structure for WIFI_EVENT_NAN_REPLIED event */ 1103 typedef struct { 1104 uint8_t publish_id; /**< Publish Service Identifier */ 1105 uint8_t subscribe_id; /**< Subscribe Service Identifier */ 1106 uint8_t sub_if_mac[6]; /**< NAN Interface MAC of the Subscriber */ 1107 } wifi_event_nan_replied_t; 1108 1109 /** Argument structure for WIFI_EVENT_NAN_RECEIVE event */ 1110 typedef struct { 1111 uint8_t inst_id; /**< Our Service Identifier */ 1112 uint8_t peer_inst_id; /**< Peer's Service Identifier */ 1113 uint8_t peer_if_mac[6]; /**< Peer's NAN Interface MAC */ 1114 uint8_t peer_svc_info[ESP_WIFI_MAX_SVC_INFO_LEN];/**< Peer Service Info */ 1115 } wifi_event_nan_receive_t; 1116 1117 /** Argument structure for WIFI_EVENT_NDP_INDICATION event */ 1118 typedef struct { 1119 uint8_t publish_id; /**< Publish Id for NAN Service */ 1120 uint8_t ndp_id; /**< NDP instance id */ 1121 uint8_t peer_nmi[6]; /**< Peer's NAN Management Interface MAC */ 1122 uint8_t peer_ndi[6]; /**< Peer's NAN Data Interface MAC */ 1123 uint8_t svc_info[ESP_WIFI_MAX_SVC_INFO_LEN];/**< Service Specific Info */ 1124 } wifi_event_ndp_indication_t; 1125 1126 /** Argument structure for WIFI_EVENT_NDP_CONFIRM event */ 1127 typedef struct { 1128 uint8_t status; /**< NDP status code */ 1129 uint8_t ndp_id; /**< NDP instance id */ 1130 uint8_t peer_nmi[6]; /**< Peer's NAN Management Interface MAC */ 1131 uint8_t peer_ndi[6]; /**< Peer's NAN Data Interface MAC */ 1132 uint8_t own_ndi[6]; /**< Own NAN Data Interface MAC */ 1133 uint8_t svc_info[ESP_WIFI_MAX_SVC_INFO_LEN];/**< Service Specific Info */ 1134 } wifi_event_ndp_confirm_t; 1135 1136 /** Argument structure for WIFI_EVENT_NDP_TERMINATED event */ 1137 typedef struct { 1138 uint8_t reason; /**< Termination reason code */ 1139 uint8_t ndp_id; /**< NDP instance id */ 1140 uint8_t init_ndi[6]; /**< Initiator's NAN Data Interface MAC */ 1141 } wifi_event_ndp_terminated_t; 1142 1143 /** 1144 * @brief Argument structure for wifi_tx_rate_config 1145 */ 1146 typedef struct { 1147 wifi_phy_mode_t phymode; /**< Phymode of specified interface */ 1148 wifi_phy_rate_t rate; /**< Rate of specified interface */ 1149 bool ersu; /**< Using ERSU to send frame, ERSU is a transmission mode related to 802.11 ax. 1150 ERSU is always used in long distance transmission, and its frame has lower rate compared with SU mode */ 1151 bool dcm; /**< Using dcm rate to send frame */ 1152 } wifi_tx_rate_config_t; 1153 1154 #ifdef __cplusplus 1155 } 1156 #endif 1157 1158 #endif /* __ESP_WIFI_TYPES_H__ */ 1159