Skip to content

Commit ac31ff9

Browse files
committed
Fix: calls to getRSSI unqualified inside Wippersnapper.cpp + only get RSSI before connect in check_valid_ssid
1 parent 0a174a9 commit ac31ff9

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

src/Wippersnapper.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,8 +2402,6 @@ void Wippersnapper::runNetFSM() {
24022402
haltError("ERROR: Unable to find WiFi network, rebooting soon...",
24032403
WS_LED_STATUS_WIFI_CONNECTING);
24042404
}
2405-
WS_DEBUG_PRINT("SSID found! RSSI: ");
2406-
WS_DEBUG_PRINTLN(WS.getRSSI());
24072405
// Attempt to connect to wireless network
24082406
maxAttempts = 5;
24092407
while (maxAttempts > 0) {
@@ -2570,7 +2568,7 @@ void Wippersnapper::pingBroker() {
25702568
}
25712569
_prv_ping = millis();
25722570
WS_DEBUG_PRINT("WiFi RSSI: ");
2573-
WS_DEBUG_PRINTLN(WS.getRSSI());
2571+
WS_DEBUG_PRINTLN(getRSSI());
25742572
}
25752573
// blink status LED every STATUS_LED_KAT_BLINK_TIME millis
25762574
if (millis() > (_prvKATBlink + STATUS_LED_KAT_BLINK_TIME)) {
@@ -2887,4 +2885,4 @@ ws_status_t Wippersnapper::run() {
28872885
WS.feedWDT();
28882886

28892887
return WS_NET_CONNECTED; // TODO: Make this funcn void!
2890-
}
2888+
}

src/network_interfaces/Wippersnapper_AIRLIFT.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ class Wippersnapper_AIRLIFT : public Wippersnapper {
120120
// Was the network within secrets.json found?
121121
for (int i = 0; i < n; ++i) {
122122
if (strcmp(_ssid, WiFi.SSID(i)) == 0) {
123+
WS_DEBUG_PRINT("SSID found! RSSI: ");
124+
WS_DEBUG_PRINTLN(WiFi.RSSI(i));
123125
return true;
124126
}
125127
}
@@ -331,7 +333,7 @@ class Wippersnapper_AIRLIFT : public Wippersnapper {
331333
_status = WS_NET_DISCONNECTED;
332334

333335
// Use the macro to retry the status check until connected / timed out
334-
int lastResult;
336+
int lastResult = -1;
335337
RETRY_FUNCTION_UNTIL_TIMEOUT(
336338
[]() -> int { return WiFi.status(); }, // Function call each cycle
337339
int, // return type

src/network_interfaces/Wippersnapper_ESP32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class Wippersnapper_ESP32 : public Wippersnapper {
110110
// Was the network within secrets.json found?
111111
for (int i = 0; i < n; ++i) {
112112
if (strcmp(_ssid, WiFi.SSID(i).c_str()) == 0) {
113+
WS_DEBUG_PRINT("SSID found! RSSI: ");
114+
WS_DEBUG_PRINTLN(WiFi.RSSI(i));
113115
return true;
114116
}
115117
}

src/network_interfaces/Wippersnapper_ESP8266.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
133133
// Was the network within secrets.json found?
134134
for (int i = 0; i < n; ++i) {
135135
if (strcmp(_ssid, WiFi.SSID(i).c_str()) == 0) {
136+
WS_DEBUG_PRINT("SSID found! RSSI: ");
137+
WS_DEBUG_PRINTLN(WiFi.RSSI(i));
136138
return true;
137139
}
138140
}

src/network_interfaces/Wippersnapper_WIFININA.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ class Wippersnapper_WIFININA : public Wippersnapper {
131131
// Was the network within secrets.json found?
132132
for (int i = 0; i < n; ++i) {
133133
if (strcmp(_ssid, WiFi.SSID(i)) == 0) {
134+
WS_DEBUG_PRINT("SSID found! RSSI: ");
135+
WS_DEBUG_PRINTLN(WiFi.RSSI(i));
134136
return true;
135137
}
136138
}

src/network_interfaces/ws_networking_pico.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ class ws_networking_pico : public Wippersnapper {
109109
// Was the network within secrets.json found?
110110
for (int i = 0; i < n; ++i) {
111111
if (strcmp(_ssid, WiFi.SSID(i)) == 0) {
112+
WS_DEBUG_PRINT("SSID found! RSSI: ");
113+
WS_DEBUG_PRINTLN(WiFi.RSSI(i));
112114
return true;
113115
}
114116
}

0 commit comments

Comments
 (0)