chaange setCaptivePortalClientCheck to setAPClientCheck

This commit is contained in:
tablatronix
2018-10-31 14:15:02 -05:00
parent 370be061e4
commit 38b6c878a2
3 changed files with 7 additions and 6 deletions
+3 -3
View File
@@ -416,7 +416,7 @@ void WiFiManager::stopWebPortal() {
boolean WiFiManager::configPortalHasTimeout(){
if(_configPortalTimeout == 0 || (_cpClientCheck && (WiFi_softap_num_stations() > 0))){
if(_configPortalTimeout == 0 || (_apClientCheck && (WiFi_softap_num_stations() > 0))){
if(millis() - timer > 30000){
timer = millis();
DEBUG_WM(DEBUG_VERBOSE,"NUM CLIENTS: " + (String)WiFi_softap_num_stations());
@@ -2175,8 +2175,8 @@ void WiFiManager::setWiFiAutoReconnect(boolean enabled){
* @access public
* @param boolean enabled [false]
*/
void WiFiManager::setCaptivePortalClientCheck(boolean enabled){
_cpClientCheck = enabled;
void WiFiManager::setAPClientCheck(boolean enabled){
_apClientCheck = enabled;
}
/**
+3 -3
View File
@@ -237,8 +237,8 @@ class WiFiManager
void setShowDnsFields(boolean alwaysShow);
//if false, disable captive portal redirection
void setCaptivePortalEnable(boolean enabled);
//if false, timeout captive portal even if a STA client connected (false), suggest disabling if captiveportal is open
void setCaptivePortalClientCheck(boolean enabled);
//if false, timeout captive portal even if a STA client connected to softAP (false), suggest disabling if captiveportal is open
void setAPClientCheck(boolean enabled);
//if true, reset timeout when webclient connects (true), suggest disabling if captiveportal is open
void setWebPortalClientCheck(boolean enabled);
// if true, enable autoreconnecting
@@ -344,7 +344,7 @@ class WiFiManager
boolean _enableCaptivePortal = true; // enable captive portal redirection
boolean _userpersistent = true; // users preffered persistence to restore
boolean _wifiAutoReconnect = true; // there is no platform getter for this, we must assume its true and make it so
boolean _cpClientCheck = false; // keep cp alive if cp have station
boolean _apClientCheck = false; // keep cp alive if ap have station
boolean _webClientCheck = true; // keep cp alive if web have client
boolean _scanDispOptions = false; // show percentage in scans not icons
boolean _paramsInWifi = true; // show custom parameters on wifi page
+1
View File
@@ -45,6 +45,7 @@ void setup() {
// wm.setConnectTimeout(20); // how long to try to connect for before continuing
wm.setConfigPortalTimeout(30); // auto close configportal after n seconds
// wm.setCaptivePortalEnable(false); // disable captive portal redirection
// wm.setAPClientCheck(true); // avoid timeout if client connected to softap
// wifi scan settings
// wm.setRemoveDuplicateAPs(false); // do not remove duplicate ap names (true)