Skip to content

Commit

Permalink
Update reported network not found to include BSSID/Channel
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Dec 10, 2024
1 parent 59618a6 commit cd1ba32
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 56 deletions.
31 changes: 18 additions & 13 deletions src/network_interfaces/Wippersnapper_AIRLIFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,24 @@ class Wippersnapper_AIRLIFT : public Wippersnapper {

// User-set network not found, print scan results to serial console
WS_DEBUG_PRINTLN("ERROR: Your requested WiFi network was not found!");
WS_DEBUG_PRINT("WipperSnapper found these WiFi networks");
if (n > WS_MAX_SORTED_NETWORKS) {
WS_DEBUG_PRINT(" (only first ");
WS_DEBUG_PRINT(WS_MAX_SORTED_NETWORKS);
WS_DEBUG_PRINTLN(" used):");
} else {
WS_DEBUG_PRINTLN(":");
}
for (int i = 0; i < n; ++i) {
WS_DEBUG_PRINT(networks[i].ssid);
WS_DEBUG_PRINT(" ");
WS_DEBUG_PRINT(networks[i].rssi);
WS_DEBUG_PRINTLN("dB");
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:");
for (uint8_t i = 0; i < n; ++i)
{
WS_DEBUG_PRINT(WiFi.SSID(i));
WS_DEBUG_PRINT(" (");
uint8_t BSSID[WL_MAC_ADDR_LENGTH];
WiFi.BSSID(i, BSSID);
for (int m = 0; m < WL_MAC_ADDR_LENGTH; m++)
{
if (m != 0)
WS_DEBUG_PRINT(":");
WS_DEBUG_PRINTHEX(BSSID[m]);
}
WS_DEBUG_PRINT(") ");
WS_DEBUG_PRINT(WiFi.RSSI(i));
WS_DEBUG_PRINT("dB (ch");
WS_DEBUG_PRINT(WiFi.channel(i))
WS_DEBUG_PRINTLN(")");
}

return false;
Expand Down
31 changes: 18 additions & 13 deletions src/network_interfaces/Wippersnapper_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,24 @@ class Wippersnapper_ESP32 : public Wippersnapper {

// User-set network not found, print scan results to serial console
WS_DEBUG_PRINTLN("ERROR: Your requested WiFi network was not found!");
WS_DEBUG_PRINT("WipperSnapper found these WiFi networks");
if (n > WS_MAX_SORTED_NETWORKS) {
WS_DEBUG_PRINT(" (only first ");
WS_DEBUG_PRINT(WS_MAX_SORTED_NETWORKS);
WS_DEBUG_PRINTLN(" used):");
} else {
WS_DEBUG_PRINTLN(":");
}
for (int i = 0; i < n; ++i) {
WS_DEBUG_PRINT(networks[i].ssid);
WS_DEBUG_PRINT(" ");
WS_DEBUG_PRINT(networks[i].rssi);
WS_DEBUG_PRINTLN("dB");
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:");
for (uint8_t i = 0; i < n; ++i)
{
WS_DEBUG_PRINT(WiFi.SSID(i));
WS_DEBUG_PRINT(" (");
uint8_t BSSID[WL_MAC_ADDR_LENGTH];
WiFi.BSSID(i, BSSID);
for (int m = 0; m < WL_MAC_ADDR_LENGTH; m++)
{
if (m != 0)
WS_DEBUG_PRINT(":");
WS_DEBUG_PRINTHEX(BSSID[m]);
}
WS_DEBUG_PRINT(") ");
WS_DEBUG_PRINT(WiFi.RSSI(i));
WS_DEBUG_PRINT("dB (ch");
WS_DEBUG_PRINT(WiFi.channel(i))
WS_DEBUG_PRINTLN(")");
}

return false;
Expand Down
32 changes: 18 additions & 14 deletions src/network_interfaces/Wippersnapper_ESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,24 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
}

// User-set network not found, print scan results to serial console
WS_DEBUG_PRINTLN("ERROR: Your requested WiFi network was not found!");
WS_DEBUG_PRINT("WipperSnapper found these WiFi networks");
if (n > WS_MAX_SORTED_NETWORKS) {
WS_DEBUG_PRINT(" (only first ");
WS_DEBUG_PRINT(WS_MAX_SORTED_NETWORKS);
WS_DEBUG_PRINTLN(" used):");
} else {
WS_DEBUG_PRINTLN(":");
}
for (int i = 0; i < n; ++i) {
WS_DEBUG_PRINT(networks[i].ssid);
WS_DEBUG_PRINT(" ");
WS_DEBUG_PRINT(networks[i].rssi);
WS_DEBUG_PRINTLN("dB");
WS_DEBUG_PRINTLN("ERROR: Your WiFi network was not found!");
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:");
for (uint8_t i = 0; i < n; ++i)
{
WS_DEBUG_PRINT(WiFi.SSID(i));
WS_DEBUG_PRINT(" (");
const uint8_t* BSSID = WiFi.BSSID(i);
for (int m = 0; m < WL_MAC_ADDR_LENGTH; m++)
{
if (m != 0)
WS_DEBUG_PRINT(":");
WS_DEBUG_PRINTHEX(BSSID[m]);
}
WS_DEBUG_PRINT(") ");
WS_DEBUG_PRINT(WiFi.RSSI(i));
WS_DEBUG_PRINT("dB (ch");
WS_DEBUG_PRINT(WiFi.channel(i))
WS_DEBUG_PRINTLN(")");
}

return false;
Expand Down
31 changes: 18 additions & 13 deletions src/network_interfaces/Wippersnapper_WIFININA.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,24 @@ class Wippersnapper_WIFININA : public Wippersnapper {

// User-set network not found, print scan results to serial console
WS_DEBUG_PRINTLN("ERROR: Your requested WiFi network was not found!");
WS_DEBUG_PRINT("WipperSnapper found these WiFi networks");
if (n > WS_MAX_SORTED_NETWORKS) {
WS_DEBUG_PRINT(" (only first ");
WS_DEBUG_PRINT(WS_MAX_SORTED_NETWORKS);
WS_DEBUG_PRINTLN(" used):");
} else {
WS_DEBUG_PRINTLN(":");
}
for (int i = 0; i < n; ++i) {
WS_DEBUG_PRINT(networks[i].ssid);
WS_DEBUG_PRINT(" ");
WS_DEBUG_PRINT(networks[i].rssi);
WS_DEBUG_PRINTLN("dB");
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:");
for (uint8_t i = 0; i < n; ++i)
{
WS_DEBUG_PRINT(WiFi.SSID(i));
WS_DEBUG_PRINT(" (");
uint8_t BSSID[WL_MAC_ADDR_LENGTH];
WiFi.BSSID(i, BSSID);
for (int m = 0; m < WL_MAC_ADDR_LENGTH; m++)
{
if (m != 0)
WS_DEBUG_PRINT(":");
WS_DEBUG_PRINTHEX(BSSID[m]);
}
WS_DEBUG_PRINT(") ");
WS_DEBUG_PRINT(WiFi.RSSI(i));
WS_DEBUG_PRINT("dB (ch");
WS_DEBUG_PRINT(WiFi.channel(i))
WS_DEBUG_PRINTLN(")");
}

return false;
Expand Down
9 changes: 6 additions & 3 deletions src/network_interfaces/ws_networking_pico.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,16 @@ class ws_networking_pico : public Wippersnapper {
// User-set network not found, print scan results to serial console
WS_DEBUG_PRINTLN("ERROR: Your requested WiFi network was not found!");
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:");
for (uint8_t i = 0; i < n; ++i) {
for (uint8_t i = 0; i < n; ++i)
{
WS_DEBUG_PRINT(WiFi.SSID(i));
WS_DEBUG_PRINT(" (");
uint8_t BSSID[WL_MAC_ADDR_LENGTH];
WiFi.BSSID(i, BSSID);
for (int m = 0; m < WL_MAC_ADDR_LENGTH; ++m) {
if (m != 0) WS_DEBUG_PRINT(":");
for (int m = 0; m < WL_MAC_ADDR_LENGTH; m++)
{
if (m != 0)
WS_DEBUG_PRINT(":");
WS_DEBUG_PRINTHEX(BSSID[m]);
}
WS_DEBUG_PRINT(") ");
Expand Down

0 comments on commit cd1ba32

Please sign in to comment.