Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add [a] AP list implementation for M0 wifi #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ void print_menu() {
Serial.println("[v] Calibrate temperature sensor");
#ifdef TRANSMITTER_WIFI
Serial.println("[w] Setup wifi");
#endif
#ifdef HEATSEEK_FEATHER_WIFI_WICED
Serial.println("[a] List nearby access points");
#endif
Serial.println("[i] Setup Cell ID");
Expand Down Expand Up @@ -245,6 +243,37 @@ void enter_configuration() {
break;
}
#endif
#ifdef HEATSEEK_FEATHER_WIFI_M0
case 'a': {
int networkCount = -1;
WiFi.setPins(8, 7, 4, 2);
networkCount = WiFi.scanNetworks();

Serial.println("=========");
Serial.print("Found "); Serial.print(networkCount); Serial.println(" Networks");

for (int i = 0; i < networkCount; i++) {
Serial.println("=========");
Serial.print("SSID: "); Serial.println(WiFi.SSID(i));
Serial.print("RSSI: "); Serial.println(WiFi.RSSI(i));
Serial.print("security: ");
switch (WiFi.encryptionType(i)) {
case ENC_TYPE_WEP:
Serial.println("WEP");
case ENC_TYPE_TKIP:
Serial.println("WPA");
case ENC_TYPE_CCMP:
Serial.println("WPA2");
case ENC_TYPE_NONE:
Serial.println("None");
case ENC_TYPE_AUTO:
Serial.println("Auto");
}
}
print_menu();
break;
}
#endif
case 'i': {
char buffer[200];
int length;
Expand Down