Expand description
Low-level serial I/O traits, device discovery, handshake, frame reader, and writer task.
This module encapsulates all direct interaction with the serial byte stream
below the Go-Back-N ResendSP state machines:
- RX (
SerialReader): Rather than spawning a separatereader_task, incoming bytes are parsed bySerialReader, which is borrowed directly by the receiver task (reader.next_frame().await). This allows the caller to recover any unconsumed trailing bytes viaSerialReader::take_unconsumedwhen a session ends or renegotiates. - TX (
writer_task): Because multiple producers emit frames concurrently (outgoing data/close frames, duplicate handshake replies, and priority cumulative ACKs viaAckTracker), outgoing serial writes are handled by a dedicatedwriter_taskthat prioritizes ACKs and coalesces 4 KiB frame batches.
Structs§
- Serial
Reader - Buffered UART protocol frame reader wrapping a
SerialReadimplementation.
Traits§
- Serial
Read - Asynchronous byte reader abstraction over a target serial device.
- Serial
Write - Asynchronous byte writer abstraction over a target serial device.
Functions§
- open_
serial_ device - Discovers a serial device under
/dev/class/serialand configures it for 8N1 atbaud_rate. - run_
target_ handshake - Runs the target-side framing protocol handshake over
device. - run_
target_ handshake_ with_ initial_ data - Runs the target-side framing protocol handshake seeded with
initial_data. - writer_
task - Runs the serial frame writer loop, prioritizing pending ACKs from
ack_trackerahead of coalesced outgoing data frames fromdata_rx.