iBeacons的UUID在不同的设备上是不同的

时间:2014-06-17 13:47:27

标签: ios core-bluetooth ibeacon indoor-positioning-system

我正在开发一个将iBeacons用于室内导航的应用程序,我发现调用函数locationManager:rangingBeaconsDidFailForRegion:withError:的速度不够高,所以我要添加来自CoreBluetooth的centralManager:didDiscoverPeripheral:advertisementData:RSSI:的RSSI数据。

我发现了一个奇怪的事实:当我使用CoreLocation监听iBeacon并记录外围设备ID时:

- (void)centralManager:(CBCentralManager *)central 
    didDiscoverPeripheral:(CBPeripheral *)peripheral 
    advertisementData:(NSDictionary *)advertisementData 
    RSSI:(NSNumber *)RSSI
{
    NSLog(@"%@, RSSI: %@", peripheral, RSSI);

在不同设备上报告每个信标具有不同的UUID:

A25804BD-D77A-5004-4C2C-301D996C7367 - my iPhone 5
843F4237-6059-9A5E-AA34-0BD92304BE1F - colleague's iPhone 5
77685805-C253-52BD-B787-8B95308834FB - other colleague's iPad mini

我们的想法是将每个信标的UUID绑定到它的位置,因此这种行为非常具有功能性。

为什么物理上相同的信标(未关闭/打开)的UUID在不同设备上有所不同?这是预期的行为吗?如果是,我怎么能选择退出呢?

1 个答案:

答案 0 :(得分:5)

您无法使用CoreBluetooth读取标准iBeacons的标识符。正如Chris Stratton在评论中所说,CoreBluetooth为您提供的UUID是一个设备UUID,它是由iOS每个会话随机生成的。它与iBeacon ProximityUUID无关。

有关您无法使用CoreBluetooth阅读iBeacon标识符的详细信息,请访问:http://developer.radiusnetworks.com/2013/10/21/corebluetooth-doesnt-let-you-see-ibeacons.html

确实,您只能按locationManager:didRangeBeacons:inRegion:回调进行RSSI测量。这是进行自定义距离估计的真正障碍。在幕后,iOS可以为10BHz传输的iBeacons收集10倍的测量值。你是正确的,你可以使用CoreBluetooth获得更多的测量,但问题是没有可靠的方法来排列你用CoreBluetooth看到的蓝牙设备对应于你可以看到{i {{}的iBeacons 1}}。

相关问题