eraseAP (#8148)
This commit is contained in:
parent
5c92a0231b
commit
758b4ebf72
2 changed files with 17 additions and 0 deletions
|
|
@ -366,6 +366,22 @@ bool WiFiSTAClass::disconnect(bool wifioff, bool eraseap)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Reset WiFi settings in NVS to default values.
|
||||||
|
* @return true if erase succeeded
|
||||||
|
* @note: Resets SSID, password, protocol, mode, etc.
|
||||||
|
* These settings are maintained by WiFi driver in IDF.
|
||||||
|
* WiFi driver must be initialized.
|
||||||
|
*/
|
||||||
|
bool WiFiSTAClass::eraseAP(void) {
|
||||||
|
if(WiFi.getMode()==WIFI_MODE_NULL) {
|
||||||
|
if(!WiFi.enableSTA(true))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return esp_wifi_restore()==ESP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change IP configuration settings disabling the dhcp client
|
* Change IP configuration settings disabling the dhcp client
|
||||||
* @param local_ip Static ip configuration
|
* @param local_ip Static ip configuration
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ public:
|
||||||
|
|
||||||
bool reconnect();
|
bool reconnect();
|
||||||
bool disconnect(bool wifioff = false, bool eraseap = false);
|
bool disconnect(bool wifioff = false, bool eraseap = false);
|
||||||
|
bool eraseAP(void);
|
||||||
|
|
||||||
bool isConnected();
|
bool isConnected();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue