Skip to content

Commit b9fcc8f

Browse files
authored
Merge pull request #645 from liebman/only_support_wps_if_no_extra_4k_heap_defined
disable wps by default, enable if its enabled in core
2 parents 4fdefaf + 5a06f29 commit b9fcc8f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

WiFiManager.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,15 @@ uint8_t WiFiManager::connectWifi(String ssid, String pass) {
654654

655655
DEBUG_WM(DEBUG_VERBOSE,F("Connection result:"),getWLStatusString(connRes));
656656

657+
#ifdef NO_EXTRA_4K_HEAP
657658
// do WPS, if WPS options enabled and not connected and no password was supplied
658659
// @todo this seems like wrong place for this, is it a fallback or option?
659660
if (_tryWPS && connRes != WL_CONNECTED && pass == "") {
660661
startWPS();
661662
// should be connected at the end of WPS
662663
connRes = waitForConnectResult();
663664
}
665+
#endif
664666

665667
if(connRes != WL_SCAN_COMPLETED){
666668
updateConxResult(connRes);
@@ -782,6 +784,7 @@ uint8_t WiFiManager::waitForConnectResult(uint16_t timeout) {
782784
return status;
783785
}
784786

787+
#ifdef NO_EXTRA_4K_HEAP
785788
void WiFiManager::startWPS() {
786789
DEBUG_WM(F("START WPS"));
787790
#ifdef ESP8266
@@ -791,7 +794,7 @@ void WiFiManager::startWPS() {
791794
#endif
792795
DEBUG_WM(F("END WPS"));
793796
}
794-
797+
#endif
795798

796799
String WiFiManager::getHTTPHead(String title){
797800
String page;

WiFiManager.h

+4
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ class WiFiManager
290290
int _staShowDns = 0; // ternary always show dns, only if not set in code, never(cannot change dns via web!)
291291
boolean _removeDuplicateAPs = true; // remove dup aps from wifiscan
292292
boolean _shouldBreakAfterConfig = false; // stop configportal on save failure
293+
#ifdef NO_EXTRA_4K_HEAP
293294
boolean _tryWPS = false; // try WPS on save failure, unsupported
295+
#endif
294296
boolean _configPortalIsBlocking = true; // configportal enters blocking loop
295297
boolean _enableCaptivePortal = true; // enable captive portal redirection
296298
boolean _userpersistent = true; // users preffered persistence to restore
@@ -316,7 +318,9 @@ class WiFiManager
316318
void _end();
317319

318320
void setupConfigPortal();
321+
#ifdef NO_EXTRA_4K_HEAP
319322
void startWPS();
323+
#endif
320324
bool startAP();
321325

322326
uint8_t connectWifi(String ssid, String pass);

0 commit comments

Comments
 (0)