Skip to content

Cannot convert return expression of type 'FutureStream<Void>'(aka 'futureStream<()>') to return type 'FutureStream<Peripheral>' #2

Description

@jelmerbou

In the file ViewController.swift this error appears on line 97 at return peripheral.connect(connectionTimeout: 10, capacity: 5):

//We will connect to the first scanned peripheral
let connectionFuture = scanFuture.flatMap { peripheral -> FutureStream in
//stop the scan as soon as we find the first peripheral
manager.stopScanning()
DispatchQueue.main.async {
self.connectionStatusLabel.text = "Found peripheral (peripheral.identifier.uuidString). Trying to connect"
print(self.connectionStatusLabel.text!)
}
//connect to the peripheral in order to trigger the connected mode
return peripheral.connect(connectionTimeout: 10, capacity: 5)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions