While developing a BLE app for iOS, I keep getting a disconnect immediately after discoverServices is called. I am testing with 4 exact BLE devices (OEM), and I keep getting
You need to keep CBPeripheral instance (by which you are working) strongly. For example in your view controller you need to have a property
@property (strong, nonatomic) CBPeripheral *activePeripheral;
Assign found peripheral to activePeripheral, after which do your staff (connecting/discovering/etc...)
I think using Framework like a CoreBluetooth is not a good way to achieve good results, you need something high level, block based. Here is a library that I have just commited for you https://github.com/LGBluetooth/LGBluetooth
It will make life with bluetooth much more easier.