I see a strange bug in iOS 8.3, and I wonder if anyone else sees the same thing.
I have an iPad Air (in central mode) and an iPhone 6 (in peripheral mode) in the immediate vicinity.
- My
CBCentralManager initialized with a sequential background queue and the CBCentralManagerOptionRestoreIdentifierKey option - The manager starts scanning peripheral devices using the
CBCentralManagerScanOptionAllowDuplicatesKey: true option CBCentralManagerScanOptionAllowDuplicatesKey: true - Inside
centralManager:didDiscoverPeripheral: I check the list of peripherals already discovered:
let connect: () -> () = { peripheral.delegate = self self.devices[peripheral.identifier.UUIDString] = peripheral self.manager.connectPeripheral(peripheral, options: nil) } if let device = devices[peripheral.identifier.UUIDString] { if device.peripheral.state == .Disconnected { connect() } } else if peripheral.state == .Disconnected { connect() }
- After connecting, I discover services and features.
Now the peripheral device is turned off after 10 seconds, immediately detected again and again connected. After 10 seconds, this procedure is repeated.
Is this a mistake or am I doing something wrong here?
I also tried to directly subscribe to the testimonial on the periphery, but that didn't change anything.
source share