简体   繁体   English

我们可以像监视信标(进入区域,退出区域)一样监视BLE服务吗?

[英]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信标:

  1. 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之间的速率发送一个数据包。

  2. Mobile phones listen for the Bluetooth LE advertisement with a Bluetooth LE scan. 手机会通过蓝牙LE扫描收听蓝牙LE广告。

  3. 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: 但是事情变得更加复杂:

  1. Software on the mobile phone establishes a connection with the Bluetooth LE device. 手机上的软件与蓝牙LE设备建立连接。
  2. Software on the mobile phone queries the Bluetooth LE device for GATT Services 手机上的软件向Bluetooth LE设备查询GATT服务
  3. Software on the mobile phone queries the Bluetooth LE device for GATT Characteristics supported by a specific GATT Service of interest 手机上的软件向蓝牙LE设备查询特定GATT服务支持的GATT特性
  4. Software on the mobile phone reads the value of a GATT characteristic, which will return a value stored inside the Bluetooth LE device. 手机上的软件读取GATT特性的值,该特性将返回存储在Bluetooth LE设备内部的值。 For beacon-like use cases, this characteristic will often-store a beacon identifier, much like is embedded in the advertisement itself in the case of a traditional Bluetooth LE Beacon. 对于类似信标的用例,此特征通常会存储一个信标标识符,就像在传统的蓝牙LE信标的情况下嵌入广告本身一样。
  5. Custom software converts the appearance/disappearance of this device hosting the Bluetooth LE GATT service to enter/exit region events based on the identifier embedded in the GATT characteristic. 定制软件根据嵌入在GATT特性中的标识符,将承载Bluetooth LE GATT服务的该设备的外观/外观转换为进入/退出区域事件。

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.

相关问题 是否可以在由RegionBootstrap触发的活动中在区域中启动监视信标? - Is it possible to start monitor beacon in region in an activity which is triggered by RegionBootstrap? Alt信标库持续触发用户从未离开过信标区的进入和退出区域方法 - Alt beacon lib continuously fires enter and exit region method where the user never left beacon zone 正确使用信标和区域的方法 - Correct way to use beacon and region 监控非信标BLE设备(Android Beacon Library) - Monitor non-beacon BLE devices (Android Beacon Library) Android Oreo中的Altbeacon。“我们位于信标区域。 我们不会在周期之间进行扫描” - Altbeacon in Android Oreo “We are inside a beacon region. We will not scan between cycles” 如何使用AltBeacon android-beacon-library检测多个信标的区域输入/退出? - How to detect Region Enter/Exit for multiple beacons using AltBeacon android-beacon-library? 我们可以像配对经典蓝牙设备一样以相同的方式配对BLE设备吗? - Can we pair BLE Device the same way as we pair Classic Bluetooth Device? 我们可以在Android中为mapView.region.span.latitudeDelta使用什么? - What we can use for mapView.region.span.latitudeDelta in Android? 我们如何在iBeacon协议中监视20多个区域? - How can we monitor for more than 20 regions in iBeacon protocol? 我可以在退出区域获取信标数据吗?如何检测何时进入该区域的新信标? - Can I get beacons data in Exit Regions also how can I detect when new beacon enterered into the region?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM