Made conforming changes to setVerboseWiFiReconnect

This commit is contained in:
Gregg 2023-10-28 18:40:04 -05:00
parent a93aef1604
commit 5ce7211539
3 changed files with 6 additions and 4 deletions

View File

@ -408,7 +408,8 @@ void Span::checkConnect(){
LOG0("\n*** Can't connect to %s. You may type 'W <return>' to re-configure WiFi, or 'X <return>' to erase WiFi credentials. Will try connecting again in 60 seconds.\n\n",network.wifiData.ssid); LOG0("\n*** Can't connect to %s. You may type 'W <return>' to re-configure WiFi, or 'X <return>' to erase WiFi credentials. Will try connecting again in 60 seconds.\n\n",network.wifiData.ssid);
waitTime=60000; waitTime=60000;
} else { } else {
if (verboseWiFiReconnect) addWebLog(true,"Trying to connect to %s. Waiting %d sec...",network.wifiData.ssid,waitTime/1000); if(verboseWifiReconnect)
addWebLog(true,"Trying to connect to %s. Waiting %d sec...",network.wifiData.ssid,waitTime/1000);
WiFi.begin(network.wifiData.ssid,network.wifiData.pwd); WiFi.begin(network.wifiData.ssid,network.wifiData.pwd);
} }

View File

@ -246,7 +246,7 @@ class Span{
Network network; // configures WiFi and Setup Code via either serial monitor or temporary Access Point Network network; // configures WiFi and Setup Code via either serial monitor or temporary Access Point
SpanWebLog webLog; // optional web status/log SpanWebLog webLog; // optional web status/log
TaskHandle_t pollTaskHandle = NULL; // optional task handle to use for poll() function TaskHandle_t pollTaskHandle = NULL; // optional task handle to use for poll() function
boolean verboseWiFiReconnect = true; // Set to false to not print WiFi reconnect attempts messages boolean verboseWifiReconnect = true; // set to false to not print WiFi reconnect attempts messages
SpanOTA spanOTA; // manages OTA process SpanOTA spanOTA; // manages OTA process
SpanConfig hapConfig; // track configuration changes to the HAP Accessory database; used to increment the configuration number (c#) when changes found SpanConfig hapConfig; // track configuration changes to the HAP Accessory database; used to increment the configuration number (c#) when changes found
@ -353,7 +353,7 @@ class Span{
Span& setWebLogCSS(const char *css){webLog.css="\n" + String(css) + "\n";return(*this);} Span& setWebLogCSS(const char *css){webLog.css="\n" + String(css) + "\n";return(*this);}
Span& setWebLogCallback(void (*f)(String &)){weblogCallback=f;return(*this);} Span& setWebLogCallback(void (*f)(String &)){weblogCallback=f;return(*this);}
void setVerboseWiFiReconnect(bool verbose) { verboseWiFiReconnect = verbose;} Span& setVerboseWifiReconnect(bool verbose=true){verboseWifiReconnect=verbose;return(*this);}
void autoPoll(uint32_t stackSize=8192, uint32_t priority=1, uint32_t cpu=0){ // start pollTask() void autoPoll(uint32_t stackSize=8192, uint32_t priority=1, uint32_t cpu=0){ // start pollTask()
xTaskCreateUniversal([](void *parms){for(;;)homeSpan.pollTask();}, "pollTask", stackSize, NULL, priority, &pollTaskHandle, cpu); xTaskCreateUniversal([](void *parms){for(;;)homeSpan.pollTask();}, "pollTask", stackSize, NULL, priority, &pollTaskHandle, cpu);

View File

@ -74,7 +74,8 @@ void setup() {
// homeSpan.enableOTA(); // homeSpan.enableOTA();
homeSpan.setWifiCallback(wifiCB); homeSpan.setWifiCallback(wifiCB);
homeSpan.setWifiCallbackAll(wifiCB_ALL); homeSpan.setWifiCallbackAll(wifiCB_ALL).setVerboseWifiReconnect(false);
new SpanUserCommand('D', " - disconnect WiFi", [](const char *buf){WiFi.disconnect();}); new SpanUserCommand('D', " - disconnect WiFi", [](const char *buf){WiFi.disconnect();});