mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(examples) : Common component's wifi disconnect handler should ignore roaming disconnect
- Common component's wifi disconnect handler should ignore roaming disconnect (WIFI_REASON_ROAMING) as connect gets issued internally in these cases.
This commit is contained in:
parent
6547315dde
commit
e411e43b4b
@ -46,7 +46,12 @@ static void example_handler_on_wifi_disconnect(void *arg, esp_event_base_t event
|
||||
example_wifi_sta_do_disconnect();
|
||||
return;
|
||||
}
|
||||
ESP_LOGI(TAG, "Wi-Fi disconnected, trying to reconnect...");
|
||||
wifi_event_sta_disconnected_t *disconn = event_data;
|
||||
if (disconn->reason == WIFI_REASON_ROAMING) {
|
||||
ESP_LOGD(TAG, "station roaming, do nothing");
|
||||
return;
|
||||
}
|
||||
ESP_LOGI(TAG, "Wi-Fi disconnected %d, trying to reconnect...", disconn->reason);
|
||||
esp_err_t err = esp_wifi_connect();
|
||||
if (err == ESP_ERR_WIFI_NOT_STARTED) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user