mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Updated ScanNetworks example to give network encryption types by name
This commit is contained in:
@ -10,8 +10,8 @@
|
||||
|
||||
created 13 July 2010
|
||||
by dlf (Metodo2 srl)
|
||||
modified 31 May 2012
|
||||
by Tom Igoe
|
||||
modified 21 Junn 2012
|
||||
by Tom Igoe and Jaymes Dec
|
||||
*/
|
||||
|
||||
|
||||
@ -90,7 +90,28 @@ void listNetworks() {
|
||||
Serial.print(WiFi.RSSI(thisNet));
|
||||
Serial.print(" dBm");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user