mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
adds option to keep cfgp open on wifi save
// if true (default) then stop the config portal from autoConnect when wifi is saved
void setDisableConfigPortal(boolean enable);
Name will change
This commit is contained in:
+14
-3
@@ -727,7 +727,7 @@ boolean WiFiManager::startConfigPortal(char const *apName, char const *apPasswo
|
||||
|
||||
if(!_configPortalIsBlocking){
|
||||
#ifdef WM_DEBUG_LEVEL
|
||||
DEBUG_WM(DEBUG_VERBOSE,F("Config Portal Running, non blocking/processing"));
|
||||
DEBUG_WM(DEBUG_VERBOSE,F("Config Portal Running, non blocking (processing)"));
|
||||
if(_configPortalTimeout > 0) DEBUG_WM(DEBUG_VERBOSE,F("Portal Timeout In"),(String)(_configPortalTimeout/1000) + (String)F(" seconds"));
|
||||
#endif
|
||||
return result; // skip blocking loop
|
||||
@@ -850,7 +850,7 @@ uint8_t WiFiManager::processConfigPortal(){
|
||||
_savewificallback();
|
||||
}
|
||||
if(!_connectonsave) return WL_IDLE_STATUS;
|
||||
shutdownConfigPortal();
|
||||
if(_disableConfigPortal) shutdownConfigPortal();
|
||||
return WL_CONNECTED; // CONNECT SUCCESS
|
||||
}
|
||||
#ifdef WM_DEBUG_LEVEL
|
||||
@@ -869,7 +869,7 @@ uint8_t WiFiManager::processConfigPortal(){
|
||||
#endif
|
||||
_savewificallback();
|
||||
}
|
||||
shutdownConfigPortal();
|
||||
if(_disableConfigPortal) shutdownConfigPortal();
|
||||
return WL_CONNECT_FAILED; // CONNECT FAIL
|
||||
}
|
||||
else if(_configPortalIsBlocking){
|
||||
@@ -2899,6 +2899,17 @@ void WiFiManager::setEnableConfigPortal(boolean enable)
|
||||
_enableConfigPortal = enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* toggle configportal if autoconnect failed
|
||||
* if enabled, then the configportal will be de-activated on wifi save
|
||||
* @since $dev
|
||||
* @access public
|
||||
* @param boolean enabled [true]
|
||||
*/
|
||||
void WiFiManager::setDisableConfigPortal(boolean enable)
|
||||
{
|
||||
_disableConfigPortal = enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the hostname (dhcp client id)
|
||||
|
||||
Reference in New Issue
Block a user