Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 12f57c9

Browse files
authored
Merge pull request #2 from smoca-ag/adding_flag
Adding flag
2 parents e1c7518 + de0515b commit 12f57c9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ESPAsync_WiFiManager-Impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ void ESPAsync_WiFiManager::scan()
622622

623623
//////////////////////////////////////////
624624

625-
void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword)
625+
void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword, bool shouldConnectWiFi = true)
626626
{
627627
_modeless = true;
628628
_apName = apName;
@@ -633,7 +633,7 @@ void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char co
633633
LOGDEBUG("SET AP STA");
634634

635635
// try to connect
636-
if (connectWifi("", "") == WL_CONNECTED)
636+
if (shouldConnectWiFi && connectWifi("", "") == WL_CONNECTED)
637637
{
638638
LOGDEBUG1(F("IP Address:"), WiFi.localIP());
639639

src_h/ESPAsync_WiFiManager-Impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ void ESPAsync_WiFiManager::scan()
622622

623623
//////////////////////////////////////////
624624

625-
void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword)
625+
void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword, bool shouldConnectWiFi = true)
626626
{
627627
_modeless = true;
628628
_apName = apName;
@@ -633,7 +633,7 @@ void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char co
633633
LOGDEBUG("SET AP STA");
634634

635635
// try to connect
636-
if (connectWifi("", "") == WL_CONNECTED)
636+
if (shouldConnectWiFi && connectWifi("", "") == WL_CONNECTED)
637637
{
638638
LOGDEBUG1(F("IP Address:"), WiFi.localIP());
639639

0 commit comments

Comments
 (0)