update wifi reason code

This commit is contained in:
zhangyanjiao
2022-05-26 15:02:14 +08:00
parent 2e0da2773b
commit 92eb91f985
3 changed files with 299 additions and 35 deletions

View File

@ -69,40 +69,62 @@ typedef enum {
} wifi_auth_mode_t;
typedef enum {
WIFI_REASON_UNSPECIFIED = 1,
WIFI_REASON_AUTH_EXPIRE = 2,
WIFI_REASON_AUTH_LEAVE = 3,
WIFI_REASON_ASSOC_EXPIRE = 4,
WIFI_REASON_ASSOC_TOOMANY = 5,
WIFI_REASON_NOT_AUTHED = 6,
WIFI_REASON_NOT_ASSOCED = 7,
WIFI_REASON_ASSOC_LEAVE = 8,
WIFI_REASON_ASSOC_NOT_AUTHED = 9,
WIFI_REASON_DISASSOC_PWRCAP_BAD = 10,
WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11,
WIFI_REASON_IE_INVALID = 13,
WIFI_REASON_MIC_FAILURE = 14,
WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,
WIFI_REASON_IE_IN_4WAY_DIFFERS = 17,
WIFI_REASON_GROUP_CIPHER_INVALID = 18,
WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19,
WIFI_REASON_AKMP_INVALID = 20,
WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21,
WIFI_REASON_INVALID_RSN_IE_CAP = 22,
WIFI_REASON_802_1X_AUTH_FAILED = 23,
WIFI_REASON_CIPHER_SUITE_REJECTED = 24,
WIFI_REASON_UNSPECIFIED = 1,
WIFI_REASON_AUTH_EXPIRE = 2,
WIFI_REASON_AUTH_LEAVE = 3,
WIFI_REASON_ASSOC_EXPIRE = 4,
WIFI_REASON_ASSOC_TOOMANY = 5,
WIFI_REASON_NOT_AUTHED = 6,
WIFI_REASON_NOT_ASSOCED = 7,
WIFI_REASON_ASSOC_LEAVE = 8,
WIFI_REASON_ASSOC_NOT_AUTHED = 9,
WIFI_REASON_DISASSOC_PWRCAP_BAD = 10,
WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11,
WIFI_REASON_BSS_TRANSITION_DISASSOC = 12,
WIFI_REASON_IE_INVALID = 13,
WIFI_REASON_MIC_FAILURE = 14,
WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,
WIFI_REASON_IE_IN_4WAY_DIFFERS = 17,
WIFI_REASON_GROUP_CIPHER_INVALID = 18,
WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19,
WIFI_REASON_AKMP_INVALID = 20,
WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21,
WIFI_REASON_INVALID_RSN_IE_CAP = 22,
WIFI_REASON_802_1X_AUTH_FAILED = 23,
WIFI_REASON_CIPHER_SUITE_REJECTED = 24,
WIFI_REASON_TDLS_PEER_UNREACHABLE = 25,
WIFI_REASON_TDLS_UNSPECIFIED = 26,
WIFI_REASON_SSP_REQUESTED_DISASSOC = 27,
WIFI_REASON_NO_SSP_ROAMING_AGREEMENT = 28,
WIFI_REASON_BAD_CIPHER_OR_AKM = 29,
WIFI_REASON_NOT_AUTHORIZED_THIS_LOCATION = 30,
WIFI_REASON_SERVICE_CHANGE_PERCLUDES_TS = 31,
WIFI_REASON_UNSPECIFIED_QOS = 32,
WIFI_REASON_NOT_ENOUGH_BANDWIDTH = 33,
WIFI_REASON_MISSING_ACKS = 34,
WIFI_REASON_EXCEEDED_TXOP = 35,
WIFI_REASON_STA_LEAVING = 36,
WIFI_REASON_END_BA = 37,
WIFI_REASON_UNKNOWN_BA = 38,
WIFI_REASON_TIMEOUT = 39,
WIFI_REASON_PEER_INITIATED = 46,
WIFI_REASON_AP_INITIATED = 47,
WIFI_REASON_INVALID_FT_ACTION_FRAME_COUNT = 48,
WIFI_REASON_INVALID_PMKID = 49,
WIFI_REASON_INVALID_MDE = 50,
WIFI_REASON_INVALID_FTE = 51,
WIFI_REASON_TRANSMISSION_LINK_ESTABLISH_FAILED = 67,
WIFI_REASON_ALTERATIVE_CHANNEL_OCCUPIED = 68,
WIFI_REASON_INVALID_PMKID = 53,
WIFI_REASON_BEACON_TIMEOUT = 200,
WIFI_REASON_NO_AP_FOUND = 201,
WIFI_REASON_AUTH_FAIL = 202,
WIFI_REASON_ASSOC_FAIL = 203,
WIFI_REASON_HANDSHAKE_TIMEOUT = 204,
WIFI_REASON_CONNECTION_FAIL = 205,
WIFI_REASON_AP_TSF_RESET = 206,
WIFI_REASON_ROAMING = 207,
WIFI_REASON_BEACON_TIMEOUT = 200,
WIFI_REASON_NO_AP_FOUND = 201,
WIFI_REASON_AUTH_FAIL = 202,
WIFI_REASON_ASSOC_FAIL = 203,
WIFI_REASON_HANDSHAKE_TIMEOUT = 204,
WIFI_REASON_CONNECTION_FAIL = 205,
WIFI_REASON_AP_TSF_RESET = 206,
WIFI_REASON_ROAMING = 207,
} wifi_err_reason_t;
typedef enum {

View File

@ -747,7 +747,7 @@ Four-way Handshake Phase
Wi-Fi Reason Code
+++++++++++++++++++++
The table below shows the reason-code defined in {IDF_TARGET_NAME}. The first column is the macro name defined in esp_wifi_types.h. The common prefix *WIFI_REASON* is removed, which means that *UNSPECIFIED* actually stands for *WIFI_REASON_UNSPECIFIED* and so on. The second column is the value of the reason. The third column is the standard value to which this reason is mapped in section 8.4.1.7 of IEEE 802.11-2012. (For more information, refer to the standard mentioned above.) The last column is a description of the reason.
The table below shows the reason-code defined in {IDF_TARGET_NAME}. The first column is the macro name defined in esp_wifi_types.h. The common prefix *WIFI_REASON* is removed, which means that *UNSPECIFIED* actually stands for *WIFI_REASON_UNSPECIFIED* and so on. The second column is the value of the reason. The third column is the standard value to which this reason is mapped in section 9.4.1.7 of IEEE 802.11-2020. (For more information, refer to the standard mentioned above.) The last column describes the reason.
.. list-table::
:header-rows: 1
@ -977,6 +977,102 @@ The table below shows the reason-code defined in {IDF_TARGET_NAME}. The first co
For the ESP station, this reason is reported when:
- it is received from the AP.
* - TDLS_PEER_UNREACHABLE
- 25
- 25
- TDLS direct-link teardown due to TDLS peer STA unreachable via the TDLS direct link.
* - TDLS_UNSPECIFIED
- 26
- 26
- TDLS direct-link teardown for unspecified reason.
* - SSP_REQUESTED_DISASSOC
- 27
- 27
- Disassociated because session terminated by SSP request.
* - NO_SSP_ROAMING_AGREEMENT
- 28
- 28
- Disassociated because of lack of SSP roaming agreement.
* - BAD_CIPHER_OR_AKM
- 29
- 29
- Requested service rejected because of SSP cipher suite or AKM requiremen.
* - NOT_AUTHORIZED_THIS_LO CATION
- 30
- 30
- Requested service not authorized in this location.
* - SERVICE_CHANGE_PRECLUDES_TS
- 31
- 31
- TS deleted because QoS AP lacks sufficient bandwidth for this QoS STA due to a change in BSS service characteristics or operational mode (e.g., an HT BSS change from 40 MHz channel to 20 MHz channel).
* - UNSPECIFIED_QOS
- 32
- 32
- Disassociated for unspecified, QoS-related reason.
* - NOT_ENOUGH_BANDWIDTH
- 33
- 33
- Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA.
* - MISSING_ACKS
- 34
- 34
- Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions.
* - EXCEEDED_TXOP
- 35
- 35
- Disassociated because STA is transmitting outside the limits of its TXOPs.
* - STA_LEAVING
- 36
- 36
- Requesting STA is leaving the BSS (or resetting).
* - END_BA
- 37
- 37
- Requesting STA is no longer using the stream or session.
* - UNKNOWN_BA
- 38
- 38
- Requesting STA received frames using a mechanism for which a setup has not been completed.
* - TIMEOUT
- 39
- 39
- Requested from peer STA due to timeout
* - Reserved
- 40 ~ 45
- 40 ~ 45
-
* - PEER_INITIATED
- 46
- 46
- In a Disassociation frame: Disassociated because authorized access limit reached.
* - AP_INITIATED
- 47
- 47
- In a Disassociation frame: Disassociated due to external service requirements.
* - INVALID_FT_ACTION_FRAME_COUNT
- 48
- 48
- Invalid FT Action frame count.
* - INVALID_PMKID
- 49
- 49
- Invalid pairwise master key identifier (PMKID).
* - INVALID_MDE
- 50
- 50
- Invalid MDE.
* - INVALID_FTE
- 51
- 51
- Invalid FTE
* - TRANSMISSION_LINK_ESTABLISHMENT_FAILED
- 67
- 67
- Transmission link establishment in alternative channel failed.
* - ALTERATIVE_CHANNEL_OCCUPIED
- 68
- 68
- The alternative channel is occupied.
* - BEACON_TIMEOUT
- 200
- reserved
@ -1002,6 +1098,31 @@ The table below shows the reason-code defined in {IDF_TARGET_NAME}. The first co
- reserved
- Espressif-specific Wi-Fi reason-code: the connection to the AP has failed.
Wi-Fi Reason code related to wrong password
++++++++++++++++++++++++++++++++++++++++++++++
The table below shows the Wi-Fi reason-code may related to wrong password.
.. list-table::
:header-rows: 1
:widths: 5 10 40
* - Reason code
- Value
- Description
* - 4WAY_HANDSHAKE_TIMEOUT
- 15
- Four-way handshake times out.
* - NO_AP_FOUND
- 201
- This may related to wrong password in the two scenarios:
- Setting password when STA connecting to an unencrypted AP.
- Doesn't setting password when STA connecting to an encrpted AP.
* - HANDSHAKE_TIMEOUT
- 204
- Four-way handshake fails.
{IDF_TARGET_NAME} Wi-Fi Station Connecting When Multiple APs Are Found
----------------------------------------------------------------------

View File

@ -747,7 +747,7 @@ Wi-Fi 驱动程序内部扫描阶段
Wi-Fi 原因代码
+++++++++++++++++++++
下表罗列了 {IDF_TARGET_NAME} 中定义的原因代码。其中,第一列为 esp_wifi_types.h 中定义的宏名称。名称中省去了前缀 *WIFI_REASON*,也就是说,名称 *UNSPECIFIED* 实际应为 *WIFI_REASON_UNSPECIFIED*,以此类推。第二列为原因代码的相应数值。第三列为该原因映射到 IEEE 802.11-2012 中 8.4.1.7 段的标准值。(更多详细信息,请参阅前文描述。)最后一列为这一原因的描述。
下表罗列了 {IDF_TARGET_NAME} 中定义的原因代码。其中,第一列为 esp_wifi_types.h 中定义的宏名称。名称中省去了前缀 *WIFI_REASON*,也就是说,名称 *UNSPECIFIED* 实际应为 *WIFI_REASON_UNSPECIFIED*,以此类推。第二列为原因代码的相应数值。第三列为该原因映射到 IEEE 802.11-20209.4.1.7 段的标准值。(更多详细信息,请参阅前文描述。)最后一列为这一原因的描述。
.. list-table::
:header-rows: 1
@ -977,6 +977,102 @@ Wi-Fi 原因代码
对于 ESP station出现以下情况时报告该代码
- 从 AP 接收到该代码。
* - TDLS_PEER_UNREACHABLE
- 25
- 25
- 通过 TDLS 直连无法到达TDLS 对端 STA导致 TDLS 直连中断。
* - TDLS_UNSPECIFIED
- 26
- 26
- 不明原因的 TDLS 直连中断。
* - SSP_REQUESTED_DISASSOC
- 27
- 27
- association 取消,由于会话被 SSP request 终止。
* - NO_SSP_ROAMING_AGREEMENT
- 28
- 28
- association 取消,由于缺乏 SSP 漫游认证。
* - BAD_CIPHER_OR_AKM
- 29
- 29
- 请求的服务被拒绝,由于 SSP 密码套件或者 AKM 的需求。
* - NOT_AUTHORIZED_THIS_LO CATION
- 30
- 30
- 请求的服务在此位置未得到授权。
* - SERVICE_CHANGE_PRECLUDES_TS
- 31
- 31
- TS 被删除原因是BSS 服务特性或者运行模式改变导致 Qos AP 缺少足够的带宽给 Qos STA 使用例如一个HT BSS 从 40 MHz 的信道切换到 20 MHz 的信道)。
* - UNSPECIFIED_QOS
- 32
- 32
- association 取消,由于不明确的 QoS 相关原因。
* - NOT_ENOUGH_BANDWIDTH
- 33
- 33
- association 取消由于QoS AP 缺少足够的带宽给该 QoS STA 使用。
* - MISSING_ACKS
- 34
- 34
- association 取消,原因是:大量的帧需要被确认,但由于 AP 传输或者糟糕的信道条件而没有被确认。
* - EXCEEDED_TXOP
- 35
- 35
- association 取消,由于 STA 的传输超过了 TXOPs 的限制。
* - STA_LEAVING
- 36
- 36
- 请求 STA 离开了 BSS 或者重置了。
* - END_BA
- 37
- 37
- 请求 STA 不再使用该流或者会话。
* - UNKNOWN_BA
- 38
- 38
- 请求 STA 使用一种尚未完成的机制接收帧。
* - TIMEOUT
- 39
- 39
- 对端 STA 的请求超时。
* - Reserved
- 40 ~ 45
- 40 ~ 45
- 保留
* - PEER_INITIATED
- 46
- 46
- 在 Disassociation 帧中:已达到授权访问限制。
* - AP_INITIATED
- 47
- 47
- 在 Disassociation 帧中:外部服务需求。
* - INVALID_FT_ACTION_FRAME_COUNT
- 48
- 48
- 无效的 FT Action 帧计数。
* - INVALID_PMKID
- 49
- 49
- 无效的成对主密钥标识符PMKID
* - INVALID_MDE
- 50
- 50
- 无效的 MDE。
* - INVALID_FTE
- 51
- 51
- 无效的 FTE。
* - TRANSMISSION_LINK_ESTABLISHMENT_FAILED
- 67
- 67
- 在备用信道中建立传输链路失败。
* - ALTERATIVE_CHANNEL_OCCUPIED
- 68
- 68
- 备用信道被占用。
* - BEACON_TIMEOUT
- 200
- 保留
@ -1002,6 +1098,31 @@ Wi-Fi 原因代码
- 保留
- 乐鑫特有的 Wi-Fi 原因代码: AP 连接失败。
与密码错误有关的 Wi-Fi 原因代码
+++++++++++++++++++++++++++++++++
下表罗列了与密码错误相关的 Wi-Fi 原因代码。
.. list-table::
:header-rows: 1
:widths: 5 10 40
* - 原因代码
- 数值
- 描述
* - 4WAY_HANDSHAKE_TIMEOUT
- 15
- 四次握手超时。
* - NO_AP_FOUND
- 201
- 密码错误会出现这个原因代码的场景有如下两个:
- STA 在连接加密的 AP 的时候没有输入密码
- STA 在连接非加密的 AP 的时候输入了密码
* - HANDSHAKE_TIMEOUT
- 204
- 握手超时。
找到多个 AP 时的 {IDF_TARGET_NAME} Wi-Fi station 连接
----------------------------------------------------------------------