双向 Android Beam

发布于 2024-12-22 23:40:20 字数 333 浏览 6 评论 0原文

以下是我尝试对 2 个运行 Android 4.0 且具有 NFC 功能的 Galaxy Nexus 执行的操作:

  • 设备 A 和 B 距离足够近,可以启动 Android Beam UI。
  • 设备 A 向设备 B 发送波束
  • 设备 B 接收到波束,进行一些处理,然后将响应波束发送回设备 A

我具有来自 A 的初始波束 -> 设备 A 向设备 B 发送波束。 B 工作正常,但无法回复通讯。我确实想发送一些不仅仅是“ACK”的东西,比如少量的数据负载。有没有办法使用当前的 API 通过 NFC 来完成此操作,还是我必须寻求 WiFi/BT p2p 通信?

Here's what I'm trying to do with 2 Galaxy Nexuses running Android 4.0 with NFC capabilities:

  • Device A and B are in close enough to initiate an Android Beam UI.
  • Device A sends a beam to Device B
  • Device B received beam, does some processing, and then sends a response beam back to device A

I have the initial beam from A -> B working fine but not the communication back. I do want to send something more than just an 'ACk', like a small payload of data. Is there any way to do this over NFC with the current APIs or will I have to look towards WiFi/BT p2p communication?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

任谁 2024-12-29 23:40:20

我认为这是不可能的,除非您将设备拆开,然后再次将它们放在一起,并通过触摸传输 UI 显式地将数据从设备 B 传输到 A。不过,您可以使用 NFC 启动 BT 连接并完成工作。

I don't think this is possible unless you pull the devices apart then put them together again and explicitly beam data from Device B to A with the touch to beam UI. You can use NFC to initiate a BT connection though and get the job done.

莫多说 2024-12-29 23:40:20

目前,(不幸的是)点对点模式只能通过 Android Beam 在 Android 上访问,它不能用于双向通信。
如果你想实现真正的双向通信,你可以更好地使用读写器和读写器。卡模拟模式。
模拟 ISO/IEC 14443-4 标签时,您可以使用 APDU 命令(请参阅 ISO/IEC 7816-4)发送双向信息。

For now, (unfortunately) peer-to-peer mode is only accessible on Android through Android Beam, which can't be used for bi-directional communication.
If you want to archieve true bi-directional communication, you can better use reader/writer & card-emulation modes.
When emulate a ISO/IEC 14443-4 tag, you can use APDU commands (see ISO/IEC 7816-4) to send bi-directional information.

请叫√我孤独 2024-12-29 23:40:20

当两个设备彼此靠近时,您可以在 B 设备上显示 toast,以确保它收到 NDEf 消息

while the two devices are close to each other you can show a toast at B device to ensure it receive the NDEf message

情深如许 2024-12-29 23:40:20

我自己没有尝试过,但您也许可以通过在读卡器/写入器模式下使用一部手机,在基于主机的卡模拟模式 (HCE) 下使用另一部手机来实现某种形式的双向通信。另请参阅此线程:NFC 读取器/写入器模式 - 是否唯一对于标签?

I have not tried that myself, but you might be able to acheive a form of bi-directional communication by using one phone in reader/writer mode and the other phone in host based card emulation mode (HCE). See also this thread: NFC reader/writer mode - is it only for tags?.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文