10 Hostmode
151
Every
WA8DED
data packet is completed by the addition of two CRC data-bytes
(binary). The CRC is calculated exactly according to the CCITT-CRC16, and is thus
identical to that used for PR and PACTOR. The CRC is calculated from the first byte
after the #170 - #170 header (channel number). (CRC see AX.25-protocol and example
in the chapter
, page
Directly before the transmission, thus at the lowest sub-protocol level, the data packet
transmitter (MASTER and SLAVE) carries out so-called Byte-Stuffing. This prevents the
#170 - #170 sequence from appearing within a packet.
The Byte-stuffing takes place directly after the 1st byte after the #170 - #170 header, and
ends after the second CRC-byte. It therefore ranges over the complete packet (excepting
the header). Also, even when the second CRC-byte has the value #170, this changes due
to the stuffing. Stuffing means that after every byte with the value #170, a further byte
with the value #0 is inserted. (The CRC calculation is only carried out on the original
packet, not on the stuffed packet.) The packet counter concerns itself always with the
original length of the packet (without stuffing!).
Directly after the packet is received, and thus at the lowest sub-protocol level, the packet
receiver (MASTER and SLAVE) carries out a so-called Byte-de-stuffing. This removes
the #0 bytes inserted by the packet transmitter. The byte-de-stuffing begins directly after
the first byte after the recognized #170 - #170 header. After every byte with the value
#170, one byte is erased, providing it is a #0 byte. (If the following byte does not have a
value of "#0", then error handling is carried out, refer to chapter
, page
The MASTER uses a 1 bit packet-counter, using bit 7 of the CMD/INF-bytes, that is
incremented (= inverted) on sending a
new
(not repeated) packet. This packet counter
(and request flag) allows the SLAVE to positively identify repeated MASTER packets.
The slave possesses the possibility to quickly inform the Master that the last transmitted
packet should be repeated, by inserting a short request packet. The request packet has the
format: "#170#170#170#85".
10.9.3
MASTER protocol
Definition of the MASTER-condition
•
NACK-condition
- When no reaction is received from the SLAVE within 250 ms after the MASTER
transmitted packet has ended.
- This is a minimum time. The PTC-IIIusb answers within a few milliseconds. With
very slow TNCs the waiting time can be changed in the MASTER program.
(Note: Timeout watchdog is stopped as soon as a packet-header is received (i.e. the
packet starts being read in). The maximum useable data length of a
null-terminated
packet must not exceed 256).
- If a packet-header is identified within 250 ms, a packet is read in, and a CRC error
takes place.
- If a request-packet is identified.
•
ACK-condition
- If a data-packet with the correct CRC is received.