[plug] OT: Data check digits

Adam Davin bladebadger at westnet.com.au
Tue Jun 1 14:43:42 WST 2004


Hi All, 

This might turn up under a different email, sorry for the duplication, I just got a message back re Moderation (I must have forgotten to change my address)

Thanks for the response. Sorry for the ambiguity I didn't want to mess up the example file with annotations ;-). I have included the same file with annotations above each line this time. Hope this makes things a bit clearer. :)
'0' = ttyS0 = PDT
'1' = ttyS1 = Host Computer
## PDT sends ENQ(0x05) to Host
0>1: \x05
## Host ACK's(0x06) ready for data.
1>0: \x06
## (0x01) Start of Header, BHTQTYS.DAT - name of file to save as on host computer, 00003- 3 records, 05 13 04 08 08 08 - length of each field, (0x03) - ETX end of transmission, '5' - some sort of data check digit
0>1: \x01BHTQTYS.DAT 00003051304080808\x035
## Host received transmission ok ACK
1>0: \x06
## Next bit is the same for each line. 
## PDT Record 1, 0x02 -STX start transmission, 00001 Record 1, 9311742999380 - barcode, 0005 - Quantity of 5, 8 Spaces, 8 Spaces, 8 Spaces - last 3 records, 0x03 - ETX, 0x07 - check digit.  
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
## End of Transmission
0>1: \x04
## ACK
1>0: \x06

The idea of snooper is that you plug the host in to one com port, the device into another and it just relays and records the information between the two. Anything that is not preceded by a \x is a literal character, anything preceded by a \x is somthing that can't be "displayed" and thus its Hex value is being shown. On the end of each line sent from the PDT to the Host, is a "character" that I am assuming is a check digit to make sure the data was transferred correctly. Unfortunately I am not sure how to go about finding out how this is calculated. I know the principles but not the practical implementations. I am guessing that some how it takes the string "0000193117420003800005                        " (including blank fields) and and's or or's or xors or something and comes up with the '\x07' at the end, its this final character that I'm not sure how it goes about arriving at. Because the program I am writing has to emulate the PDT as closely as possible, I need to know ho
 w those check digits are calculated. 

The software is Proprietary and provides a commandline serial interface to the PDT. It is called tu3a.exe and is used in conjunction with the BHT PDT's.

Thanks again for any help or pointers you can offer. 

Regards, 

Adam Davin. 

On Tue, 1 Jun 2004 09:03:01 +0800 (WST)
Shayne O'Neill <shayne at guild.murdoch.edu.au> wrote:

> 
> Yup. Thats what I'm thinking too.
> 
> Quick warning also. I'm gathering this is uploading some sort of file to a
> pda yeah?
> 
> If so *be careful!*. That first packet with file name MAY have a physical
> address to upload to. Get that wrong and you could permanantly give the
> pda brain damage.
> 
> ------------------------------------
> "Must not Sleep! Must warn others!"
> -Aesop.
> Shayne O'Neill. Indymedia. Fun.
> http://www.perthimc.asn.au
> 
> On Tue, 1 Jun 2004, Paul Arch wrote:
> 
> >
> > > 0>1: \x020000193117420003800005                        \x03\x07
> > > 0>1: \x0200002742709112010 0003                        \x03\x1e
> > > 0>1: \x0200003637407193402 0015                        \x03\x18
> >
> > Sorry, forgot to finish !
> >     In lines 2/3, should there be any spaces ( I will assume there isn't).
> >
> >     \x02        could be ascii "START OF TEXT" (in hex)
> >     \x03        could be ascii "END OF TEXT" (in hex)
> >
> >     \x07, \0x1e and \x18 would be your checksums
> >
> >   looks like a 8 bit checksum of some sorts ?
> >
> >   Maybe CRC-8 ? Dunno, but I just saw an email from Shayne maybe be can work
> > it out ?
> >
> >
> >  cheers
> >
> >
> >
> > _______________________________________________
> > 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
> >
> 
> _______________________________________________
> 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