Android智能手机和其他设备之间的直接无线通信无线通信、智能手机、直接、设备

2023-09-05 10:54:50 作者:女人成就未来%

我要建立一个沟通(通过WIFI)在Android设备与其他设备(这是不是另一种的Andr​​oid智能手机,但使用C ++与WiFi设备实现)之间。我已经发现,Android提供直接无线为了直接过沟通WIFI的两个Android设备。

I want to establish a communication (via WIFI) between an Android device and another device (which is not another android smartphone but a device with wifi implemented using c++). I already found out that android provides direct wifi in order to communicate directly over wifi with two android devices.

与Android设备和其他C ++设备通过wifi我怎么能沟通(没有网络)?尤其是,我希望我的应用程序,以发现哪些是在不久的任何设备。所以,我要实现某种服务发现的。你们有什么建议来实现这一点?

How can I communicate over wifi (without a network) with an android device and another c++ device? Especially, I want my app to discover any device which is in the near. So I have to implement some kind of service discovery. What do you guys recommend to implement this?

推荐答案

为了这个工作,你必须有computer'shardware正确配置和软件必须写入该硬件进行通信。

In order for this to work, you must have the computer'shardware properly configured and your software must be written to communicate with this hardware.

在下列指南中,他们建议通过它处理从WiFi适配器的驱动程序直接接收的P2P信息iwpriv的应用程序的硬件进行通信。如果你选择这样做,你将需要学习iwpriv的是如何工作的,并能与应用程序交互。

In the following guide, they suggest communicating with the hardware via the iwpriv application which handles the p2p information received directly from the Wifi adapter's driver. If you choose to do this, you will need to learn how iwpriv works and can interact with your application.

指南:的http://dishingtech.blogspot.com/2012/01/realtek-wi-fi-direct-programming-guide.html

为了让无线直接工作在Android平板电脑,我建议以下的无线直接样品,该样品/样本/ android- /可用。此示例,您可以直接连接到其他WiFi Direct设备并传输图像。你可以稍微改变这个应用程序为您的需求,或者完全重写,如果您需要偏离太远的样本。

In order to get Wifi Direct working on an Android tablet, I suggest following the Wifi Direct sample which is available in /samples/android-/. This sample allows you to connect direct to other Wifi Direct devices and transfer an image. You can slightly alter this application for your needs, or completely rewrite it if your needs deviate too far from the sample.

伴随指南(Android版)的http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html

accompanying guide (for Android) : http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html

请注意:你仍然需要有为了一个WiFi网络,这些设备进行通信

NOTE: you will still need to have a wifi network in order for these devices to communicate