Skip to content

Commit 6119a9e

Browse files
author
tablatronix
committed
refactor #1199
1 parent 9eac697 commit 6119a9e

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

WiFiManager.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,22 @@ void WiFiManager::setShowInfoUpdate(boolean enabled){
27572757
_showInfoUpdate = enabled;
27582758
}
27592759

2760+
/**
2761+
* check if the config portal is running
2762+
* @return bool true if active
2763+
*/
2764+
bool WiFiManager::getConfigPortalActive(){
2765+
return configPortalActive;
2766+
}
2767+
2768+
/**
2769+
* [getConfigPortalActive description]
2770+
* @return bool true if active
2771+
*/
2772+
bool WiFiManager::getWebPortalActive(){
2773+
return webPortalActive;
2774+
}
2775+
27602776
/**
27612777
* set menu items and order
27622778
* if param is present in menu , params will be removed from wifi page automatically

WiFiManager.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ class WiFiManager
361361
// set port of webserver, 80
362362
void setHttpPort(uint16_t port);
363363

364+
// check if config portal is active (true)
365+
bool getConfigPortalActive();
366+
367+
// check if web portal is active (true)
368+
bool getWebPortalActive();
369+
364370
std::unique_ptr<DNSServer> dnsServer;
365371

366372
#if defined(ESP32) && defined(WM_WEBSERVERSHIM)
@@ -640,10 +646,7 @@ class WiFiManager
640646
// DEBUG_WM("NO fromString METHOD ON IPAddress, you need ESP8266 core 2.1.0 or newer for Custom IP configuration to work.");
641647
return false;
642648
}
643-
644-
public:
645-
inline bool isConfigPortalActive() { return configPortalActive; }
646-
inline bool isWebPortalActive() { return webPortalActive; }
649+
647650
};
648651

649652
#endif

0 commit comments

Comments
 (0)