Pomoc oko <chksum> := <chksum> XOR <byte>.
21.04.2010. u 07:48 · pre 200 meseci
#1
Example:
START COMMAND BODY CHECKSUM END
ESC P 2 bytes ASCIIcodes 2 bytes ESC \
$l 1111* BDh
1Bh, 50h 24h, 6Ch 31h, 31h, 31h, 31h, 0Ah 42h, 44h 1Bh, 5Ch
Algorithm of checksum
These two bytes are hexadecimal digits representing the checksum of the whole sequence
(COMMAND+DATA) counted as shown below.
Initial value is 255 (FFh)
<chksum> := 255;
And with every byte after ESC P sequence checksum is modified
<chksum> := <chksum> XOR <byte>.
Then <chksum> is translated into 2 hexadecimal digits represented in ASCII codes.
Nisam upucen u ovo ali bi mi bilo od velikog znacaja....
START COMMAND BODY CHECKSUM END
ESC P 2 bytes ASCIIcodes 2 bytes ESC \
$l 1111* BDh
1Bh, 50h 24h, 6Ch 31h, 31h, 31h, 31h, 0Ah 42h, 44h 1Bh, 5Ch
Algorithm of checksum
These two bytes are hexadecimal digits representing the checksum of the whole sequence
(COMMAND+DATA) counted as shown below.
Initial value is 255 (FFh)
<chksum> := 255;
And with every byte after ESC P sequence checksum is modified
<chksum> := <chksum> XOR <byte>.
Then <chksum> is translated into 2 hexadecimal digits represented in ASCII codes.
Nisam upucen u ovo ali bi mi bilo od velikog znacaja....