1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

BREAKING: Add Wrong Password wifi status case (#7652)

* Add Wrong Password wifi status case
* Add wrong password case for status return
* Add wrong password case for debug
* Add Wrong password case to interactive example
* Add case for wrong password to station doc
* Add case for wrong password to resumeFromShutdown
* Add wrong password case to wifi readme
* Update ESP8266WiFiGeneric.cpp
This commit is contained in:
Develo
2020-10-15 13:52:17 -03:00
committed by GitHub
parent 79ea883fb3
commit 1c624dd76a
7 changed files with 23 additions and 9 deletions

View File

@ -827,15 +827,21 @@ bool ESP8266WiFiGenericClass::resumeFromShutdown (WiFiState* state)
}
}
// state->state.fwconfig.bssid is not real bssid (it's what user may have provided when bssid_set==1)
if (WiFi.begin((const char*)state->state.fwconfig.ssid,
auto beginResult = WiFi.begin((const char*)state->state.fwconfig.ssid,
(const char*)state->state.fwconfig.password,
state->state.channel,
nullptr/*(const uint8_t*)state->state.fwconfig.bssid*/, // <- try with gw's mac address?
true) == WL_CONNECT_FAILED)
true);
if (beginResult == WL_CONNECT_FAILED)
{
DEBUG_WIFI("core: resume: WiFi.begin failed\n");
return false;
}
if (beginResult == WL_WRONG_PASSWORD)
{
DEBUG_WIFI("core: resume: WiFi.begin wrong password\n");
return false;
}
}
if (state->state.mode & WIFI_AP)

View File

@ -60,6 +60,9 @@ static void printWiFiStatus(wl_status_t status)
case WL_CONNECT_FAILED:
DEBUG_WIFI_MULTI("[WIFIM] Connecting failed.\n");
break;
case WL_WRONG_PASSWORD:
DEBUG_WIFI_MULTI("[WIFIM] Wrong password.\n");
break;
default:
DEBUG_WIFI_MULTI("[WIFIM] Connecting failed (%d).\n", status);
break;

View File

@ -624,8 +624,9 @@ wl_status_t ESP8266WiFiSTAClass::status() {
case STATION_NO_AP_FOUND:
return WL_NO_SSID_AVAIL;
case STATION_CONNECT_FAIL:
case STATION_WRONG_PASSWORD:
return WL_CONNECT_FAILED;
case STATION_WRONG_PASSWORD:
return WL_WRONG_PASSWORD;
case STATION_IDLE:
return WL_IDLE_STATUS;
default:

View File

@ -55,7 +55,8 @@ typedef enum {
WL_CONNECTED = 3,
WL_CONNECT_FAILED = 4,
WL_CONNECTION_LOST = 5,
WL_DISCONNECTED = 6
WL_WRONG_PASSWORD = 6,
WL_DISCONNECTED = 7
} wl_status_t;
/* Encryption modes */