如何将数据发送到变成 iBeacon 的 iphone? [英] How to send data to an iphone which is turned into a iBeacon?

查看:28
本文介绍了如何将数据发送到变成 iBeacon 的 iphone?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将数据发送到充当 iBeacon 的 iPhone?我正在寻找如下流程:

how is it possible to send data to an iPhone which acts as an iBeacon? I am looking for an process as the following:

  1. 搜索附近的 iBeacons
  2. 连接到一些 iBeacon
  3. 在设备之间交换数据

有谁知道如何把不同的蓝牙功能放在一起制作这可能吗?

Does anybody know how to put the different bluetooth functions together to make this possible?

提前谢谢

推荐答案

标准 iBeacons 是仅传输设备,可以被移动设备看到,但实际上并不连接"到它们或交换数据.

Standard iBeacons are transmit-only devices that can be seen by mobile devices, but don't actually "connect" to them or exchange data.

但是如果您在所有设备上都有一个应用程序以及一个网络服务来进行数据传输,您仍然可以按照您的要求进行操作.这将允许设备 A 和 B 在它们附近时相互检测并交换数据.方法如下:

But you can still do what you are asking if you have an app on all devices as well as a web service to do the data transfer. This would allow devices A and B to detect each other when they are nearby and exchange data. Here's how:

  1. 您在设备 A 和 B 上的应用在充当 iBeacon(使用特定于应用的标识符和特定于手机的标识符来宣传其存在)和测距包括特定于应用的标识符在内的 iBeacon 信号之间交替.
  2. 在其测距周期内,您在设备 A 上的应用会检测到来自设备 B 的 iBeacon 传输,其中包括您的应用标识符和 B 的设备标识符.
  3. 然后,应用 A 对源为A"、目的地为B"的网络服务进行写入"调用,以及您要传输的任何数据,例如设备 A 向设备 B 打招呼."
  4. 该应用还会定期对网络服务进行读取"调用.在此示例中,设备 B 将读取发往 B 的任何信息,并且 Web 服务将返回一条记录,表明设备 A 向其发送了一条消息,其中包含设备 A 向设备 B 说你好"的数据.

因为同样的进程也在两部手机上运行,​​所以这种通信可以双向进行.

Because the same process is also running on both phones, this communication can happen both ways.

这篇关于如何将数据发送到变成 iBeacon 的 iphone?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆