readFlow

fun readFlow(isoDep: IsoDep): Flow<ReadEvent>

Execute the read session and emit ReadEvent progress events as the session advances.

Collect this flow from the main thread — it handles Dispatchers.IO internally. The flow completes normally with ReadEvent.Done on success, or terminates with a ro.eidkit.sdk.error.CeiError on failure (including ro.eidkit.sdk.error.CeiError.CardLost if the card is moved during the session).

The final ReadResult is not emitted as an event — use read if you only need the result. To obtain both the result and events, store the result in the ViewModel from the ReadEvent.Done collection point after launching a parallel read call.

Typical usage: collect events to drive a wizard UI, then separately await read for the final result. Or use readFlow exclusively and ignore ReadEvent.Done if only the progress display matters (result is available from read once the flow completes).