Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eraseCredentials option to WiFi disconnect method. #8758

Merged
merged 9 commits into from
Dec 15, 2022
Prev Previous commit
Next Next commit
Add another method as suggested in PR review.
  • Loading branch information
cziter15 committed Dec 14, 2022
commit 21f41118f3321c00c4de76fa47ee8585ed03c6d6
11 changes: 11 additions & 0 deletions libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,17 @@ bool ESP8266WiFiSTAClass::reconnect() {
* @param wifioff
* @return one value of wl_status_t enum
*/
bool ESP8266WiFiSTAClass::disconnect(bool wifioff, bool eraseap) {
{
cziter15 marked this conversation as resolved.
Show resolved Hide resolved
return disconnect(wifioff, false);
cziter15 marked this conversation as resolved.
Show resolved Hide resolved
}
cziter15 marked this conversation as resolved.
Show resolved Hide resolved

/**
* Disconnect from the network
* @param wifioff
* @param eraseap
* @return one value of wl_status_t enum
*/
bool ESP8266WiFiSTAClass::disconnect(bool wifioff, bool eraseap) {
bool ret = false;

Expand Down
2 changes: 2 additions & 0 deletions libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class ESP8266WiFiSTAClass: public LwipIntf {
bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000);

bool reconnect();

bool disconnect(bool wifioff = false);
bool disconnect(bool wifioff = false, bool eraseap = false);
cziter15 marked this conversation as resolved.
Show resolved Hide resolved
cziter15 marked this conversation as resolved.
Show resolved Hide resolved

bool isConnected();
Expand Down