Expand description
ASH frames: control byte, data randomization, CRC and byte stuffing.
Modules§
- reset_
code - Reset codes an NCP reports in RSTACK and ERROR frames.
Structs§
- Decoder
- Splits a received byte stream into frames: removes stuffing, honours the
cancel and substitute bytes, ignores XON/XOFF, and bounds the buffer at
MAX_FRAME_LENso a stream without flags cannot grow memory.
Enums§
- Frame
- One ASH frame.
- Frame
Error - Why a received frame was dropped.
Constants§
- ASH_
VERSION - The ASH protocol version this crate speaks.
- CANCEL
- Cancel byte: discards the frame in progress.
- ESCAPE
- Escape byte: the next byte is XORed with
FLIP. - FLAG
- Flag byte: ends every frame.
- FLIP
- XOR applied to an escaped byte.
- MAX_
DATA_ LEN - Largest DATA field (the largest EZSP frame).
- MAX_
FRAME_ LEN - Largest frame before stuffing: control, data and CRC.
- MIN_
DATA_ LEN - Smallest DATA field (the smallest EZSP frame).
- SUBSTITUTE
- Substitute byte: a low-level receive error replaced a byte; the frame is bad.
- XOFF
- Software flow control: pause.
- XON
- Software flow control: resume.
Functions§
- randomize
- XOR
datawith ASH’s pseudo-random sequence (seed 0x42, polynomial 0xB8). Applying it twice restores the input.