I've an application which should use CoreBluetooth to connect to varies devices at once. My issue here is that unexpected disconnections occur. Once I got connected to any peripheral the method
func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) {
gets called by itself which means the device is disconnected. I walk through the documentation but found nothing useful. I know that BLE can be one-to-many so where is this issue coming from? I check answers in iOS BLE peripherals keep disconnecting immediately after discoverServices is called and I'm already holding CBPeripherals in an array but problem still exist.
example of outputs I got
Connect to <CBPeripheral: 0x15e85a80, identifier = 1BD21078-B2B7-1EE9-5BDC-324DEC7A1BD6, name = Mac mini, state = connected>
Connect to <CBPeripheral: 0x15d83b20, identifier = 6BA160A7-55E7-501D-F195-437CDCD2B558, name = Mac mini, state = connected>
Disconnect from <CBPeripheral: 0x15e85a80, identifier = 1BD21078-B2B7-1EE9-5BDC-324DEC7A1BD6, name = Mac mini, state = disconnected>
Error Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly." UserInfo={NSLocalizedDescription=The connection has timed out unexpectedly.}