esp32: add esp_wifi_internal_statistic_dump()

The API is used to dump WiFi lmac/hmac/wpa key statistics, which is helpful for
WiFi issue debugging. The application need to call the API at the moment potential
problem happens, such as:
1. When receiving WiFi disconnect event
2. When receiving IP lost event
3. When sockets failed, such as TX or RX timeout etc
4. Any other places that the application suspect the WiFi works incorrectly
This commit is contained in:
liu zhifu
2020-03-30 21:44:59 +08:00
committed by baohongde
parent 92e111eb56
commit 5a09cf600e
2 changed files with 12 additions and 1 deletions

View File

@@ -318,6 +318,17 @@ esp_err_t esp_wifi_internal_set_log_mod(wifi_log_module_t module, uint32_t submo
*/
esp_err_t esp_wifi_internal_get_log(wifi_log_level_t *log_level, uint32_t *log_mod);
/**
* @brief Dump WiFi key statistic counters
*
* @attention Application can call this API at the points that potential error happens,
* such as, WiFi disconnect, IP lost, socket fail etc.
*
* @return
* - ESP_OK: succeed
*/
esp_err_t esp_wifi_internal_statistic_dump(void);
#ifdef __cplusplus
}
#endif