mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-11 22:24:13 +01:00
Updated ScanNetworks example to give network encryption types by name
This commit is contained in:
parent
056895d1f9
commit
156c102c0d
@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
created 13 July 2010
|
created 13 July 2010
|
||||||
by dlf (Metodo2 srl)
|
by dlf (Metodo2 srl)
|
||||||
modified 31 May 2012
|
modified 21 Junn 2012
|
||||||
by Tom Igoe
|
by Tom Igoe and Jaymes Dec
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -90,7 +90,28 @@ void listNetworks() {
|
|||||||
Serial.print(WiFi.RSSI(thisNet));
|
Serial.print(WiFi.RSSI(thisNet));
|
||||||
Serial.print(" dBm");
|
Serial.print(" dBm");
|
||||||
Serial.print("\tEncryption: ");
|
Serial.print("\tEncryption: ");
|
||||||
Serial.println(WiFi.encryptionType(thisNet));
|
printEncryptionType(WiFi.encryptionType(thisNet));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void printEncryptionType(int thisType) {
|
||||||
|
// read the encryption type and print out the name:
|
||||||
|
switch (thisType) {
|
||||||
|
case ENC_TYPE_WEP:
|
||||||
|
Serial.println("WEP");
|
||||||
|
break;
|
||||||
|
case ENC_TYPE_TKIP:
|
||||||
|
Serial.println("WPA");
|
||||||
|
break;
|
||||||
|
case ENC_TYPE_CCMP:
|
||||||
|
Serial.println("WPA2");
|
||||||
|
break;
|
||||||
|
case ENC_TYPE_NONE:
|
||||||
|
Serial.println("None");
|
||||||
|
break;
|
||||||
|
case ENC_TYPE_AUTO:
|
||||||
|
Serial.println("Auto");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user