The status of ios-cbcentralManager is unknown and CoreBluetooth [WARNING] <CBConcreteCentralManager> is not enabled
I am working on a CoreBluetooth base. I ran the famous temperatureSensor application, but when I run it on the simulator, I get the following warning:
CoreBluetooth[WARNING] <CBConcreteCentralManager: 0x713b550> is not powered on and I checked the status of CBCentralManager , this is Unknown . Below 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 to solve it?
+1
1 answer
It looks like the Bluetooth device is not connected or not found. You will need to plug in an external USB BLE connector to use it with the simulator, even if your machine may be BTLE-compatible. This note from Apple's application may be helful
0