简体   繁体   English

BLE:通过后台iOS广告本地名称和服务UUID

[英]BLE: Advertising local name and service UUID from background iOS

According to iOS documentation, when an iOS application that utilizes BLE as a peripheral moves to background mode, peripheral name is not advertised and all service UUIDs are placed in a special 'overflow' area, they can be discovered only by an iOS device which is explicitly scanning for them. 根据iOS文档,当将BLE作为外围设备的iOS应用程序移至后台模式时,不会通告外围设备名称,并且所有服务UUID都放置在特殊的“溢出”区域中,它们只能由以下设备的iOS设备发现:明确扫描它们。

I sniffed the BLE packets sent over the air when application is in background. 当应用程序处于后台时,我会嗅探通过空中发送的BLE数据包。 There is no local name and service UUID data. 没有本地名称和服务UUID数据。 There is an 'overflow' area which encodes the service UUID. 有一个“溢出”区域,对服务UUID进行编码。 A brief discussion can be found here: https://github.com/crownstone/bluenet-ios-basic-localization/blob/master/BROADCASTING_AS_BEACON.md 可以在这里找到简短的讨论: https : //github.com/crownstone/bluenet-ios-basic-localization/blob/master/BROADCASTING_AS_BEACON.md

I wish to know if there is any way we can determine the actual service UUID being advertised from the data in 'overflow' area. 我想知道是否有任何方法可以根据“溢出”区域中的数据确定正在发布的实际服务UUID。 iOS documentation states that when an app is advertising as BLE peripheral in background, another iOS app can find it by explicitly specifying the service UUIDs to scan for. iOS文档指出,当某个应用在后台作为BLE外围设备做广告时,另一个iOS应用可以通过显式指定要扫描的服务UUID来找到它。 So, there must be a way to figure out the actual UUID from overflow data. 因此,必须有一种方法可以从溢出数据中找出实际的UUID。

Any pointers on this would be helpful. 关于此的任何指示将是有帮助的。

No. The data in the overflow area is hashed (sending several 128-bit UUIDs would be much too large for an advertising packet). 不会。溢出区域中的数据被散列(发送几个128位UUID对于广告包来说太大了)。 I don't believe the hash is documented, but I strongly suspect that it's based on a Bloom filter, so that Apple can probabilistically pack a unlimited number of UUIDs into the very limited space of an advertising packet. 我不相信哈希是有记载的,但是我强烈怀疑它是基于Bloom过滤器的,因此Apple可以将无限数量的UUID概率打包到非常有限的广告包空间中。

The upside of all of this is that it means the data isn't there in the advertising packet (and really can't be). 所有这一切的好处是,它意味着数据不在广告包中(实际上是不会)。 You will need to connect to the device to discover its services. 您将需要连接到设备以发现其服务。

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

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