@v5x/serial exposes that buffer as a terminal session that
polls for output and emits it as it arrives.
Streaming output
openTerminal() starts polling immediately and returns
Err(VexNotConnectedError) when no connection is open. The session is yours to
close; disposing the device does not stop the poll loop.
Events
text decoding is incremental, so a multi-byte character split across two
reads is emitted once, whole, with the read that completes it. Listen to data
instead when the program prints something other than text.
A listener that throws cannot stop the poll loop.
Sending input
Tuning the session
number
default:"50"
Delay before polling again after the brain reports nothing buffered. A
non-empty read is followed immediately by another read, so a burst of output
drains at link speed rather than at this interval.
number
default:"500"
Reply timeout for each request.
number
default:"20"
Consecutive failed reads tolerated before the session closes itself.
Occasional timeouts are normal while the brain is busy, so a single failure
never ends a terminal.
Reading the buffer directly
V5SerialConnection exposes the underlying requests when polling is not what
you want: