简体   繁体   English

如何使用信标在两个Android设备之间传输数据?

[英]How to transfer data between two Android devices using Beacon?

I am trying to send text data between two Android devices using beacon. 我正在尝试使用信标在两个Android设备之间发送文本数据。 I am using Android Bluetooth Low Energy APIs to develop the application. 我正在使用Android低功耗蓝牙API开发该应用程序。 But i am stuck in reading the data. 但是我被困在读取数据中。

Whenever i am trying to set Values to the Characteristics , the other device not able to receive the data. 每当我尝试将“值”设置为“特性”时,其他设备均无法接收数据。 The Characteristics getValues return null. Characteristics getValues返回null。

I have already asked this question in other thread in Stackoverflow . 我已经在Stackoverflow的其他线程中问过这个问题。 But still again i am conveying my queries in Graphical format. 但是我还是以图形格式传达我的查询。

在此处输入图片说明

This is the above image which explains the scenario. 这是上面的图片,它说明了这种情况。

Please suggest me some solution and technique to resolve my issue. 请为我建议一些解决方案和技术来解决我的问题。

There exists two types of devices called as Bluetooth Smart Ready and Bluetooth Smart devices. 存在两种类型的设备,称为蓝牙智能就绪和蓝牙智能设备。 Beacons are Bluetooth Smart devices which can only broadcasts the data but it can never be a Transceiver. 信标是蓝牙智能设备,只能广播数据,但永远不能成为收发器。

Most "Beacon" devices only transmit messages via advertising packets and don't accept connections. 大多数“信标”设备仅通过广告包传输消息,不接受连接。 (The name kind of hints at this) Some beacon devices allow you to connect to them to modify the message they're transmitting, but I don't think there's any Beacon devices that make connections to other devices to relay messages. (名称暗示了这一点)某些信标设备允许您连接到它们以修改它们正在传输的消息,但是我认为没有任何信标设备可以与其他设备建立连接以中继消息。

So, while you may be able to connect to the Beacon to set a message, the Beacon will then send that message as a public broadcast that any device can pick up. 因此,尽管您可以连接到信标设置消息,但信标将以公共广播的形式发送该消息,任何设备都可以接听。 But again, most Beacon devices only transmit a fixed code that can't be altered. 但同样,大多数信标设备仅发送固定的代码,无法更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM