Protocol control byte, Length, Header edc – MagTek MCP User Manual

Page 10

Advertising
background image

MCP Serial Transport Protocol

4

Protocol Control Byte

The protocol control byte (PCB) provides information about the frame type, EDC protection
used, chaining and sequencing. Below is the diagram of the PCB:

7 6 5 4 3 2 1 0

FT

FT – – – – – –

MSB

LSB

• FT

Frame Type (2 bits)


The contents of the protocol control byte is dependent on the frame type. The following frame
types are defined:

• I-frames (FT=00) – carry application data

• R-frames (FT=11) – used for receipting I-frames
• S-frames (FT=10) – supervisory frames used for transmission control


Each of the three frame types are described in more detail later in this document.

Length

The length field specifies the length (in bytes) of the data field that follows the frame header.
The length of the EDC field is not included. It uses two bytes (the most significant byte first)
and may indicate up to 65,535 bytes of application data.

If the length is 0, this indicates that the data field is not used.

Header EDC

HEDC conveys the error detection code of the frame header. The error detection method is
always 8-bit LRC. The LRC is defined so that the exclusive-OR sum of all bytes in the header
(from DA to HEDC) is zero.

A node may need to check the HEDC of a received frame only if the EDC for the whole frame is
incorrect. The presence of HEDC allows faster recovery from damaged frames in case the
header itself is intact. If a node receives a frame with an incorrect frame EDC and a correct
header EDC, this node can ask the sender to retransmit the frame instead of waiting for the
sender to timeout. This mechanism is completely optional: the recipient may ignore such
partially damaged frames and the sender may ignore requests to retransmit. This affects only the
time that it takes to recover from the damaged frame.

Advertising