Android 中的多路复用热点 [英] Multiplexed hotspot in Android

查看:54
本文介绍了Android 中的多路复用热点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 wifi API 在 Android 中编写一个应用程序,该应用程序将充当热点(因此授予对 wifi 客户端的网络访问权限),同时仍允许本地 wifi 设备连接到另一个 wifi 网络?

Is it possible to write an app in Android using the wifi API which will act like a hotspot (so granting network access to wifi clients) while still allowing the local wifi device to connect to another wifi network ?

我测试过的是禁用本地 Wifi 连接以创建热点.

The one I've tested are disabling local Wifi connection in order to create a hotspot.

推荐答案

几个月后我在此发帖,希望对希望在 Android 设备上实施此功能的人有所帮助.

I post here after a few months so people that would like to implement this on an Android device might be helped.

有一种方法可以让一个无线芯片在混合模式下工作,同时启用站模式 (STA) 和接入点模式 (AP).

There is a way to have one wireless chip working in hybrid mode, with both station mode (STA) and access point mode (AP) enabled.

为此,我用multi-role无线驱动程序替换了我芯片的无线驱动程序.幸运的是,我的芯片支持这种模式,但并非每个无线芯片都支持这种模式.我的芯片是基于 TI 的芯片 (wl1271),支持多角色,尽管以前的驱动程序不可用.

To do this, I replaced the wireless driver of my chip with a multi-role wireless driver. Luckily enough, my chip was supporting this mode, it is however not the case for every wireless chips. My chip being a TI based chip (wl1271), multi role was supported, though it was not available with the previous driver.

一旦我得到了这个新的驱动程序,我必须将它与我的内核一起重新编译,以便获得无线驱动程序的 .ko 和相关的 mac80211 和 <生成的 code>cfg80211 模块(提供新驱动程序所需的 API).最后一步是使用 TI 提供的自定义补丁版本升级 wpa_supplicanthostapd.

Once I got this new driver, I had to recompile it along with my kernel in order to have the .ko of the wireless driver and the related mac80211 and cfg80211 modules (providing the APIs needed by the new driver) generated. The last step was to upgrade wpa_supplicant and hostapd with a custom patched version provided by TI.

同样,对于wl1271感兴趣的人,这里是我使用并报告在Android 4.0.4 ICS上工作的相应驱动程序/工具:

Again, for people interested in wl1271 only here are the corresponding drivers/tools I used and reported working on Android 4.0.4 ICS :

https://github.com/TI-OpenLink/hostap/树/ol_R5.SP3.01

https://github.com/TI-OpenLink/iw/树/ol_R5.SP3.01

https://github.com/TI-OpenLink/ti-utils/tree/ol_R5.SP3.01

https://github.com/TI-OpenLink/wl12xx_target_scripts/tree/ol_R5.SP3.01/sta

https://github.com/TI-OpenLink/compat/tree/ol_R5.SP3.01/

https://github.com/TI-OpenLink/compat-wireless/tree/ol_R5.SP3.01/

如果您的无线芯片有一个多角色驱动程序,那么找出您将使用的 wpa_supplicant 和 hostapd 的版本或补丁,并编译/试用它们可能是值得的.

If there is a multi role driver for your wireless chip, it might be worth it finding out what version or patches of wpa_supplicant and hostapd you shall use, and compile/try them.

在该过程结束时,我可以访问两个网络接口(wlan0 和 wlan1),并且可以在 wlan0 上启动 wpa_supplicant,在 wlan1 上启动 hostapd.

At the end of the process, I had access to two network interfaces (wlan0 and wlan1), and could launch wpa_supplicant on wlan0 and hostapd on wlan1.

这篇关于Android 中的多路复用热点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆