Reputation: 19134
I have an OSX app that does the following:
[[CBCentralManager alloc] initWithDelegate:queue:]
and wait for it to initialize.[CBCentralManager connectPeripheral:options:]
[[CBPeripheralManager alloc] initWithDelegate:queue:options:]
and wait for it to initialize.[CBPeripheralManager addService:]
and wait for them to finish being added.[CBPeripheralManager startAdvertising:]
and wait for the result.Now, my callback [CBPeripheralManagerDelegate peripheralManagerDidStartAdvertising:error:]
gets an error: “Error Domain=CBErrorDomain Code=0 "Unknown error." UserInfo=0x7fb23bf7ba50 {NSLocalizedDescription=Unknown error.}”.
However, if I call [CBCentralManager cancelPeripheralConnection:]
immediately before startAdvertising:
, then the error goes away.
Is it impossible for a Mac to act in both Central Role and Peripheral Role at the same time? Does this limitation also exist on iOS? Is this a hardware-specific limitation, or is this inherent in Bluetooth LE?
I am testing this on a Mid 2011 Mac Mini running OSX 10.9 Mavericks.
Upvotes: 2
Views: 1391
Reputation: 14601
I can confirm CoreBluetooth on iOS doesn't have this issue, at least not when I last tested it on iOS 6 on an iPhone 5. The iPhone can advertise as a BLE peripheral while talking to another BLE peripheral as the BLE Central at the same time. I don't have results on OS X. But I will be really suprised if OS X, on a much more powerful platform, has such limit.
Upvotes: 1