rohitsynsoft / iphone-wireless

Automatically exported from code.google.com/p/iphone-wireless
0 stars 0 forks source link

How can I know security type using CAPABILITIES? #39

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have scanned and get the Wifi access point lists.

At this time, I wish to determine the CAPABILITIES, security types. 
How can I do that using it? Which one is one of NONE, WPA, WPA2, WEP? 
The value of CAPABILITIES is 1057, 1025,34,33,2,1073,1041 and 3121, etc... 
It is too various. I don't know what it represents. 
I am using "WEP" and "WPA_IE" key to obtain Boolean for NSDictionary, but It is 
not enough.

Anyone know how to do?

Original issue reported on code.google.com by kikyoung...@gmail.com on 25 Aug 2010 at 11:16

GoogleCodeExporter commented 8 years ago
I have found out the solution. Have a look the below. You can do more details 
using the wep, wpa, rsn. Thanks.

int adhoc = [network objectForKey:@"AP_MODE"];

if (adhoc == 1) {

ret =@"AdHoc network";

} else {

id wep = [network objectForKey:@"WEP"];

id wpa = [network objectForKey:@"WPA_IE"];

id rsn = [network objectForKey:@"RSN_IE"];

if(wep) {
    ret =@"Secured network (WEP)";
} else if (wpa && rsn) {
    ret =@"Secured network (WPA, WPA2)";
} else if (wpa) {
    ret =@"Secured network (WPA)";
} else if (rsn) {
    ret =@"Secured network (WPA2)";
} else {
    ret =@"Open Network";
}

}

Original comment by kikyoung...@gmail.com on 16 Sep 2010 at 12:49

GoogleCodeExporter commented 8 years ago
kikyound's code is work,thx!

Original comment by bruce_...@163.com on 8 Aug 2012 at 3:24