File tree Expand file tree Collapse file tree 1 file changed +26
-5
lines changed
WiFi/examples/ScanNetworks Expand file tree Collapse file tree 1 file changed +26
-5
lines changed Original file line number Diff line number Diff line change 10
10
11
11
created 13 July 2010
12
12
by dlf (Metodo2 srl)
13
- modified 31 May 2012
14
- by Tom Igoe
13
+ modified 21 Junn 2012
14
+ by Tom Igoe and Jaymes Dec
15
15
*/
16
16
17
17
@@ -24,14 +24,14 @@ void setup() {
24
24
while (!Serial) {
25
25
; // wait for serial port to connect. Needed for Leonardo only
26
26
}
27
-
27
+
28
28
// check for the presence of the shield:
29
29
if (WiFi.status () == WL_NO_SHIELD) {
30
30
Serial.println (" WiFi shield not present" );
31
31
// don't continue:
32
32
while (true );
33
33
}
34
-
34
+
35
35
// Print WiFi MAC address:
36
36
printMacAddress ();
37
37
@@ -90,9 +90,30 @@ void listNetworks() {
90
90
Serial.print (WiFi.RSSI (thisNet));
91
91
Serial.print (" dBm" );
92
92
Serial.print (" \t Encryption: " );
93
- Serial. println (WiFi.encryptionType (thisNet));
93
+ printEncryptionType (WiFi.encryptionType (thisNet));
94
94
}
95
95
}
96
96
97
+ void printEncryptionType (int thisType) {
98
+ // read the encryption type and print out the name:
99
+ switch (thisType) {
100
+ case ENC_TYPE_WEP:
101
+ Serial.println (" WEP" );
102
+ break ;
103
+ case ENC_TYPE_TKIP:
104
+ Serial.println (" WPA" );
105
+ break ;
106
+ case ENC_TYPE_CCMP:
107
+ Serial.println (" WPA2" );
108
+ break ;
109
+ case ENC_TYPE_NONE:
110
+ Serial.println (" None" );
111
+ break ;
112
+ case ENC_TYPE_AUTO:
113
+ Serial.println (" Auto" );
114
+ break ;
115
+ }
116
+ }
117
+
97
118
98
119
You can’t perform that action at this time.
0 commit comments