【发布时间】:2013-11-24 21:59:32
【问题描述】:
我正在使用 Nordic BLE nRF8001 开发套件来测试 CoreBluetooth。使用 CBCentralManager 的方法(例如 didDiscoverPeripheral()、didConnectPeripheral() 等)我的 iPhone 5 能够检测到 Nordic 设备的广告并正常连接。但是,我没有收到来自新 locationManager 范围或 regionMonitoring 方法的任何响应。下面我将解释我的设置:
1.) 首先,我使用传入的外围设备(我的北欧设备)在 didDiscoverPeripheral() 委托方法中从我的北欧设备中检索了我的 NSUUID。我为我的北欧设备创建了一个自定义服务,所以假设这个外围设备是北欧设备。要检索我使用的 NSUUID:
NSUUID *uuid = [peripheral identifier];
NSString *uuidString = [uuid UUIDString]; //uuidString = 9A8D4C73-152D-BBDA-E4C2-9CE952654645
2.) 接下来我为我的 Nordic 设备创建一个信标区域并创建一个 CLLocationManager:
self.locationManagerBeacon = [[CLLocationManager alloc] init];
[self.locationManagerBeacon setDelegate:self];
NSUUID *myUUID = [[NSUUID alloc] initWithUUIDString:@"9A8D4C73-152D-BBDA-E4C2-9CE952654645"];
self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:myUUID
identifier:@"nordicRegion"];
self.beaconRegion.notifyEntryStateOnDisplay = YES;
3.) 现在我开始监视信标区域
[self.locationManagerBeacon startRangingBeaconsInRegion:self.beaconRegion];
4.) 问题:locationManager:didRangeBeacons:inRegion 被调用,但信标区域始终为空。
问题: Nordic BLE 设备是否需要以某种方式进行配置,以便新的 locationManager 信标方法能够检测到它(例如 BLE 广告频率、功率级别等)?如果是这样,有人可以指出我的文档。
感谢您的帮助!
【问题讨论】:
-
那么,愚蠢的问题:您使用的是真正的 iBeacon 吗?或者只是一个任意的 BTLE 设备?只有广播 iBeacon 配置文件的 BTLE 设备才会真正被视为“iBeacon”。
-
我想知道您是否可以分享您的配置/配置文件/示例代码,以将 nrf8001 广告设置为 iBeacon。
标签: ios iphone bluetooth ibeacon