# packet -- Reliable HDLC Transport

A reliable, ordered serial-transport layer.  HDLC-style byte stuffing
(FLAG=0x7E, ESC=0x7D), CRC-16-CCITT integrity, and Go-Back-N sliding-
window retransmission over any byte-oriented link.  Sits on top of the
rs232 driver (or the Linux socket shim used by the proxy).

## Documentation

Full reference is in the combined serial stack doc:
`../serial.dhs` (the `packet` section).  It compiles into the DVX System
Reference -- open via the Help Viewer app, or read
`docs/dvx_system_reference.html` after `make`.

Topics covered: connection open/close, send/poll, frame format, window
size, retransmit timer, CRC polynomial and initial value, error codes,
callback contract.

## Source Files

- `packet.h`   -- public API and error codes
- `packet.c`   -- implementation (framing, CRC, sliding window)

## Build

`make -C src/libs/kpunch/serial/packet` (invoked by the top-level `make`
via the serial subdirectory).
