mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-15 15:41:21 +10:00
cleanconnect
This commit is contained in:
+1
-1
@@ -652,7 +652,7 @@ uint8_t WiFiManager::connectWifi(String ssid, String pass) {
|
||||
//@todo catch failures in set_config
|
||||
|
||||
// make sure sta is on before `begin` so it does not call enablesta->mode while persistent is ON ( which would save WM AP state to eeprom !)
|
||||
WiFi_Disconnect(); // disconnect before begin, in case anything is hung, this causes a 2 seconds delay for connect
|
||||
if(cleanConnect) WiFi_Disconnect(); // disconnect before begin, in case anything is hung, this causes a 2 seconds delay for connect
|
||||
|
||||
// if ssid argument provided connect to that
|
||||
if (ssid != "") {
|
||||
|
||||
@@ -283,6 +283,7 @@ class WiFiManager
|
||||
int _numNetworks = 0;
|
||||
unsigned long _lastscan = 0; // ms
|
||||
int _cpclosedelay = 2000; // delay before wifisave, prevents captive portal from closing to fast.
|
||||
bool _cleanConnect = true; // disconnect before connect in connectwifi, increases stability on connects
|
||||
|
||||
#ifdef ESP32
|
||||
static uint8_t _lastconxresulttmp; // tmp var for esp32 callback
|
||||
|
||||
Reference in New Issue
Block a user