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

Commit

Permalink
Merge pull request #1 from smoca-ag/adding_flag
Browse files Browse the repository at this point in the history
set flag shouldConnectWiFi
  • Loading branch information
pfy committed Feb 4, 2021
2 parents 73a5027 + 73e0e7a commit e1c7518
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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
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

0 comments on commit e1c7518

Please sign in to comment.