docs(wifi): update the docmentation for sniffer API

Closes https://github.com/espressif/esp-idf/issues/10740
pull/9873/merge
zhangyanjiao 2024-03-27 12:15:09 +08:00
rodzic 4d7478002d
commit f7fe5728ce
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -1860,7 +1860,7 @@ The following packets will **NOT** be dumped to the application:
- 802.11 error frame, such as the frame with a CRC error, etc.
For frames that the sniffer **can** dump, the application can additionally decide which specific type of packets can be filtered to the application by using :cpp:func:`esp_wifi_set_promiscuous_filter()` and :cpp:func:`esp_wifi_set_promiscuous_ctrl_filter()`. By default, it will filter all 802.11 data and management frames to the application.
For frames that the sniffer **can** dump, the application can additionally decide which specific type of packets can be filtered to the application by using :cpp:func:`esp_wifi_set_promiscuous_filter()` and :cpp:func:`esp_wifi_set_promiscuous_ctrl_filter()`. By default, it will filter all 802.11 data and management frames to the application. If you want to filter the 802.11 control frames, the filter parameter in :cpp:func:`esp_wifi_set_promiscuous_filter()` should include `WIFI_PROMIS_FILTER_MASK_CTRL` type, and if you want to differentiate control frames further, then call :cpp:func:`esp_wifi_set_promiscuous_ctrl_filter()`.
The Wi-Fi sniffer mode can be enabled in the Wi-Fi mode of WIFI_MODE_NULL, or WIFI_MODE_STA, or WIFI_MODE_AP, or WIFI_MODE_APSTA. In other words, the sniffer mode is active when the station is connected to the AP, or when the AP has a Wi-Fi connection. Please note that the sniffer has a **great impact** on the throughput of the station or AP Wi-Fi connection. Generally, we should **NOT** enable the sniffer, when the station/AP Wi-Fi connection experiences heavy traffic unless we have special reasons.

Wyświetl plik

@ -1792,7 +1792,7 @@ Wi-Fi Sniffer 模式可以通过 :cpp:func:`esp_wifi_set_promiscuous()` 使能
- 802.11 错误帧,如有 CRC 错误的帧等。
对于Sniffer 模式 **可以** 转储的帧,应用程序可以另外使用 :cpp:func:`esp_wifi_set_promiscuous_filter()`:cpp:func:`esp_wifi_set_promiscuous_ctrl_filter()` 决定筛选哪些特定类型的数据包。应用程序默认筛选所有 802.11 数据和管理帧。
对于 Sniffer 模式 **可以** 转储的帧,应用程序可以另外使用 :cpp:func:`esp_wifi_set_promiscuous_filter()`:cpp:func:`esp_wifi_set_promiscuous_ctrl_filter()` 决定筛选哪些特定类型的数据包。应用程序默认筛选所有 802.11 数据和管理帧。如果你想要筛选 802.11 控制帧,:cpp:func:`esp_wifi_set_promiscuous_filter()` 中的 filter 参数需要包含 “WIFI_PROMIS_FILTER_MASK_CTRL” 类型, 如果你想进一步区分 802.11 控制帧,那么调用 :cpp:func:`esp_wifi_set_promiscuous_ctrl_filter()`
可以在 WIFI_MODE_NULL、WIFI_MODE_STA、WIFI_MODE_AP、WIFI_MODE_APSTA 等Wi-Fi 模式下使能 Wi-Fi Sniffer 模式。也就是说,当 station 连接到 AP或者 AP 有 Wi-Fi 连接时就可以使能。请注意Sniffer 模式对 station/AP Wi-Fi 连接的吞吐量有 **很大影响**。通常,除非有特别原因,当 station/AP Wi-Fi 连接出现大量流量,不应使能。