[plug] OT: Data check digits
John Usher (Maptek)
John.Usher at perth.maptek.com.au
Tue Jun 1 10:59:11 WST 2004
OK. This is a simple checksum... (or should that be checkxor)
Start with checksum 0.
Given a data stream SXXXXXXXXXXXXXXXXXXXXXXXEC
For all characters in the data stream except for the S:
xor the checksum with the character
ie in all these cases the last character xor'd is the CRC.
You should get \x00.
(alternatively, think of checksuming it all except the S and the C, and
you should get a result thats the same as the C.)
...John...
-----Original Message-----
From: plug-bounces at plug.linux.org.au
[mailto:plug-bounces at plug.linux.org.au] On Behalf Of Adam Davin
Sent: Monday, 31 May 2004 7:49 PM
To: PLUG
Subject: [plug] OT: Data check digits
Good Evening all,
This is slightly off topic.
I am embarking on a learning journey to write a program that will take
the place of a PDT (portable data terminal) the software on the PDT is
proprietary and source is not available to me. What I have been able to
do is borrow one of the PDT's and take a look at the serial
communication between the PDT and the destination program using snooper.
Below is a sample output. I can deal with most of it. The bit I am
having problems with at present is the last 2(?) bytes on each line. I
realise that these are check digits of some sort, I'm just not sure
where to start in going about figuring out how they are calculated.
Below is a sample. If more samples are required, I can get some more.
0>1: \x05
1>0: \x06
0>1: \x01BHTQTYS.DAT 00003051304080808\x035
1>0: \x06
0>1: \x020000193117420003800005 \x03\x07
1>0: \x06
0>1: \x0200002742709112010 0003 \x03\x1e
1>0: \x06
0>1: \x0200003637407193402 0015 \x03\x18
1>0: \x06
0>1: \x04
1>0: \x06
Any help would be greatly appreciated.
Thanks in advance.
Regards,
Adam Davin.
_______________________________________________
PLUG discussion list: plug at plug.linux.org.au
http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
Committee e-mail: committee at plug.linux.org.au
More information about the plug
mailing list