adds erase

This commit is contained in:
Shawn A
2018-03-05 12:58:30 -06:00
parent 5ae132a7e9
commit 4db3eca51e
2 changed files with 14 additions and 1 deletions
+12 -1
View File
@@ -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]
+2
View File
@@ -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