2016-02-05 35 views
2

我正在研究基于android的应用程序,该应用程序将在紧急情况或灾难情况下用于帮助用户执行安全疏散的路径。因此,在这方面,我需要在特定区域的用户之间建立一个网状网络。我必须在特设模式下工作才能实现。如何使用SPAN [智能手机Ad-hoc网络]框架来建立网状网络?

我搜索了很多,最后我发现,如果不在SPAN框架上工作,这是不可能的。我完全不熟悉SPAN框架。而且我不想根植智能手机,以启用ad-hoc模式。谁能帮我?

回答

0

你可能会寻找该协议并不方便标有 “临时”,这就是所谓的 “无线上网的P2P”:

文档:developer.android.com/guide/topics/connectivity/wifip2p.html

WifiP2pManager mManager; 
Channel mChannel; 
BroadcastReceiver mReceiver; 
... 
@Override 
protected void onCreate(Bundle savedInstanceState){ 
    ... 
    mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); 
    mChannel = mManager.initialize(this, getMainLooper(), null); 
    mReceiver = new WiFiDirectBroadcastReceiver(mManager, mChannel, this); 
    ... 
} 

//obtain a peer from the WifiP2pDeviceList 
WifiP2pDevice device; 
WifiP2pConfig config = new WifiP2pConfig(); 
config.deviceAddress = device.deviceAddress; 
mManager.connect(mChannel, config, new ActionListener() { 

    @Override 
    public void onSuccess() { 
     //success logic 
    } 

    @Override 
    public void onFailure(int reason) { 
     //failure logic 
    } 
}); 

希望这有助于

+0

实际上,它需要植入设备以启用ad-hoc模式。我不想对Wi-Fi芯片组的源代码进行更改。我只想知道,如果你帮助我通过SPAN框架启用ad-hoc模式。 –

+0

是的,不幸的是SPAN只是一个概念,没有关于Google的文档,除非你能找到某个地方的链接。 –

+0

Wi-Fi P2P(现在称为Wi-Fi Direct)不支持ad hoc(多跳)路由。 – boramalper

0

我发现已经在google商店上发布的类似想法,即Beamify。 也许你可以联系他们来获得一些想法。

+0

通常不鼓励链接回答。你能总结链接的内容以及它如何适用于这个问题吗? – ymbirtt