From 9be681be352fab087a56ef51c168f36ce609da2d Mon Sep 17 00:00:00 2001 From: muhaidong Date: Mon, 6 Jun 2022 17:00:26 +0800 Subject: [PATCH 1/2] docs: update wifi beacon timeout docs --- docs/en/api-guides/wifi.rst | 2 ++ docs/zh_CN/api-guides/wifi.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/en/api-guides/wifi.rst b/docs/en/api-guides/wifi.rst index 0410e84680..7b9b3b347e 100644 --- a/docs/en/api-guides/wifi.rst +++ b/docs/en/api-guides/wifi.rst @@ -1023,6 +1023,8 @@ The beacon timeout mechanism is used by {IDF_TARGET_NAME} station to detect whet After the beacon times out, the station sends 5 probe requests to the AP. If still no probe response or beacon is received from AP, the station disconnects from the AP and raises the event `WIFI_EVENT_STA_DISCONNECTED`_. +It should be considered that the timer used for beacon timeout will be reset during the scanning process. It means that the scan process will affect the triggering of the event `WIFI_EVENT_STA_BEACON_TIMEOUT`_. + {IDF_TARGET_NAME} Wi-Fi Configuration ------------------------------------- diff --git a/docs/zh_CN/api-guides/wifi.rst b/docs/zh_CN/api-guides/wifi.rst index 6476920497..45415895b9 100644 --- a/docs/zh_CN/api-guides/wifi.rst +++ b/docs/zh_CN/api-guides/wifi.rst @@ -1023,6 +1023,8 @@ Wi-Fi beacon 超时 beacon 超时发生后,station 将向 AP 发送 5 个 probe request,如果仍未从 AP 接收到 probe response 或 beacon,station 将与 AP 断开连接并产生 `WIFI_EVENT_STA_DISCONNECTED`_ 事件。 +需要注意的是,扫描过程中会重置 beacon 超时所使用的定时器,即扫描过程会影响 `WIFI_EVENT_STA_BEACON_TIMEOUT`_ 事件的触发。 + {IDF_TARGET_NAME} Wi-Fi 配置 ------------------------------------- From 1b496ed9e227cd8067bb86b90a32e4cd7dcaa2e2 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Mon, 6 Jun 2022 19:20:43 +0800 Subject: [PATCH 2/2] docs: add WIFI_EVENT_STA_BEACON_TIMEOUT event docs. --- docs/en/api-guides/wifi.rst | 7 ++++++- docs/zh_CN/api-guides/wifi.rst | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/en/api-guides/wifi.rst b/docs/en/api-guides/wifi.rst index 7b9b3b347e..eb4d300b1e 100644 --- a/docs/en/api-guides/wifi.rst +++ b/docs/en/api-guides/wifi.rst @@ -243,6 +243,11 @@ WIFI_EVENT_AP_PROBEREQRECVED This event is disabled by default. The application can enable it via API :cpp:func:`esp_wifi_set_event_mask()`. When this event is enabled, it will be raised each time the AP receives a probe request. +WIFI_EVENT_STA_BEACON_TIMEOUT +++++++++++++++++++++++++++++++++++++ + +If the station does not receive the beacon of the connected AP within the inactive time, the beacon timeout happens, the `WIFI_EVENT_STA_BEACON_TIMEOUT`_ will arise. The application can set inactive time via API :cpp:func:`esp_wifi_set_inactive_time()`. + {IDF_TARGET_NAME} Wi-Fi Station General Scenario ------------------------------------------------ Below is a "big scenario" which describes some small scenarios in station mode: @@ -1019,7 +1024,7 @@ Another thing that need to be considered is that the reconnection may not connec Wi-Fi Beacon Timeout --------------------------- -The beacon timeout mechanism is used by {IDF_TARGET_NAME} station to detect whether the AP is alive or not. If the station continuously loses 60 beacons of the connected AP, the beacon timeout happens. +The beacon timeout mechanism is used by {IDF_TARGET_NAME} station to detect whether the AP is alive or not. If the station does not receive the beacon of the connected AP within the inactive time, the beacon timeout happens. The application can set inactive time via API :cpp:func:`esp_wifi_set_inactive_time()`. After the beacon times out, the station sends 5 probe requests to the AP. If still no probe response or beacon is received from AP, the station disconnects from the AP and raises the event `WIFI_EVENT_STA_DISCONNECTED`_. diff --git a/docs/zh_CN/api-guides/wifi.rst b/docs/zh_CN/api-guides/wifi.rst index 45415895b9..48a6852935 100644 --- a/docs/zh_CN/api-guides/wifi.rst +++ b/docs/zh_CN/api-guides/wifi.rst @@ -243,6 +243,11 @@ WIFI_EVENT_AP_PROBEREQRECVED 默认情况下,此事件处于禁用状态,应用程序可以通过调用 API :cpp:func:`esp_wifi_set_event_mask()` 启用。 启用后,每当 AP 接收到 probe request 时都将引发此事件。 +WIFI_EVENT_STA_BEACON_TIMEOUT +++++++++++++++++++++++++++++++++++++ + +如果 station 在 inactive 时间内未收到所连接 AP 的 beacon,将发生 beacon 超时,将引发此事件。inactive 时间通过调用函数 :cpp:func:`esp_wifi_set_inactive_time()` 设置。 + {IDF_TARGET_NAME} Wi-Fi station 一般情况 ------------------------------------------------ 下图为 station 模式下的宏观场景,其中包含不同阶段的具体描述: @@ -1019,7 +1024,7 @@ Wi-Fi 重新连接 Wi-Fi beacon 超时 --------------------------- -{IDF_TARGET_NAME} 使用 beacon 超时机制检测 AP 是否活跃。如果 station 连续丢失了 60 个所连接 AP 的 beacon,将发生 beacon 超时。 +{IDF_TARGET_NAME} 使用 beacon 超时机制检测 AP 是否活跃。如果 station 在 inactive 时间内未收到所连接 AP 的 beacon,将发生 beacon 超时。inactive 时间通过调用函数 :cpp:func:`esp_wifi_set_inactive_time()` 设置。 beacon 超时发生后,station 将向 AP 发送 5 个 probe request,如果仍未从 AP 接收到 probe response 或 beacon,station 将与 AP 断开连接并产生 `WIFI_EVENT_STA_DISCONNECTED`_ 事件。