mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-15 07:31:21 +10:00
adds erase
This commit is contained in:
+12
-1
@@ -1518,9 +1518,10 @@ void WiFiManager::reportStatus(String &page){
|
||||
*/
|
||||
bool WiFiManager::disconnect(){
|
||||
if(WiFi.status() != WL_CONNECTED){
|
||||
DEBUG_WM("Disconnect: Not connected");
|
||||
DEBUG_WM("Disconnecting: Not connected");
|
||||
return false;
|
||||
}
|
||||
DEBUG_WM("Disconnecting");
|
||||
return WiFi_Disconnect();
|
||||
}
|
||||
|
||||
@@ -1529,9 +1530,19 @@ bool WiFiManager::disconnect(){
|
||||
* @access public
|
||||
*/
|
||||
void WiFiManager::reboot(){
|
||||
DEBUG_WM("Restarting");
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
/**
|
||||
* reboot the device
|
||||
* @access public
|
||||
*/
|
||||
bool WiFiManager::erase(){
|
||||
DEBUG_WM("Erasing");
|
||||
return WiFi_eraseConfig();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [resetSettings description]
|
||||
|
||||
@@ -147,6 +147,8 @@ class WiFiManager
|
||||
void reboot();
|
||||
// disconnect wifi, without persistent saving or erasing
|
||||
bool disconnect();
|
||||
// erase esp
|
||||
bool erase();
|
||||
|
||||
//sets timeout before AP,webserver loop ends and exits even if there has been no setup.
|
||||
//useful for devices that failed to connect at some point and got stuck in a webserver loop
|
||||
|
||||
Reference in New Issue
Block a user