From 88d6850c826d125d13ada0ca70b4eb2be837cc1b Mon Sep 17 00:00:00 2001 From: Mike Schiraldi Date: Mon, 14 Mar 2022 12:31:13 -0700 Subject: [PATCH 1/2] Get side effects out of DEBUG_MSG --- src/mesh/http/WiFiAPClient.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesh/http/WiFiAPClient.cpp b/src/mesh/http/WiFiAPClient.cpp index 208bd6c25..1a858d4b2 100644 --- a/src/mesh/http/WiFiAPClient.cpp +++ b/src/mesh/http/WiFiAPClient.cpp @@ -205,11 +205,12 @@ bool initWifi(bool forceSoftAP) if (forcedSoftAP) { const char *softAPssid = "meshtasticAdmin"; const char *softAPpasswd = "12345678"; - - DEBUG_MSG("Starting (Forced) WIFI AP: ssid=%s, ok=%d\n", softAPssid, WiFi.softAP(softAPssid, softAPpasswd)); + int ok = WiFi.softAP(softAPssid, softAPpasswd); + DEBUG_MSG("Starting (Forced) WIFI AP: ssid=%s, ok=%d\n", softAPssid, ok); } else { - DEBUG_MSG("Starting WIFI AP: ssid=%s, ok=%d\n", wifiName, WiFi.softAP(wifiName, wifiPsw)); + int ok = WiFi.softAP(wifiName, wifiPsw) + DEBUG_MSG("Starting WIFI AP: ssid=%s, ok=%d\n", wifiName, ok); } WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); @@ -362,4 +363,4 @@ void handleDNSResponse() uint8_t getWifiDisconnectReason() { return wifiDisconnectReason; -} \ No newline at end of file +} From fc0eb7de466a39e5f58b44d64176b9c9b7d1d354 Mon Sep 17 00:00:00 2001 From: Mike Schiraldi Date: Mon, 14 Mar 2022 12:40:57 -0700 Subject: [PATCH 2/2] Add semicolon --- src/mesh/http/WiFiAPClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/http/WiFiAPClient.cpp b/src/mesh/http/WiFiAPClient.cpp index 1a858d4b2..afda19702 100644 --- a/src/mesh/http/WiFiAPClient.cpp +++ b/src/mesh/http/WiFiAPClient.cpp @@ -209,7 +209,7 @@ bool initWifi(bool forceSoftAP) DEBUG_MSG("Starting (Forced) WIFI AP: ssid=%s, ok=%d\n", softAPssid, ok); } else { - int ok = WiFi.softAP(wifiName, wifiPsw) + int ok = WiFi.softAP(wifiName, wifiPsw); DEBUG_MSG("Starting WIFI AP: ssid=%s, ok=%d\n", wifiName, ok); }