FrameDecoder

Streaming decoder state machine for TCP/Serial transports.

Handles the resync algorithm per protocol.md §2 to recover from garbage on the wire. Thread-safe by virtue of being stateless; each decoder owns its state.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun feed(b: Byte): FromRadio?

Feed a single byte into the decoder.

Link copied to clipboard
fun feedBytes(bytes: ByteArray): List<FromRadio>

Feed a byte array, yielding all complete frames.

Link copied to clipboard
fun reset()

Reset the decoder to initial state (e.g., on disconnect).