mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-18 00:41:43 +10:00
add setEnableConfigPortal(boolean enable) - if false dont open condig portal from autoConnect()
This commit is contained in:
+20
-1
@@ -259,6 +259,12 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// possibly skip the config portal
|
||||
if (!_enableConfigPortal) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// not connected start configportal
|
||||
return startConfigPortal(apName, apPassword);
|
||||
}
|
||||
@@ -1931,6 +1937,19 @@ void WiFiManager::setScanDispPerc(boolean enabled){
|
||||
_scanDispOptions = enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* toggle configportal if autoconnect failed
|
||||
* if enabled, then the configportal will be activated on autoconnect failure
|
||||
* @since $dev
|
||||
* @access public
|
||||
* @param boolean enabled [true]
|
||||
*/
|
||||
void WiFiManager::setEnableConfigPortal(boolean enable)
|
||||
{
|
||||
_enableConfigPortal = enable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set the hostname (dhcp client id)
|
||||
* @since $dev
|
||||
@@ -2313,4 +2332,4 @@ void WiFiManager::WiFi_autoReconnect(){
|
||||
WiFi.onEvent(WiFiEvent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user