[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on How the Checksum is Computed, please help!

From: marjon
Subject: Re: Question on How the Checksum is Computed, please help!
Date: Thu, 02 May 2002 18:48:07 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv: Gecko/20020314 Netscape6/6.2.2

by "adjusted", what do you mean?

C. Kemp wrote:

The last two bytes are the 'checksum' but they are adjusted so that the xor combination of the odd bytes equals the xor combination of the even bytes. The line you are missing is:

/* XOR the byte with the current checksum */
i->checksum[i->BufferCount & 1] ^= rx_byte;

which is performed on every byte as it arrives. The two checksum stores are set to zero before the message is processed, and then the check below is performed after the above code has been performed on the two checksum bytes.



On Thu, 2 May 2002, marjon wrote:

I would like to ask on how the checksum is computed?
This was the line I found in gnokii, module FBxx_RX_StateMachine(char rx_byte):
----> if (checksum[0] == checksum[1])
But what is the received bytes were like this:

I mean, I get checksum[0] = 0xcf & checksum[1] = f1
But they would never be equal right? so the program would not pass
through the  if statement?  But as I understand, it does? how is this?
Please explain.


gnokii-users mailing list

gnokii-users mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]