PDA

View Full Version : Generating a checksum



russellperry
- 31st January 2014, 19:47
Hello all

I realise this may seem easy to some of you, but I am having some difficulties grasping the concept and executing the generation of a checksum.

What I have done is extract data from a GPS and parse them into one payload of ascii characters like this:

0320080914221805049972100017555023245

Which consists of the date, time position, speed course etc.
What I now need to do is calculate a checksum and send the data in binary format to a modem.

Can I just send the string out on the serial port? At present the message in ASCII is 37 bytes, one for each character, will sending them out as is result in the binary represenation of the ASCII code for that number being transmitted?

If so, this is not what I want, I would like to convert the string into BCD [I am under the impression that this should basically halve the payload] calculate a checksum, count the bytes [checksum included] and send it to
the modem in binary format.

Sorry if this is obvious but I am at a loss here.