1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: wifi_device_config.h 的头文件 15 */ 16 17 18 /** 19 * @defgroup middleware_service_wifi_device_config WiFi Device Config 20 * @ingroup middleware_service_wifi 21 * @{ 22 */ 23 #include <stdint.h> 24 25 #ifndef SERVICE_WIFI_DEVICE_CONFIG_H 26 #define SERVICE_WIFI_DEVICE_CONFIG_H 27 28 #ifdef __cplusplus 29 #if __cplusplus 30 extern "C" { 31 #endif 32 #endif 33 34 /** 35 * @if Eng 36 * @brief the maximum length of a WiFi SSID.The maximum length is 32, and the last bit is reserved and set to '\\0'. 37 * @else 38 * @brief 表示WiFi SSID的最大长度,最大长度为32,最后一位保留,设置为'\\0'。 39 * @endif 40 */ 41 #define WIFI_MAX_SSID_LEN 33 // 32 + \0 42 43 /** 44 * @if Eng 45 * @brief the maximum length of a WiFi key.The maximum length is 64, and the last bit is reserved and set to '\\0'. 46 * @else 47 * @brief 表示WiFi key的最大长度,最大长度为64,最后一位保留,设置为'\\0'。 48 * @endif 49 */ 50 #define WIFI_MAX_KEY_LEN 65 // 64 + \0 51 52 /** 53 * @if Eng 54 * @brief The maximum length of a WiFi PSK. 55 * @else 56 * @brief WiFi PSK的最大长度。 57 * @endif 58 */ 59 #define WIFI_PSK_LEN 32 60 61 /** 62 * @if Eng 63 * @brief Indicates the maximum length of a Wi-Fi MAC address or a WiFi BSSID. 64 * @else 65 * @brief 表示Wi-Fi MAC地址或者WiFi BSSID的最大长度。 66 * @endif 67 */ 68 #define WIFI_MAC_LEN 6 69 70 /** 71 * @if Eng 72 * @brief Indicates the maximum number of DNS servers, A maximum of two DNS servers are allowed. 73 * @else 74 * @brief DNS服务器的最大数量,最多允许两个DNS服务器。 75 * @endif 76 */ 77 #define WIFI_MAX_DNS_NUM 2 78 79 /** 80 * @if Eng 81 * @brief Indicates the maximum length of a WiFi WPS PIN. 82 * The maximum length is 8,and the last bit is reserved and set to '\0'. 83 * @else 84 * @brief 表示WiFi WPS PIN的最大长度,最大长度为8,最后一位保留,设置为'\0'。 85 * @endif 86 */ 87 #define WIFI_WPS_PIN_MAX_LEN_NUM 9 88 89 /** 90 * @if Eng 91 * @brief Indicates the length of IPV6 address. 92 * @else 93 * @brief IPV6地址长度。 94 * @endif 95 */ 96 #define WIFI_IPV6_ADDR_LEN 16 97 98 /** 99 * @if Eng 100 * @brief Indicates the length of IPV6 DNS. 101 * @else 102 * @brief IPV6 DNS的长度。 103 * @endif 104 */ 105 #define WIFI_IPV6_DNS_LEN 16 106 107 /** 108 * @if Eng 109 * @brief Indicates the max length of interiface name. 110 * @else 111 * @brief 网络接口名最大长度。 112 * @endif 113 */ 114 #define WIFI_IFNAME_MAX_SIZE 16 115 116 /** 117 * @if Eng 118 * @brief CSI data report callback. 119 * @param [in] csi_data 4 bytes extend timestamp + 758 bytes 64bit big endian data. 120 * @param [in] len data length. 121 * @retval void 122 * @else 123 * @brief 用户注册的回调函数,用于处理CSI上报的数据。 124 * @param [in] csi_data 4字节扩展时间戳+758字节64位小端存储格式的CSI数据. 125 * @param [in] len 数据长度,固定为762字节。 126 * @retval void 127 * @endif 128 */ 129 typedef void (*wifi_csi_data_cb)(uint8_t *csi_data, int32_t len); 130 131 /** 132 * @if Eng 133 * @brief callback function definition of monitor mode. 134 * @param [in] recv_buf frame data. 135 * @param [in] frame_len frame len. 136 * @param [in] rssi rssi. 137 * @retval ERRCODE_SUCC Execute successfully. 138 * @retval Other Execute failed. 139 * @else 140 * @brief 混杂模式收包回调接口定义。 141 * @param [in] recv_buf 帧数据。 142 * @param [in] frame_len 帧长度。 143 * @param [in] rssi 信号强度。 144 * @retval ERRCODE_SUCC 成功。 145 * @retval Other 失败。 146 * @endif 147 */ 148 typedef int32_t (*wifi_promis_cb)(void* recv_buf, int32_t frame_len, int8_t rssi); 149 150 /** 151 * @if Eng 152 * @brief callback function definition of management frame report. 153 * @param [in] recv_buf frame data. 154 * @param [in] frame_len frame len. 155 * @param [in] rssi rssi. 156 * @retval ERRCODE_SUCC Execute successfully. 157 * @retval Other Execute failed. 158 * @else 159 * @brief 管理帧收包回调接口定义。 160 * @param [in] recv_buf 帧数据。 161 * @param [in] frame_len 帧长度。 162 * @param [in] rssi 信号强度。 163 * @retval ERRCODE_SUCC 成功。 164 * @retval Other 失败。 165 * @endif 166 */ 167 typedef int32_t (*wifi_rx_mgmt_cb)(void* recv_buf, int32_t frame_len, int8_t rssi); 168 169 /** 170 * @if Eng 171 * @brief callback function definition of psd. 172 * @param [in] recv_buf psd data. 173 * @param [in] data_len psd data len. 174 * @retval ERRCODE_SUCC Execute successfully. 175 * @retval Other Execute failed. 176 * @else 177 * @brief PSD数据上报回调接口定义。 178 * @param [in] recv_buf psd 数据。 179 * @param [in] data_len psd数据长度。 180 * @retval ERRCODE_SUCC 成功。 181 * @retval Other 失败。 182 * @endif 183 */ 184 typedef int32_t (*wifi_psd_cb)(void *recv_buf, uint32_t data_len); 185 186 /** 187 * @if Eng 188 * @brief Type of Psk. 189 * @else 190 * @brief Psk的类型。 191 * @endif 192 */ 193 typedef enum { 194 WIFI_WPA_PSK_NOT_USE, /*!< @if Eng The PSK does not need to be calculated in advance. 195 In this case, the PSK in wifi_fast_connect_stru is not used. 196 @else 不用提前计算PSK,本情况下不使用wifi_fast_connect_stru中的psk。 @endif */ 197 } wifi_wpa_psk_type_enum; 198 199 /** 200 * @if Eng 201 * @brief PMF type enum. 202 * @else 203 * @brief PMF管理帧保护模式类型。 204 * @endif 205 */ 206 typedef enum { 207 WIFI_MGMT_FRAME_PROTECTION_CLOSE, /*!< @if Eng Disable. 208 @else 管理帧保护模式:关闭。 @endif */ 209 WIFI_MGMT_FRAME_PROTECTION_OPTIONAL, /*!< @if Eng OPTIONAL. 210 @else 管理帧保护模式:可选。 @endif */ 211 WIFI_MGMT_FRAME_PROTECTION_REQUIRED, /*!< @if Eng REQUIRED. 212 @else 管理帧保护模式:必须。 @endif */ 213 WIFI_MGMT_FRAME_PROTECTION_BUTT 214 } wifi_pmf_option_enum; 215 216 /** 217 * @if Eng 218 * @brief Type of WiFi interface. 219 * @else 220 * @brief Type of WiFi interface。 221 * @endif 222 */ 223 typedef enum { 224 IFTYPE_STA, /*!< @if Eng STAION. 225 @else STAION。 @endif */ 226 IFTYPE_AP, /*!< @if Eng HOTSPOT. 227 @else HOTSPOT。 @endif */ 228 IFTYPE_P2P_CLIENT, /*!< @if Eng P2P CLIENT. 229 @else P2P CLIENT。 @endif */ 230 IFTYPE_P2P_GO, /*!< @if Eng P2P GO. 231 @else P2P GO。 @endif */ 232 IFTYPE_P2P_DEVICE, /*!< @if Eng P2P DEVICE. 233 @else P2P DEVICE。 @endif */ 234 IFTYPES_BUTT 235 } wifi_if_type_enum; 236 237 /** 238 * @if Eng 239 * @brief Ie index, there are four indexes to choose. 240 * @else 241 * @brief ie索引,有四个索引可供选择。 242 * @endif 243 */ 244 typedef enum ie_index_enmu { 245 IE_FIRST, /*!< @if Eng Index 1. 246 @else 索引 1。 @endif */ 247 IE_SECOND, /*!< @if Eng Index 2. 248 @else 索引 2。 @endif */ 249 IE_THIRD, /*!< @if Eng Index 3. 250 @else 索引 3。 @endif */ 251 IE_FORTH, /*!< @if Eng Index 4. 252 @else 索引 4。 @endif */ 253 IE_BUTT 254 } ie_index_enmu; 255 256 /** 257 * @if Eng 258 * @brief Struct of psd param. 259 * @else 260 * @brief 设置psd状态。 261 * @endif 262 */ 263 typedef struct { 264 uint8_t enable; /*!< @if Eng enable. 265 @else PSD使能标记 0关1开。 @endif */ 266 uint8_t resv; 267 uint16_t duration; /*!< @if Eng duration. 268 @else 采样时长 取值1~65535单位min。 @endif */ 269 uint32_t cycle; /*!< @if Eng cycle. 270 @else 采样间隔 单位ms;取值100~1000。 @endif */ 271 } ext_psd_option_param; 272 273 /** 274 * @if Eng 275 * @brief Enumeration of WiFi security types. 276 * @else 277 * @brief WiFi安全类型的枚举。 278 * @endif 279 */ 280 typedef enum wifi_security_enum { 281 WIFI_SEC_TYPE_INVALID = -1, /*!< @if Eng Invalid security type. 282 @else 无效安全类型. @endif */ 283 WIFI_SEC_TYPE_OPEN, /*!< @if Eng Open. 284 @else Open。 @endif */ 285 WIFI_SEC_TYPE_WEP, /*!< @if Eng Wired Equivalent Privacy SHARED system (WEP-SHARED). 286 @else WEP。 @endif */ 287 WIFI_SEC_TYPE_WPA2PSK, /*!< @if Eng WPA2-Personal. 288 @else WPA2 个人级。 @endif */ 289 WIFI_SEC_TYPE_WPA2_WPA_PSK_MIX, /*!< @if Eng WPA-Personal and WPA2-Personal mixed. 290 @else 个人级的WPA和WPA2混合。 @endif */ 291 WIFI_SEC_TYPE_WPAPSK, /*!< @if Eng WPA-Personal. 292 @else WPA 个人级。 @endif */ 293 WIFI_SEC_TYPE_WPA, /*!< @if Eng WPA-Enterprise. 294 @else WPA 企业级。 @endif */ 295 WIFI_SEC_TYPE_WPA2, /*!< @if Eng WPA2-Enterprise. 296 @else WPA2 企业级。 @endif */ 297 WIFI_SEC_TYPE_SAE, /*!< @if Eng Simultaneous Authentication of Equals (SAE). 298 @else SAE(WPA3个人级)。 @endif */ 299 WIFI_SEC_TYPE_WPA3_WPA2_PSK_MIX, /*!< @if Eng WPA2-Personal and WPA3-Personal mixed. 300 @else 个人级的WPA2和WPA3混合。 @endif */ 301 WIFI_SEC_TYPE_WPA3, /*!< @if Eng WPA3-Enterprise. 302 @else WPA3 企业级。 @endif */ 303 WIFI_SEC_TYPE_OWE, /*!< @if Eng Opportunistic wireless encryption(OWE). 304 @else OWE。 @endif */ 305 WIFI_SEC_TYPE_WAPI_PSK, /*!< @if Eng WAPI Personal. 306 @else WAPI 个人级。 @endif */ 307 WIFI_SEC_TYPE_WAPI_CERT, /*!< @if Eng WAPI Enterprise. 308 @else WAPI 企业级。 @endif */ 309 WIFI_SEC_TYPE_WPA3_WPA2_MIX, /*!< @if Eng WPA2-Enterprise and WPA3-Enterprise mixed. 310 @else 企业级的WPA2和WPA3混合。 @endif */ 311 WIFI_SEC_TYPE_WEP_OPEN, /*!< @if Eng Wired Equivalent Privacy OPEN system (WEP-OPEN). 312 @else WEP-OPEN。 @endif */ 313 WIFI_SEC_TYPE_UNKNOWN /*!< @if Eng Other certification types. 314 @else 其它认证类型。 @endif */ 315 } wifi_security_enum; 316 317 /** 318 * @if Eng 319 * @brief Type of WiFi interface. 320 * @else 321 * @brief Type of WiFi interface。 322 * @endif 323 */ 324 typedef enum { 325 WIFI_IFTYPE_UNSPECIFIED, /*!< @if Eng UNSPECIFIED. 326 @else UNSPECIFIED @endif */ 327 WIFI_IFTYPE_ADHOC, /*!< @if Eng ADHOC. 328 @else ADHOC @endif */ 329 WIFI_IFTYPE_STATION = 2, /*!< @if Eng STATION. 330 @else STATION @endif */ 331 WIFI_IFTYPE_AP = 3, /*!< @if Eng HOTSPOT. 332 @else HOTSPOT @endif */ 333 WIFI_IFTYPE_AP_VLAN, /*!< @if Eng HOTSPOT VLAN. 334 @else HOTSPOT VLAN @endif */ 335 WIFI_IFTYPE_WDS, /*!< @if Eng WDS. 336 @else WDS @endif */ 337 WIFI_IFTYPE_MONITOR, /*!< @if Eng MONITOR. 338 @else MONITOR @endif */ 339 WIFI_IFTYPE_MESH_POINT = 7, /*!< @if Eng MESH POINT. 340 @else MESH POINT @endif */ 341 WIFI_IFTYPE_P2P_CLIENT, /*!< @if Eng P2P CLIENT. 342 @else P2P CLIENT @endif */ 343 WIFI_IFTYPE_P2P_GO, /*!< @if Eng P2P GO. 344 @else P2P GO @endif */ 345 WIFI_IFTYPE_P2P_DEVICE, /*!< @if Eng P2P DEVICE. 346 @else P2P DEVICE @endif */ 347 WIFI_IFTYPES_BUTT 348 } wifi_iftype_t; 349 350 /** 351 * @if Eng 352 * @brief Struct of WIFI_DEV. 353 * @else 354 * @brief WIFI_DEV的相关参数。 355 * @endif 356 */ 357 typedef struct { 358 uint32_t iftype; /*!< @if Eng IFTYPE, value from wifi_iftype_t. 359 @else IFTYPE。 @endif */ 360 void *priv; /*!< @if Eng priv. 361 @else priv。 @endif */ 362 uint32_t network_id; /*!< @if Eng network_id. 363 @else network_id。 @endif */ 364 uint32_t ifname_len; /*!< @if Eng ifname_len. 365 @else ifname_len。 @endif */ 366 char ifname[WIFI_IFNAME_MAX_SIZE + 1]; /*!< @if Eng ifname. 367 @else ifname。 @endif */ 368 char reserve[1]; 369 } wifi_dev_t; 370 371 /** 372 * @if Eng 373 * @brief Config of IPV4. 374 * @else 375 * @brief IPV4的配置。 376 * @endif 377 */ 378 typedef struct { 379 uint32_t ip_address; /*!< @if Eng IP address of the WiFi device. 380 @else WiFi device的IP地址。 @endif */ 381 uint32_t gateway; /*!< @if Eng Gateway of the WiFi device. 382 @else WiFi device的Gateway。 @endif */ 383 uint32_t dns_servers[WIFI_MAX_DNS_NUM]; /*!< @if Eng DNS server addresses for the Wi-Fi device. 384 @else WiFi device的DNS服务器地址。 @endif */ 385 uint32_t netmask; /*!< @if Eng Subnet mask of the Wi-Fi device. 386 @else WiFi device的子网掩码。 @endif */ 387 } ip_config_stru; 388 389 /** 390 * @if Eng 391 * @brief Config of IPV6. 392 * @else 393 * @brief IPV6的配置。 394 * @endif 395 */ 396 typedef struct { 397 uint8_t ipv6_address[WIFI_IPV6_ADDR_LEN]; /*!< @if Eng IPV6 address. 398 @else IPV6地址。 @endif */ 399 uint8_t ipv6_dns_servers[WIFI_MAX_DNS_NUM][WIFI_IPV6_DNS_LEN]; /*!< @if Eng DNS server addresses. 400 @else DNS服务器地址。 @endif */ 401 } ipv6_config_stru; 402 403 /** 404 * @if Eng 405 * @brief Assignment type of IP. 406 * @else 407 * @brief IP的分配类型。 408 * @endif 409 */ 410 typedef enum { 411 STATIC_IP, /*!< @if Eng Static IP address. 412 @else 静态IP地址。 @endif */ 413 DHCP, /*!< @if Eng IP address dynamically assigned by DHCP. 414 @else 由DHCP动态分配的IP地址。 @endif */ 415 UNKNOWN /*!< @if Eng Unknown IP address type. 416 @else 未知的IP地址类型。 @endif */ 417 } ip_type_stru_enum; 418 419 /** 420 * @if Eng 421 * @brief WiFi station configuration used to connect to a specified Wi-Fi device. 422 * @else 423 * @brief 连接到指定WiFi device的WiFi sta配置。 424 * @endif 425 */ 426 typedef struct wifi_sta_config_stru { 427 int8_t ssid[WIFI_MAX_SSID_LEN]; /*!< @if Eng Service set ID (SSID). 428 @else SSID。 @endif */ 429 uint8_t bssid[WIFI_MAC_LEN]; /*!< @if Eng Basic service set ID (BSSID). 430 @else BSSID。 @endif */ 431 int8_t pre_shared_key[WIFI_MAX_KEY_LEN]; /*!< @if Eng Pre Shared Key. 432 @else 预共享密钥。 @endif */ 433 wifi_security_enum security_type; /*!< @if Eng Security type,It is defined in link wifi_security_enum. 434 @else 安全类型。 @endif */ 435 int8_t wifi_psk_type; /*!< @if Eng The type of Psk. 436 @else Psk的类型。 @endif */ 437 int8_t strengthen_verify; /*!< @if Eng Enhanced verification. 438 A non-zero value indicates that whether the password 439 length is 0 needs to be verified in open mode. 440 The default value is 0, indicating no verification. 441 @else 加强校验,非零值表示open模式下需要校验密码长度是否为0, 442 默认为0不校验。 @endif */ 443 uint8_t channel; /*!< @if Eng channel num. 444 @else 关联的指定信道号,可选参数。 @endif */ 445 int8_t rsv; /*!< @if Eng 1 bytes reserved. 446 @else 保留1字节。 @endif */ 447 ip_type_stru_enum ip_type; /*!< @if Eng The assignment type of IP. 448 @else IP的分配类型。 @endif */ 449 ip_config_stru static_ip; /*!< @if Eng Static IPV4 address. 450 @else 静态IPV4地址。 @endif */ 451 ipv6_config_stru static_ipv6; /*!< @if Eng Static IPV6 address. 452 @else 静态IPV6地址。 @endif */ 453 } wifi_sta_config_stru; 454 455 /** 456 * @if Eng 457 * @brief Types of WiFi scan. 458 * @else 459 * @brief WiFi扫描的类型。 460 * @endif 461 */ 462 typedef enum { 463 WIFI_BASIC_SCAN, /*!< @if Eng A basic scan. 464 @else 普通扫描 @endif */ 465 WIFI_CHANNEL_SCAN, /*!< @if Eng A scan based on a specified chanel. 466 @else 基于指定信道的扫描。 @endif */ 467 WIFI_SSID_SCAN, /*!< @if Eng A scan based on a specified SSID. 468 @else 基于指定SSID的扫描。 @endif */ 469 WIFI_SSID_PREFIX_SCAN, /*!< @if Eng A scan based on a specified Prefix SSID. 470 @else 基于指定前缀SSID的扫描。 @endif */ 471 WIFI_BSSID_SCAN, /*!< @if Eng A scan based on a specified BSSID. 472 @else 基于指定BSSID的扫描。 @endif */ 473 STA_SCAN_BUTT 474 } wifi_scan_type_enum; 475 476 /** 477 * @if Eng 478 * @brief The protocol mode of softap and station interfaces. 479 * @else 480 * @brief softap和station接口的protocol模式。 481 * @endif 482 */ 483 typedef enum { 484 WIFI_MODE_UNDEFINE, /*!< @if Eng Not configured. 485 @else 未配置。 @endif */ 486 WIFI_MODE_11B, /*!< @if Eng 11b. 487 @else 11b。 @endif */ 488 WIFI_MODE_11B_G, /*!< @if Eng 11b/g. 489 @else 11b/g。 @endif */ 490 WIFI_MODE_11B_G_N, /*!< @if Eng 11b/g/n. 491 @else 11b/g/n。 @endif */ 492 WIFI_MODE_11B_G_N_AX, /*!< @if Eng 11b/g/n/ax. 493 @else 11b/g/n/ax。 @endif */ 494 } protocol_mode_enum; 495 496 /** 497 * @if Eng 498 * @brief Setting of scanning network parameters. 499 * @else 500 * @brief 扫描参数的设置。 501 * @endif 502 */ 503 typedef struct { 504 int8_t ssid[WIFI_MAX_SSID_LEN]; /*!< @if Eng Service set ID (SSID). 505 @else SSID。 @endif */ 506 int8_t ssid_len; /*!< @if Eng Length of the SSID. 507 @else SSID的长度。 @endif */ 508 int8_t bssid[WIFI_MAC_LEN]; /*!< @if Eng Basic service set ID (BSSID). 509 @else BSSID。 @endif */ 510 int32_t channel_num; /*!< @if Eng channel Num (BSSID). 511 @else 信道号。 @endif */ 512 wifi_scan_type_enum scan_type; /*!< @if Eng scan_type, which is defined by WifiScanType. 513 @else WiFi的扫描类型。 @endif */ 514 } wifi_scan_params_stru; 515 516 /** 517 * @if Eng 518 * @brief Setting of scanning network strategy. 519 * @else 520 * @brief 扫描策略设置。 521 * @endif 522 */ 523 typedef struct { 524 uint8_t scan_time; /*!< @if Eng the dwell time of each channel. 525 @else 每个信道停留时间,单位ms,范围20~120ms,默认20ms ,扫描总时间不能超过4.5s。 @endif */ 526 uint8_t scan_cnt; /*!< @if Eng Number of slots to be scanned. 527 @else 扫描slot数,一个slot 20ms。 @endif */ 528 uint8_t single_probe_send_times; /*!< @if Eng times of single probe req to be sent. 529 @else 单个probe req报文的发送次数,范围1~3,默认1。 @endif */ 530 uint8_t reserved; 531 } wifi_scan_strategy_stru; 532 533 /** 534 * @if Eng 535 * @brief Config of CSI. 536 * @else 537 * @brief CSI的配置。 538 * @endif 539 */ 540 typedef struct { 541 uint8_t user_index; /*!< @if Eng user index. 542 @else 用户ID,取值范围0~3,最多4个用户。 @endif */ 543 uint8_t enable; /*!< @if Eng enable. 544 @else CSI白名单用户开关。 @endif */ 545 uint8_t match_ta_ra_select; /*!< @if Eng match_ta_ra_select. 546 @else CSI白名单地址过滤类型 0 RA 1 TA。 @endif */ 547 uint8_t resv; /*!< @if Eng resv. 548 @else 保留1字节对齐。 @endif */ 549 uint8_t mac_addr[WIFI_MAC_LEN]; /*!< @if Eng Mac address. 550 @else MAC地址。 @endif */ 551 uint8_t frame_filter_bitmap; /*!< @if Eng frame_filter_bitmap. 552 @else 帧类型过滤具体参数。 @endif */ 553 uint8_t sub_type_filter_enable; /*!< @if Eng subTypeFilterEnable. 554 @else 帧子类型过滤开关。 @endif */ 555 uint8_t sub_type_filter; /*!< @if Eng subTypeFilter. 556 @else 帧子类型过滤具体参数。 @endif */ 557 uint8_t ppdu_filter_bitmap; /*!< @if Eng ppduFilterBitmap. 558 @else ppdu format过滤具体参数。 @endif */ 559 uint16_t period; /*!< @if Eng period. 560 @else CSI上报时间间隔。 @endif */ 561 } csi_config_stru; 562 563 /** 564 * @if Eng 565 * @brief Parameter settings for quick connection. 566 * @else 567 * @brief 快速连接的参数设置。 568 * @endif 569 */ 570 typedef struct wifi_fast_connect_stru { 571 wifi_sta_config_stru config; /*!< @if Eng The Wi-Fi station configuration used to connect to 572 a specified Wi-Fi device. 573 @else 连接到指定WiFi device的WiFi sta配置。 @endif */ 574 uint8_t psk[WIFI_PSK_LEN]; /*!< @if Eng Pre Shared Key(PSK). 575 @else PSK。 @endif */ 576 wifi_wpa_psk_type_enum psk_flag; /*!< @if Eng PSK flag.Set this parameter to 0 when it is not used. 577 @else psk的标志,不需指定时置0。 @endif */ 578 uint8_t channel_num; /*!< @if Eng Number of channels. 579 @else 信道号。 @endif */ 580 } wifi_fast_connect_stru; 581 582 /** 583 * @if Eng 584 * @brief Struct of frame filter config in monitor mode. 585 * @else 586 * @brief 混杂模式报文接收过滤设置。 587 * @endif 588 */ 589 typedef struct { 590 int8_t mdata_en : 1; /*!< @if Eng get multi-cast data frame flag. 591 @else 使能接收组播(广播)数据包。 @endif */ 592 int8_t udata_en : 1; /*!< @if Eng get single-cast data frame flag. 593 @else 使能接收单播数据包。 @endif */ 594 int8_t mmngt_en : 1; /*!< @if Eng get multi-cast mgmt frame flag. 595 @else 使能接收组播(广播)管理包。 @endif */ 596 int8_t umngt_en : 1; /*!< @if Eng get single-cast mgmt frame flag. 597 @else 使能接收单播管理包。 @endif */ 598 int8_t custom_en : 1; /*!< @if Eng get beacon/probe response flag. 599 @else 使能接收beacon/probe request包。 @endif */ 600 int8_t resvd : 3; /*!< @if Eng reserved bits. 601 @else 保留字段。 @endif */ 602 } wifi_ptype_filter_stru; 603 604 /** 605 * @if Eng 606 * @brief Struct of linkloss config. 607 * @else 608 * @brief 设置linkloss相关参数。 609 * @endif 610 */ 611 typedef struct { 612 uint16_t linkloss_threshold; /*!< @if Eng Threshold of linkloss. 613 @else 取值范围: [50, 500]. 设置为n时,表示linkloss阈值基础时间为(100*n)ms。 @endif */ 614 uint8_t send_probe_request_ratio; /*!< @if Eng Threshold ratio for sending probe request. 615 @else 取值范围: [1, 10]. 设置为n时,表示linkloss计数达到阈值的(n/10)时,开始发送探测帧保活。 @endif */ 616 uint8_t resv[1]; 617 } linkloss_paras_stru; 618 619 /** 620 * @} 621 */ 622 623 #ifdef __cplusplus 624 #if __cplusplus 625 } 626 #endif 627 #endif 628 629 #endif // SERVICE_WIFI_DEVICE_CONFIG_H 630