让CoreBluetooth再次检测设备

让CoreBluetooth再次检测设备,bluetooth,bluetooth-lowenergy,core-bluetooth,Bluetooth,Bluetooth Lowenergy,Core Bluetooth,我正在开发一个应用程序,它使用CoreBlutooth扫描一个特定的BLE设备,使其能够播放。该设备通过广播播放,并被读取和交互。我的问题是,当设备在几分钟后拔出并重新插入时,didiscoverperipheraldelegate方法不会再次被调用。我已通过以下代码指定了“允许重复”选项: NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:TRUE],@"CBC

我正在开发一个应用程序,它使用CoreBlutooth扫描一个特定的BLE设备,使其能够播放。该设备通过广播播放,并被读取和交互。我的问题是,当设备在几分钟后拔出并重新插入时,
didiscoverperipheral
delegate方法不会再次被调用。我已通过以下代码指定了“允许重复”选项:

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:TRUE],@"CBCentralManagerScanOptionAllowDuplicatesKey", nil];
有没有办法让
didiscoverperipheral
方法在模块每次播出时都被激发,不管它消失后多久?是否有人知道设备断开连接到CoreBooth manager将再次看到它之间的“超时时间”是多少?

您的代码:

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:TRUE],@"CBCentralManagerScanOptionAllowDuplicatesKey", nil];
此代码使用文本NSString@“CBCentralManagerScanOptionAllowDuplicatesKey”作为键,但不是实际键

应该是:

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:TRUE],CBCentralManagerScanOptionAllowDuplicatesKey, nil];

您是否需要连接到“特定”的BLE设备?还是只需要扫描服务?