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

        
        struct Scan {
            
            var peripherals = [Peripheral: (peripheral: CBPeripheral, scanResult: ScanData<Peripheral, Advertisement>)]()
            
            var foundDevice: ((ScanData<Peripheral, Advertisement>) -> ())?

        ]
        
        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
        }
