mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-22 10:42:10 +10:00
keep portal open if connectonsave is false
Not sure if this is a good idea or bad one.. probably better than closing it automatically.
This commit is contained in:
+13
-9
@@ -811,8 +811,8 @@ uint8_t WiFiManager::processConfigPortal(){
|
|||||||
if ( _savewificallback != NULL) {
|
if ( _savewificallback != NULL) {
|
||||||
_savewificallback();
|
_savewificallback();
|
||||||
}
|
}
|
||||||
shutdownConfigPortal();
|
|
||||||
if(!_connectonsave) return WL_IDLE_STATUS;
|
if(!_connectonsave) return WL_IDLE_STATUS;
|
||||||
|
shutdownConfigPortal();
|
||||||
return WL_CONNECTED; // CONNECT SUCCESS
|
return WL_CONNECTED; // CONNECT SUCCESS
|
||||||
}
|
}
|
||||||
#ifdef WM_DEBUG_LEVEL
|
#ifdef WM_DEBUG_LEVEL
|
||||||
@@ -944,12 +944,16 @@ uint8_t WiFiManager::connectWifi(String ssid, String pass, bool connect) {
|
|||||||
// if ssid argument provided connect to that
|
// if ssid argument provided connect to that
|
||||||
if (ssid != "") {
|
if (ssid != "") {
|
||||||
wifiConnectNew(ssid,pass,connect);
|
wifiConnectNew(ssid,pass,connect);
|
||||||
if(_saveTimeout > 0){
|
// @todo connect=false seems to disconnect sta in begin() so not sure if _connectonsave is useful at all
|
||||||
connRes = waitForConnectResult(_saveTimeout); // use default save timeout for saves to prevent bugs in esp->waitforconnectresult loop
|
// skip wait if not connecting
|
||||||
}
|
// if(connect){
|
||||||
else {
|
if(_saveTimeout > 0){
|
||||||
connRes = waitForConnectResult(0);
|
connRes = waitForConnectResult(_saveTimeout); // use default save timeout for saves to prevent bugs in esp->waitforconnectresult loop
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
connRes = waitForConnectResult(0);
|
||||||
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// connect using saved ssid if there is one
|
// connect using saved ssid if there is one
|
||||||
@@ -2053,13 +2057,13 @@ String WiFiManager::getInfoData(String id){
|
|||||||
p.replace(FPSTR(T_1),WiFi.softAPgetHostname());
|
p.replace(FPSTR(T_1),WiFi.softAPgetHostname());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef ESP8266
|
// #ifdef ESP8266
|
||||||
#ifndef WM_NOSOFTAPSSID
|
#ifndef WM_NOSOFTAPSSID
|
||||||
else if(id==F("apssid")){
|
else if(id==F("apssid")){
|
||||||
p = FPSTR(HTTP_INFO_apssid);
|
p = FPSTR(HTTP_INFO_apssid);
|
||||||
p.replace(FPSTR(T_1),htmlEntities(WiFi.softAPSSID()));
|
p.replace(FPSTR(T_1),htmlEntities(WiFi.softAPSSID()));
|
||||||
}
|
}
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
#endif
|
||||||
else if(id==F("apbssid")){
|
else if(id==F("apbssid")){
|
||||||
p = FPSTR(HTTP_INFO_apbssid);
|
p = FPSTR(HTTP_INFO_apbssid);
|
||||||
|
|||||||
Reference in New Issue
Block a user