     }
 
     internal func restore(from peripheral: CBPeripheral) {
-        discoveryManager.queue.assertIsDispatching()
+        queue.assertIsDispatching()
         self.peripheral = peripheral
         peripheral.delegate = self
         defer { didUpdateState() }


extension BLEDevice: CBPeripheralDelegate {
    open func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) {
        discoveryManager.queue.assertIsDispatching()
        peripheral.services?
            .flatMap{ service in (service, charactericUUIDsForServiceUUID[service.uuid]?.filter { !service.characteristicUUIDs.contains($0) } ?? [] ) }
            .forEach{ peripheral.discoverCharacteristics($0.1, for: $0.0) }
    }

    open func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) {
        discoveryManager.queue.assertIsDispatching()
        service.characteristics?.forEach{ characteristic in
            if notificationCharacteristicUUIDs.contains(characteristic.uuid) {
                peripheral.setNotifyValue(true, for: characteristic)

    private var autoReconnect = false

    public required init(discoveryManager: BLEDiscoveryManager, peripheral: CBPeripheral) {
        self.discoveryManager = discoveryManager
        self.uuid = peripheral.identifier
        super.init()
