My app needs to detect other iPhones and connect to all of them one at a time quickly (Those iPhones also have the same functionality). So I implemented both peripheral and central. I only try connecting to another phone if:
if (![_discoveredPeripheral isConnected] && [[UIDevice currentDevice] name] < [advertisementData objectForKey:@"kCBAdvDataLocalName"])
(I advertise the name of the device to avoid both devices to connect to each other at the same time)
It works correctly, but after a few minutes I get this error:
[1622:1103] CoreBluetooth[ERROR] XPC connection interrupted, resetting
Is the problem in my algorithm of connecting? Or is it not doable to be a peripheral and connect as a central at the same time?