0 байт в расчете CS вроде не участвует. или участвует, что-то не догоню...
Код HTML:
4.4. BCC generation
The following example shows how the BCC is generated:
BCC = 0, before the first character of a telegram is received (STX)
BCC 0 0 0 0 0 0 0 0
After the first character has been received: BCCnew = BCCold EXOR "first character"
(EXOR = exclusive OR logic operation)
BCCold = 0 0 0 0 0 0 0 0
EXOR
"first character" = 0 0 0 0 0 0 1 0 ( ^ STX)
________________________________________________
BCCnew = 0 0 0 0 0 0 1 0
After each additional character has been received, this is EXOR’d with BCCold EXOR, in order to regenerate
BCCnew, e. g.:
BCCold = 0 0 0 0 0 0 1 0
EXOR
"second character"= 1 1 0 1 0 1 1 0
________________________________________________
BCCnew = 1 1 0 1 0 1 0 0
The result is the BCC after the last net character.