Your Universal Remote Control Center
RemoteCentral.com
RS-232 & IP Control Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 1 made on Friday December 13, 2019 at 11:19
JohnL28
Long Time Member
Joined:
Posts:
July 2006
40
I’ve always had issues with RS232 inputs in HEX. I’m hoping someone can help. I created two simplified examples to help explain the issue.

In Scenario 1, I just send a HEX code to the TV. Works perfectly.

In Scenario 2, I manipulated data and create the HEX code in the necessary format. When I send to the TV, it does nothing.

Does anyone know what I need to do in Scenario 2 to get the TV to accept the code? It is likely some type of ASCII to HEX conversion but can’t figure it out.

SCENERIO 1:

var SendHex1 = "\x08\x22\x01\x00\x00\x0F\xC6";
System.print("SendHex1 [" + SendHex1 + "]");
Serial.OT.send(SendHex1);

Output:
SendHex1 [ " [hex format]

Result:
TV resets volume to 15

SCENERIO 2:

var SendHex2 = "08 22 01 00 00 0F C6";
SendHex2 = "\\x" + SendHex2.replace(/\s/g, "\\x");
System.print("SendHex2 [" + SendHex2 + "]");
Serial.OT.send(SendHex2);

Output:
SendHex2 [\x08\x22\x01\x00\x00\x0F\xC6]

Result:
TV does nothing


Hosting Services by ipHouse