The inverse of 3B is C4 you then need to add one
You will also have to be carefully when it goes over 255 if the checksum is
only 1 byte
In finding the two's complement of a binary number, the bits are inverted,
or "flipped", by using the bitwise NOT operation; the value of 1 is then
added to the resulting value.
-----Original Message-----
From: commandfusion@googlegroups.com [mailto:commandfusion@googlegroups.com]
On Behalf Of stbluesrul
Sent: 12 February 2010 08:22
To: CommandFusion
Subject: Re: Slider with Checksum
For the string \x08\x22\x01\x00\x00\x10 the checksum is C5
It's the 2's complement of the sum of all the values (That's what the
manual says). Now the way I understand this, is that it is basically
the sum of
(08+22+01+00+00+10) = 3B
Then take the inverse of 3B which is C5
I have an excel spreadsheet that can calculate this. You can also do
this in the windows scientific calculator. I can email you
spreadsheet if you like.
Here are the steps in the windows scientific calculator:
1) Scientific mode
2) Set to Hex
3) Set to Byte
4) Add up 08+22+01+00+00+10
5) Should = 3B
6) To get the inverse simply click the "+/-" button and the output
should be C5
On Feb 11, 6:27 pm, Jarrod Bell <jar...@guilink.com> wrote:
> I believe this will be possible in an upcoming release that allows for
> math expressions within commands.
>
> Could you post how to mathematically calculate the checksum for the
> protocol above? Then I can ensure our math system (which is already
> working in our beta builds) will be able to do this.
>
> Jarrod
>
> On Feb 12, 12:00 pm, stbluesrul <paul.l.cra...@gmail.com> wrote:
>
> > Is it possible to use the slider with a hex command that requires a
> > checksum at the end of it?
>
> > This will be for direct volume on a TV.
>
> > Examples:
> > \x08\x22\x01\x00\x00\x00\x2B - Volume to 0
> > \x08\x22\x01\x00\x00\x10\xC5 - Volume to 10
> > \x08\x22\x01\x00\x00\x64\x71 - Volume to 100
>
> > The sixth byte would be replaced with [sliderval].
> > Since that number will change to where ever the slider is moved to, it
> > is going need a different checksum for each different volume level.
> > The checksum is two's complement and is the seventh byte as shown.
> > Will this be possible?
--
You received this message because you are subscribed to the Google Groups
"CommandFusion" group.
To post to this group, send email to commandfusion@googlegroups.com.
To unsubscribe from this group, send email to
commandfusion+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/commandfusion?hl=en.
--
You received this message because you are subscribed to the Google Groups "CommandFusion" group.
To post to this group, send email to commandfusion@googlegroups.com.
To unsubscribe from this group, send email to commandfusion+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/commandfusion?hl=en.


Comments
0 comments to "RE: Slider with Checksum"
Post a Comment