Not tested, not sure if captive portal works with hidden ap, test please.
adds wm.setWiFiAPHidden(bool);
This commit is contained in:
tablatronix
2019-10-30 08:55:24 -05:00
parent 4014daeb71
commit a2355889ba
3 changed files with 20 additions and 5 deletions
+14 -4
View File
@@ -371,20 +371,21 @@ bool WiFiManager::startAP(){
}
// start soft AP with password or anonymous
// default channel is 1 here and in esplib, @todo just change to default remove conditionals
if (_apPassword != "") {
if(channel>0){
ret = WiFi.softAP(_apName.c_str(), _apPassword.c_str(),channel);
ret = WiFi.softAP(_apName.c_str(), _apPassword.c_str(),channel,_apHidden);
}
else{
ret = WiFi.softAP(_apName.c_str(), _apPassword.c_str());//password option
ret = WiFi.softAP(_apName.c_str(), _apPassword.c_str(),1,_apHidden);//password option
}
} else {
DEBUG_WM(DEBUG_VERBOSE,F("AP has anonymous access!"));
if(channel>0){
ret = WiFi.softAP(_apName.c_str(),"",channel);
ret = WiFi.softAP(_apName.c_str(),"",channel,_apHidden);
}
else{
ret = WiFi.softAP(_apName.c_str());
ret = WiFi.softAP(_apName.c_str(),"",1,_apHidden);
}
}
@@ -2285,6 +2286,15 @@ void WiFiManager::setWiFiAPChannel(int32_t channel){
_apChannel = channel;
}
/**
* set the soft ap hidden
* @param bool wifi ap hidden, default is false
*/
void WiFiManager::setWiFiAPHidden(bool hidden){
_apHidden = hidden;
}
/**
* toggle showing erase wifi config button on info page
* @param boolean enabled