mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Updated ScanNetworks to include RSSI and Encryption type for each network
This commit is contained in:
parent
0ddbfd0e95
commit
45ab1504ac
@ -10,7 +10,7 @@
|
||||
|
||||
created 13 July 2010
|
||||
by dlf (Metodo2 srl)
|
||||
modified 1 Mar 2012
|
||||
modified 4 Mar 2012
|
||||
by Tom Igoe
|
||||
*/
|
||||
|
||||
@ -24,10 +24,9 @@ void setup() {
|
||||
|
||||
// attempt to connect using WEP encryption:
|
||||
Serial.println("Initializing Wifi...");
|
||||
WiFi.begin("networName");
|
||||
//WiFi.begin("no network");
|
||||
printMacAddress();
|
||||
|
||||
|
||||
// scan for existing networks:
|
||||
Serial.println("Scanning available networks...");
|
||||
scanNetworks();
|
||||
@ -68,11 +67,16 @@ void scanNetworks() {
|
||||
// print the list of networks seen:
|
||||
Serial.print("SSID List:");
|
||||
Serial.println(numSsid);
|
||||
Serial.println("#\tNetwork:\tRSSI:\tEncryption:");
|
||||
// print the network number and name for each network found:
|
||||
for (int thisNet = 0; thisNet<numSsid; thisNet++) {
|
||||
Serial.print(thisNet);
|
||||
Serial.print(") Network: ");
|
||||
Serial.println(WiFi.SSID(thisNet));
|
||||
Serial.print(")\t");
|
||||
Serial.print(WiFi.SSID(thisNet));
|
||||
Serial.print("\t");
|
||||
Serial.print(WiFi.RSSI(thisNet));
|
||||
Serial.print("\t");
|
||||
Serial.println(WiFi.encryptionType(thisNet));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user