Our App connects to Bluetooth LE Devices via CoreBluetooth.
On iOS 8 and 9 everything works correctly. On iOS 10 we geht a Timeout Error (
Error Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly."
- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(nullable NSError *)error;
OK, I solved the Problem. I mixed up
starting with iOS 10
CBPeripheral discoverServices only accepts
NSUUID does not work anymore. Maybe
NSUUID only worked accidentally on older iOS versions. The documentation clearly states:
A list of
CBUUIDobjects representing the service types to be discovered.
NSArray *services = @[ [CBUUID UUIDWithString:ServiceUUID] //Correct //[[NSUUID alloc] initWithUUIDString:ServiceUUID] //Does work on iOS 9 but not on iOS 10 ]; [self.peripheral discoverServices:services];
looking forward to port the app to strongly typed Swift.