
DCN Next Generation Open Interface Release 2.4 General
en | 20
Bosch Communications Systems | 2007 February | SRS_INF | Du010933
packet. That sequence number must be used to acknowledge the packet.
‘@’ Defines the acknowledge packet (ACK). The packet only consists of the header
and the checksum. No data is present within this packet. This packet acknow-
ledges the data-message identified with the sequence number passed within the
header.
‘#’ Defines the negative acknowledge packet (NAK). The packet only consists of the
header and the checksum. No data is present within this packet. This packet
requests a retransmission of the data-message identified with the sequence
number passed within the header.
More information about the NAK-packet handling is given in §4.1.2.2.
‘?’ Defines the heartbeat packet. The sequence number passed is the number of the
next packet to be transmitted. The receiver side should use this number to
synchronize the expected sequence number.
The heartbeat message is used to check the communication (see §4.1.2.4.4).
All other types are assumed to be transmission errors and will trigger the transmission of a
NAK-packet.
4.1.2.2 Checksum calculation
The packet is terminated with a checksum section, which holds the checksum over all data
inside the header and message. The checksum section for the ‘Full’ data protocol has the
layout:
correction checksum
Defined as a structure definition:
typedef struct
{
BYTE byCorrection;
BYTE byChecksum;
} RSMT_CHECKSUM;
Where:
byCorrection A correction value for the checksum to ensure that the
calculated checksum never becomes equal to the escape-byte
value (0xC8), see §4.1.2.3. The possible value for this byte will
be either 0x00 or 0x13. No other possible values are allowed.
byChecksum The calculated checksum over the header, the message data
and the correction byte. The calculation sequence is described
below.
The Checksum is calculated using the following sequence:
1. Fill the correction byte with the value 0x00.
2. Sum all bytes over the header, the message and the correction byte.
3. Take modulo 256 of the calculated checksum and do a bitwise invert of the checksum.
4. Check the checksum against the escape value (0xC8). When equal:
a. Fill the correction byte with the value 0x13.
b. Subtract the old correction value (0x00) and add the new correction value (0x13)
to the sum value as calculated in step 2
c. Take modulo 256 of the calculated checksum and do a bitwise invert of the
checksum. The result is never equal to the escape value.
This calculated checksum is sent along with the packet. The receiver executes only the action
2 and 3 and verifies the calculated checksum with the received checksum.
Commenti su questo manuale