2

如何从外围设备端获取 UUID。不是广告包中的服务 UUID。

让我们从中央看它:

- (void)centralManager:(CBCentralManager *)central
 didDiscoverPeripheral:(CBPeripheral *)peripheral
     advertisementData:(NSDictionary *)advertisementData
                  RSSI:(NSNumber *)RSSI

我需要的是 UUID 中的peripheral.identifier,而不是包含在advertisementData. 我可以从中心端获取它们,但我也需要从外围端获取它们。

4

1 回答 1

0

我认为没有办法从CBPeripheralManager侧面获取 UUID。

由于这个 UUID 是硬编码在蓝牙芯片中的,而且人们几乎不会改变他们 iPhone 的蓝牙芯片,所以这种方法会被用来追踪用户,这与苹果的意图相悖。

苹果在 iOS 5 中禁用了 UDID,在 iOS 6 中禁用了 MAC 地址。

CBPeripheralManager因此,当 Apple 添加iOS 6时,Apple 没有理由让您访问蓝牙 UUID 。

于 2016-03-13T04:10:16.183 回答