Does CoreBluetooth dose work on IOS6.0, IOS6.1, IOS6.1.2?

I am working on bluetooth4.0, but I found that CoreblueTooth cannot work on iOS 6+, my iphone4 is iOS 6.1.2.

it cannot find any device (I am sure that the device is turned on), a log, as shown below, each time:

CoreBluetooth [WARNING] not included

Suppose anyone has encountered this problem?

+2
source share
2 answers

The status of CBCentralManagerStatePoweredOn not only means that Bluetooth is turned on, but your instance of CBCentralManager or CBPeripheralManager is ready to use. You must initialize your manager, and then wait until its state changes before using it. For example, if you act as Central, you should initialize it as follows:

centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; 

And we implement the centralManagerDidUpdateState: delegate centralManagerDidUpdateState:

 - (void)centralManagerDidUpdateState:(CBCentralManager *)central { if (central.state == CBCentralManagerPoweredOn) { //do your stuff, it ready } } 
+3
source

I am testing an iPhone 4S running 6.0.1. The iPhone is central and I do not see your warning.

Could you be more specific about what you are doing? - Are you in a peripheral or central role?

Have you initialized the CBCentralManager (if you are central) as follows?

 centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:dispatch_get_main_queue()]; 

Hope I help you.

0
source

All Articles