注册 登录
自由的生活_软路由 返回首页

11的个人空间 https://bbs.routerclub.com/?499 [收藏] [复制] [分享] [RSS]

日志

在android 4.0中允许ad-hoc

已有 1895 次阅读2012-5-1 15:57

I have made following changes in to my android source code make ad-hoc wifi connection in Android 4.0 with wpa_supplicant_8:

1.    In WifiSettings.java file comment the code that does not allow to display IBSS type of stations:

// Ignore hidden and ad-hoc networks.
                if (result.SSID == null || result.SSID.length() == 0) { // ||
                        //result.capabilities.contains(“[IBSS]“)) { 
                    continue;
                }

Location of that file is  packages/apps/Settings/src/com/android/settings/wifi

2.    In wpa_supplicant_8 change the wpa_supplicatn/events.c file :

static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
                                            int i, struct wpa_scan_res *bss,
                                            struct wpa_ssid *group) {

….

if (bss->caps & IEEE80211_CAP_IBSS) {
wpa_dbg(wpa_s, MSG_DEBUG, “   skip – IBSS (adhoc) “
“network”);
//continue;   //Allow IBSS connection.
}

….

}

After making the above changes i was able to connect to ad-hoc stations. ( i have tried with my tethered iphone). Another method to make ad-hoc connection is add the network information in wpa_supplicant.conf file.


路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-6-1 20:54 , Processed in 0.039970 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

返回顶部