jordanebelanger / SwiftyBluetooth

Closures based APIs for CoreBluetooth
MIT License
209 stars 66 forks source link

discoverServices error operationTimedOut(operation: EverShining.SBError.SBOperation.discoverServices) #56

Open ljchen1129 opened 2 years ago

ljchen1129 commented 2 years ago

When the previous device is disconnected and another device is connected, the connection is successful, but an error is reported discoverServices

The first connection is successful, discoverServices can be successful

https://user-images.githubusercontent.com/13548479/188608830-b0b9e9c1-d6e9-42b6-8723-cd2d0fdec9f3.MP4

ljchen1129 commented 2 years ago

PeripheralProxy.cbPeripheral.delegate is nil

ljchen1129 commented 2 years ago
       ` let UUIDs = [peripheral.identifier].compactMap{ $0 }
        guard let per = retrievePeripherals(withUUIDs: UUIDs).first else { return }
        self?.connectPeripheral = per`

I solved this problem by reacquiring the device list and I found that each time the scan was completed, the PeripheralProxy was released