device Flow
Return
Flow of Device
Usage
To start scan use collect.
To end scan use cancel on the scope it's launched in.
To handle exceptions use catch or surround flow with try/catch
val job = scope.launch {
Scanner.scan()
.catch { e -> log("Exception during scan", e) }
.collect { efentoDevice -> process(efentoDevice) }
}
job.cancel()Content copied to clipboard