         ]
         
         accessQueue.sync { [unowned self] in
-            
             self.internalState.scan.peripherals = [:]
             self.internalState.scan.foundDevice = foundDevice
         }
         
+        // store semaphore
+        let semaphore = Semaphore(timeout: 60 * 10, operation: .scan)
+        accessQueue.sync { [unowned self] in self.internalState.scan.semaphore = semaphore }
+        defer { accessQueue.sync { [unowned self] in self.internalState.scan.semaphore = nil } }
+        
         self.log?("Scanning...")
         
         self.internalManager.scanForPeripherals(withServices: nil, options: options)
         
+        // wait
+        try semaphore.wait()
+        
         accessQueue.sync { [unowned self] in
             self.internalState.scan.foundDevice = nil
         }

        precondition(isScanning, "Not scanning")
        
        self.log?("Stop scanning")
        self.internalManager.stopScan()
    }
    

    
    enum Operation {
        
        case scan
        case connect(Peripheral)
        case discoverServices(Peripheral)
        case discoverCharacteristics(Service<Peripheral>)
