From c651ab4b62d2e87c89faaf28008069e23af1307f Mon Sep 17 00:00:00 2001 From: tablatronix Date: Thu, 23 Aug 2018 13:46:13 -0500 Subject: [PATCH] cleanup --- WiFiManager.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 3f94fb9..2c0d9ac 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -326,20 +326,32 @@ bool WiFiManager::startAP(){ delay(500); // workaround delay #endif + if(_channelSync){ + DEBUG_WM(DEBUG_VERBOSE,"Starting AP on channel:",WiFi.channel()); + } + // start soft AP with password or anonymous if (_apPassword != "") { - if(_channelSync) ret = WiFi.softAP(_apName.c_str(), _apPassword.c_str(),WiFi.channel()); - else ret = WiFi.softAP(_apName.c_str(), _apPassword.c_str());//password option + if(_channelSync){ + ret = WiFi.softAP(_apName.c_str(), _apPassword.c_str(),WiFi.channel()); + } + else{ + ret = WiFi.softAP(_apName.c_str(), _apPassword.c_str());//password option + } } else { DEBUG_WM(DEBUG_VERBOSE,F("AP has anonymous access!")); - if(_channelSync) ret = WiFi.softAP(_apName.c_str(),"",WiFi.channel()); - else ret = WiFi.softAP(_apName.c_str()); + if(_channelSync){ + ret = WiFi.softAP(_apName.c_str(),"",WiFi.channel()); + } + else{ + ret = WiFi.softAP(_apName.c_str()); + } } if(_debugLevel > DEBUG_DEV) debugSoftAPConfig(); if(!ret) DEBUG_WM(DEBUG_ERROR,"[ERROR] There was a problem starting the AP"); - // @tood add softAP retry here + // @todo add softAP retry here delay(500); // slight delay to make sure we get an AP IP DEBUG_WM(F("AP IP address:"),WiFi.softAPIP());