[英]Can we monitor BLE service the same way as we monitor beacon (enter region, exit region)?
I'm trying to wrap my head around the different between regular BLE service and Beacon. 我试图绕过常规BLE服务和Beacon之间的区别。 Based on this post BLE beacon frame is just a specialized payload inside a BLE advertisement frame.
基于此帖子, BLE信标帧只是BLE广告帧内的专用有效负载。 iOS and Android both allow us to monitor if we enter or exit beacon region.
iOS和Android都允许我们监视是否进入或退出信标区域。 Is it possible to do the same thing for BLE service?
BLE服务可以做同样的事情吗?
The short answer is YES, you can use a BLE service in a similar way monitoring beacons. 简短的答案是“是”,您可以通过类似的方式使用BLE服务监视信标。 But there are disadvantages:
但是有缺点:
The term BLE Service is more precisely referred to as a Bluetooth LE GATT Service. 术语BLE服务更精确地称为Bluetooth LE GATT服务。 This is much more complex than a standalone Bluetooth LE advertisement used by a Bluetooth LE Beacon.
这比蓝牙LE Beacon使用的独立蓝牙LE广告要复杂得多。
To use a Bluetooth LE Beacon: 要使用蓝牙LE信标:
The Bluetooth LE device advertises a Bluetooth LE advertisement with a fixed series of bytes that uniquely identify the beacon, typically sending out one packet at a rate between 1Hz and 10HZ. 蓝牙LE设备以固定的一系列字节来通告蓝牙LE广告,该字节固定唯一地标识信标,通常以1Hz到10HZ之间的速率发送一个数据包。
Mobile phones listen for the Bluetooth LE advertisement with a Bluetooth LE scan. 手机会通过蓝牙LE扫描收听蓝牙LE广告。
The mobile phone uses a beacon SDK (eg CoreBluetooth on iOS and the Android Beacon Library or others on Android) to convert appearances/disappearances of advertisements in these scans into "enter region" and "exit region" events. 手机使用信标SDK(例如iOS上的CoreBluetooth和Android信标库或Android上的其他信标)将这些扫描中广告的出现/消失转换为“进入区域”和“退出区域”事件。 A beacon identifier is embedded inside the advertisement, and is passed on by the SDK through these events.
信标标识符嵌入在广告内部,并由SDK通过这些事件传递。
To use a Bluetooth LE GATT Service, steps 1 and 2 are the same as above. 要使用Bluetooth LE GATT服务,步骤1和2与上述相同。 But then things get much more complicated:
但是事情变得更加复杂:
Using a technique like above, you certainly can use Bluetooth LE services like beacons. 使用上述技术,您当然可以使用信标等蓝牙LE服务。 But it is much more complex and requires custom software do to it.
但这要复杂得多,并且需要定制软件来完成。 This is why it is far more common to use the more standard approach of not using a service.
这就是为什么使用更标准的不使用服务的方法更为普遍的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.