1
votes

Our IOS application communicates with some device (Intel NUC) over BLE, writing to some characteristics. We use encrypted characteristics which enforce system pairing at the moment we write to characteristic for the first time.

Another piece of software on the same device is using classic BT to synchronize contacts (Phone Book Access Profile) and stream music from iPhone to Intel NUC. This also requires system pairing (separate from the one needed for BLE connection).

Once devices are paired both for BLE and classic BT profiles (two separate pairing processes) everything works fine. The problem arise when we disconnect from the peripheral either manually from system BT settings, or, event worse, by going with the iPhone out of range of NUC device. The devices stays disconnected in BT settings, event if we are back so that both devices are in range. It should not be a problem as we are paired for BLE communication so we should be able to connect with device that is currently disconnected but in range. However, when trying to connect over BLE then we get the error:

Domain=CBATTErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information}

We connect to the device returned from CBCentralManager.retrievePeripherals(:withIdentifiers) method

Once we manually connect in system BT settings everything stars working again.

We tried using CBConnectPeripheralOptionEnableTransportBridgingKey flag passed to CBCentralManager.connect() method, but it's getting even worse. There are problems in system pairing for classic BT profiles and even if we manage to do it somehow, connecting over BLE time outs.

Any idea what might be the reason of the problem?

1

1 Answers

1
votes

In your case,Peripheral device is removing pairing information(By User or from BLE). It may be related to Peripheral device firmware. This error "Domain=CBATTErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information}" is not available in iOS(<13). In iOS (13+), you can handle or show an alert message to users regarding pairing information removed. So, At least users can get some idea, why Peripheral Device is not able to established bonding with central.

Example: Peer removed Pairing information. Open Bluetooth settings and forget the device before reconnecting etc. Otherwise users will confused.