Checksum (Chk) - inout Panelplayer User Manual

Amplified player of audio mp3 with a solid state memory
Table of Contents

Advertisement

9.13 CheckSum (CHK)

The CheckSum makes sure that the packs are complete and not corrupted during their
transmission by any noise induced on the line.
The CheckSum is calculated summing the hexadecimal value of the ASCII characters
contained in the data area defined for the CheckSum. The two least significant characters
(in hexadecimal) of the sum represent the CheckSum which is introduced into the two
dedicated ASCII characters at the end of the pack (before any CR and LF characters).
Note ! The sum of the value in decimal of the ASCII codes, converted into hexadecimal,
must give the same result. Introduction and management of the CheckSum is established
by the CMCK parameter of the configuration file.
If CMCK=1 has been set, CheckSum will be calculated automatically and added to the
term of the reply pack (the one beginning 'STX') when this is delivered. When a pack is
received, Panelplayer calculates the new CheckSum and compares it with the one
contained in the pack itself; if it agrees, Panelplayer goes on to perform the command,
otherwise it delivers an error pack (pack beginning with 'NAK').
If CMCK=0 has been set, CheckSum will not be delivered in transmission and will not
be compared (also because it is missing in the data) in the received messages. The
following figure shows an example of calculation of CheckSum in a command pack
delivered by the master.
Panelplayer User Manual v.1.4
ADD
CMD
E
0 1 5 0 0 1 3 2
N
Q
05H
30H
31H
35H
30H + 31H + 35H + 30H + 30H + 31H + 33H +
DATA
CHK
8 C
30H
30H 31H 33H 32H 38H
Page 39
43H

Advertisement

Table of Contents
loading

Table of Contents