Serial Link
The serial link uses the following configuration:
Baud rate: 460800
Data bits: 8
Stop bits: 1
Parity: None
Flow control: None
HDLC
For reliability over the serial link we use HDLC framing (ISO/IEC 13239:20002) framing in Asynchronous balanced mode.
The following subset of HDLC is used:
SABM frames are used to indicate reset of send and receive sequence numbers.
UA frames are used to acknowledge SABM frames.
DATA frames (I-frame with Poll bit). The address field is always set to the broadcast address (255) and not checked on RX.
ACK (S-frame Receive Ready with Final bit)
NACK (S-frame Reject with Final bit).
UI (Unnumbered Information)
The Address and Control fields uses the 8-bit format which means that the highest sequence number is 7.
The FCS field is 16-bit
The HDLC connection will always start sending SABM and waiting for UA. A long period of disconnect or other errors will retrigger the sequence, and the application will be informed of the disconnect.
MyDefence devices will use a 0-length DATA frame for HDLC keep-alive. The peer must confirm these frames like any other data frames. The peer may send keep-alive frames, but is not required to do so.
The included HDLC Reference Library is also used in the MD serial devices. We suggest to use this reference implementation in all clients to ensure interoperability (and to save time making an HDLC implementation). Full source code is provided.
The HDLC Reference Library has not been interoperability checked with other HDLC implementations. In case of deviations, the reference implementation is authoritative.