1
votes

I have an OSX app that does the following:

  1. Start the central manager [[CBCentralManager alloc] initWithDelegate:queue:] and wait for it to initialize.
  2. Connect to a Bluetooth LE peripheral using [CBCentralManager connectPeripheral:options:]
  3. Start the peripheral manager [[CBPeripheralManager alloc] initWithDelegate:queue:options:] and wait for it to initialize.
  4. Add services to the peripheral manager [CBPeripheralManager addService:] and wait for them to finish being added.
  5. Start advertising [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.

1
I have a similar situation: I have 2 processes running on the mac: A peripheral and a central. Central does not see the peripheral even though a scanner running on iOS does. The central does see and interact with other (non locally-running) peripherals. No clue why, still investigating...dynex

1 Answers

1
votes

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.