Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable wps by default, enable if its enabled in core #645

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,15 @@ uint8_t WiFiManager::connectWifi(String ssid, String pass) {

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

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

if(connRes != WL_SCAN_COMPLETED){
updateConxResult(connRes);
Expand Down Expand Up @@ -782,6 +784,7 @@ uint8_t WiFiManager::waitForConnectResult(uint16_t timeout) {
return status;
}

#ifdef NO_EXTRA_4K_HEAP
void WiFiManager::startWPS() {
DEBUG_WM(F("START WPS"));
#ifdef ESP8266
Expand All @@ -791,7 +794,7 @@ void WiFiManager::startWPS() {
#endif
DEBUG_WM(F("END WPS"));
}

#endif

String WiFiManager::getHTTPHead(String title){
String page;
Expand Down
4 changes: 4 additions & 0 deletions WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ class WiFiManager
int _staShowDns = 0; // ternary always show dns, only if not set in code, never(cannot change dns via web!)
boolean _removeDuplicateAPs = true; // remove dup aps from wifiscan
boolean _shouldBreakAfterConfig = false; // stop configportal on save failure
#ifdef NO_EXTRA_4K_HEAP
boolean _tryWPS = false; // try WPS on save failure, unsupported
#endif
boolean _configPortalIsBlocking = true; // configportal enters blocking loop
boolean _enableCaptivePortal = true; // enable captive portal redirection
boolean _userpersistent = true; // users preffered persistence to restore
Expand All @@ -316,7 +318,9 @@ class WiFiManager
void _end();

void setupConfigPortal();
#ifdef NO_EXTRA_4K_HEAP
void startWPS();
#endif
bool startAP();

uint8_t connectWifi(String ssid, String pass);
Expand Down