Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 1 made on Monday June 23, 2008 at 17:26
Ericbal
Long Time Member
Joined:
Posts:
December 2007
59
Hi,

I am trying to send the following command (RS-232)

"\xF0\x00\x00\x7F\x00\x00\x70\x05\x02\x02\x00\x00\xF1\x21\x00" + volume1 + "x00\x00\x00\x01" + (chk) + "\xF7"

where

- volume1 is a variable that contains a decimal value of room 1 volume
- chk is a checksum calculation

chk calculation is as follows:

chk = 0xF0 + 0x00 + 0x00 + 0x7F + 0x00 + 0x00 + 0x70 + 0x05 + 0x02 + 0x02 + 0x00 + 0x00 + 0xF1 + 0x21 + 0x00 + volume1 + 0x00 + 0x00 + 0x00 + 0x01 + 20;
chk = chk & 0x7F;

When a make the calculation manually, I get a different result than the one I obtain through my script (and displayed thanks to a System.print(chk) command).

I also tried with a (volume1).toString(16) conversion, but result is still not correct.

If I take the example of a volume1 = 13 (decimal), I should have at the end the following RS 232 command:

\xF0\x00\x00\x7F\x00\x00\x70\x05\x02\x02\x00\x00\xF1\x21\x00\x0D\x00\x00\x00\x01\x1C\xF7

ie volume1 = 13 (decimal) = D (hexadecimal)
and chk = 1C

Do you have any idea of how to handle this problem. I guess I have a variable convertion type problem, but I can't figure it out.

Thanks.

Eric.


Hosting Services by ipHouse