简体   繁体   English

ios- cbcentralManager状态未知和CoreBluetooth [警告] <CBConcreteCentralManager> 没有开机

[英]ios- cbcentralManager state unknown and CoreBluetooth[WARNING] <CBConcreteCentralManager> is not powered on

I am working on CoreBluetooth framework. 我正在研究CoreBluetooth框架。 I ran the famous temperatureSensor application but when i run it on simulator I get the following warning: 我运行了著名的temperatureSensor应用程序,但是当我在模拟器上运行它时,出现以下警告:

 CoreBluetooth[WARNING] <CBConcreteCentralManager: 0x713b550> is not powered on

and I checked the state of CBCentralManager it is Unknown . 我检查了CBCentralManager的状态为Unknown Following is the code: 以下是代码:

(void) startScanningForUUIDString:(NSString *)uuidString {
    centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];

    if ([centralManager state] == CBCentralManagerStatePoweredOff) NSLog(@"CBCentralManagerStatePoweredOff");
    if ([centralManager state] == CBCentralManagerStatePoweredOn) NSLog(@"CBCentralManagerStatePoweredOn");
    if ([centralManager state] == CBCentralManagerStateResetting) NSLog(@"CBCentralManagerStateResetting");
    if ([centralManager state] == CBCentralManagerStateUnauthorized) NSLog(@"CBCentralManagerStateUnauthorized");
    if ([centralManager state] == CBCentralManagerStateUnknown) NSLog(@"CBCentralManagerStateUnknown");
    if ([centralManager state] == CBCentralManagerStateUnsupported) NSLog(@"CBCentralManagerStateUnsupported");
    NSArray *uuidArray = [NSArray arrayWithObjects:[CBUUID UUIDWithString:uuidString], nil];

    NSLog(@"%@", uuidArray);
    NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
    [centralManager scanForPeripheralsWithServices:uuidArray options:options];
}

How do I solve it? 我该如何解决?

Seems like the bluetooth device is not connected or not detected. 似乎未连接或未检测到蓝牙设备。 You will need to connect an external USB BLE dongle to be able to use it with the simulator even though your machine might be BTLE capable. 即使您的计算机可能具有BTLE功能,您也需要连接一个外部USB BLE加密狗才能将其与模拟器一起使用。 This application note from Apple might be helful 苹果公司的本应用笔记可能非常有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试范围信标时出现“ CoreBluetooth [API MISUSE] CBCentralManager仅在处于开机状态时接受命令”错误 - “CoreBluetooth[API MISUSE] CBCentralManager can only accept commands while in the powered on state ” error while trying to range beacons 什么时候CBCentralManager的状态会启动,但仍然给我一个“未启动”警告? - When would CBCentralManager's state ever be powered on but still give me a “not powered on” warning? ios CoreBluetooth [警告]未知错误:1309 - ios CoreBluetooth[WARNING] Unknown error: 1309 CBConcreteCentralManager未开机错误 - CBConcreteCentralManager is not powered on error CBCentralManager未开机 - CBCentralManager is not powered on CoreBluetooth [WARNING]未知错误:2 - CoreBluetooth[WARNING] Unknown error: 2 CoreBluetooth [WARNING]未知错误:311在iOS中使用CoreBluetooth Framework反复连接和断开连接时发生 - CoreBluetooth[WARNING] Unknown error: 311 Occurs when repeatedly connect and disconnect using CoreBluetooth Framework in iOS CoreBluetooth [WARNING]未知错误:241 - CoreBluetooth[WARNING] Unknown error: 241 解决MonoTouch核心蓝牙中的“CBConcreteCentralManager未启动”问题 - Solving 'CBConcreteCentralManager is not powered on' in Core Bluetooth in MonoTouch iOS CoreBluetooth 突然处于 CBManagerStateResetting 状态 - iOS CoreBluetooth suddenly in CBManagerStateResetting state
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM