如何发送服务UUID

How to send service UUID

我们正在开发一个需要在后台扫描信标的应用程序。这需要我们 iOS 在扫描时指定一个服务 UUID。见 Apple documentation:

Apps that have specified the bluetooth-central background mode are allowed to scan while in the background. That said, they must explicitly scan for one or more services by specifying them in the serviceUUIDs parameter. The CBCentralManagerOptionShowPowerAlertKey scan option is ignored while scanning in the background.

我们正在使用带有蓝牙适配器的 Raspberry Pi 来发送信标信号(符合 AltBeacon 规范)。不幸的是,我们无法找出应该如何在 BLE 广告 PDU 中设置服务 UUID,它是蓝牙规范的一部分还是制造商特定数据结构的一部分?当您使用 iOS 设备作为信标时,我们确实找到了设置服务 UUID 的示例,但是由于我们使用的是通用蓝牙适配器,因此我们无法使用它。 谁能向我们说明在信标传输中应该如何以及在何处设置服务 UUID?

is it part of the Bluetooth specification or part of the Manufacturer specific data structure?

以后。

一般在设置广告参数的时候,可以给它设置UUID(或者name,tx power等)