WiFi Direct (Android 4.0) with multiple (3+) devices

人走茶凉 提交于 2019-11-26 17:35:51

问题


Like here: Automatic authentication for Android WiFi Direct I want to create a mobile ad-hoc Wifi network with Android devices. But unlike the linked question above I want to use the official Android WiFi Direct API which is availabe since Android 4.0.

So is there a way to not only connect 2 devices via WiFi Direct but also three or more? So messages could be passed from one device to another using several other devices in between (therefore spanning a larger distance between the sender and receiver)?

The Wifi Direct demo only works for pairing two devices and I could not find a way to do anything else.

Thanks!


回答1:


Is there a way to not only connect 2 devices via WiFi Direct but also three or more?

Yes, the Wi-Fi Direct specifications explain it is possible to create a 1 to many connection. One of the devices will act as a group owner (think it as an access point). I have been able to create a Wi-Fi Direct network with 3 devices during some tests.

As all the devices have to be in the range of the group owner, you are sure that your message will arrive to the second client. 1st client -> group owner -> 2nd client




回答2:


Yes,there are no limits as such. We have experimented with 5-6 devices - beyond that, it wont scale very well at the moment.

Here is a video of tapestry on JellyBean - http://www.youtube.com/watch?v=6emgRvH4mTo&list=UUQmz9albYeqArJvmpmaQpGQ&index=1&feature=plcp




回答3:


You can do so using Java NIO (Non Blocking IO) There is also an option in Wifi Direct to create group, using that group, group own will be used as a server and can broadcast message. Using multiple clients and a Server, all devices can communicate with each other by utilizing group.




回答4:


To connect another device to p2p group: on GO device type:

sudo wpa_cli wps_pbc

and on the new device u want to join:

sudo wpa_cli p2p_connect <GO-MAC-address> pbc join

following this site: http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WiFi_Direct_Configuration_Scripts#Connect_in_pbc_.28Push_button_Control.29



来源:https://stackoverflow.com/questions/11251610/wifi-direct-android-4-0-with-multiple-3-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!