开发者

How to determine security types, like WPA, WPA2, WEP, using Apple80211?

I can scan and get the Wifi list in iPhoneOS4.0.

At this time, I neet to determine security types of each Wifi access point. How can I do that using the value of "CAPABILITIES" key 开发者_JAVA技巧of scanned result's NSDicionary? 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?


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";
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜