Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
4 changes: 2 additions & 2 deletions src/ESPAsync_WiFiManager-Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ void ESPAsync_WiFiManager::scan()

//////////////////////////////////////////

void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword)
void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword, bool shouldConnectWiFi)
{
_modeless = true;
_apName = apName;
Expand All @@ -633,7 +633,7 @@ void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char co
LOGDEBUG("SET AP STA");

// try to connect
if (connectWifi("", "") == WL_CONNECTED)
if (shouldConnectWiFi && connectWifi("", "") == WL_CONNECTED)
{
LOGDEBUG1(F("IP Address:"), WiFi.localIP());

Expand Down
2 changes: 1 addition & 1 deletion src/ESPAsync_WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class ESPAsync_WiFiManager
// If you want to start the config portal
bool startConfigPortal();
bool startConfigPortal(char const *apName, char const *apPassword = NULL);
void startConfigPortalModeless(char const *apName, char const *apPassword);
void startConfigPortalModeless(char const *apName, char const *apPassword, bool shouldConnectWiFi = true);


// get the AP name of the config portal, so it can be used in the callback
Expand Down
4 changes: 2 additions & 2 deletions src_cpp/ESPAsync_WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ void ESPAsync_WiFiManager::scan()

//////////////////////////////////////////

void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword)
void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword, bool shouldConnectWiFi)
{
_modeless = true;
_apName = apName;
Expand All @@ -633,7 +633,7 @@ void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char co
LOGDEBUG("SET AP STA");

// try to connect
if (connectWifi("", "") == WL_CONNECTED)
if (shouldConnectWiFi && connectWifi("", "") == WL_CONNECTED)
{
LOGDEBUG1(F("IP Address:"), WiFi.localIP());

Expand Down
2 changes: 1 addition & 1 deletion src_cpp/ESPAsync_WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class ESPAsync_WiFiManager
// If you want to start the config portal
boolean startConfigPortal();
boolean startConfigPortal(char const *apName, char const *apPassword = NULL);
void startConfigPortalModeless(char const *apName, char const *apPassword);
void startConfigPortalModeless(char const *apName, char const *apPassword, bool shouldConnectWiFi = true);


// get the AP name of the config portal, so it can be used in the callback
Expand Down
4 changes: 2 additions & 2 deletions src_h/ESPAsync_WiFiManager-Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ void ESPAsync_WiFiManager::scan()

//////////////////////////////////////////

void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword)
void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char const *apPassword, bool shouldConnectWiFi)
{
_modeless = true;
_apName = apName;
Expand All @@ -633,7 +633,7 @@ void ESPAsync_WiFiManager::startConfigPortalModeless(char const *apName, char co
LOGDEBUG("SET AP STA");

// try to connect
if (connectWifi("", "") == WL_CONNECTED)
if (shouldConnectWiFi && connectWifi("", "") == WL_CONNECTED)
{
LOGDEBUG1(F("IP Address:"), WiFi.localIP());

Expand Down
2 changes: 1 addition & 1 deletion src_h/ESPAsync_WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class ESPAsync_WiFiManager
// If you want to start the config portal
bool startConfigPortal();
bool startConfigPortal(char const *apName, char const *apPassword = NULL);
void startConfigPortalModeless(char const *apName, char const *apPassword);
void startConfigPortalModeless(char const *apName, char const *apPassword, bool shouldConnectWiFi = true);


// get the AP name of the config portal, so it can be used in the callback
Expand Down