【发布时间】:2016-11-14 08:41:25
【问题描述】:
我有知道 UUID 的 iBeacon。如果我从 Android 设备搜索此信标 - 我可以准确地看到此 UUID。
但是,当我从 iOS 设备搜索此 iBeacon 时,无法使用此 UUID 找到它。我发现外围设备的标识符与 UUID 不同。
func centralManagerDidUpdateState(_ central: CBCentralManager) {
let serviceUUID: CBUUID = CBUUID(string: "e2c56db5-dffb-48d2-b060-d0f5a71096e0")
central.scanForPeripherals(withServices: [serviceUUID], options: nil)
}
为什么它们不同?如何搜索具有已知 UUID 的外围设备?
【问题讨论】:
-
服务 UUID 与设备 UUID 不同。此外,“纯”iBeacon 只能通过 CoreLocation 发现。另一个信息:如果您不与它们配对,BLE 中设备的 UUID 机会(它们是时间戳、读取 UUID 等之间的混合)。
标签: swift ibeacon cbperipheral bleno