FearTheDentist
December 7th, 2009, 10:09 PM
Working on another serial plugin (sorry Rob :D ), this time for DirecTv HD receivers\DVRs.
I've got G5 talking to the unit, and can send simple commands no problem. 2 issues:
First- the responses from the unit are in hexadecimal- is there a way to tell G5t to convert this to ASCII? When I print (data) from a response from the receiver I get stuff like this: HR20 Data ð. How can "ð" be converted to a form that G5 or NR can use?
Second- a much bigger concern is how to write the script for direct channel input. For a direct channel command, the structure is:
[command byte][major channel hi][major channel lo][minor channel hi][minor channel lo]
So- to change to channel 276 the command is A60114FFFF.
A6=command byte, 01 14 = "276" in hexadecimal, FF FF= no minor channel (most channels do not have minor channels. I haven't figured out what they even are yet, possibly HD vs standard def?). If the hexadecimal for the channel is 2 chars only, then [major channel hi] is "00" eg change to channel 250 = A600FAFFFF.
So- G5 has to know that when a numerical keypress is entered on the remote that it has to "build" a command. My thought is that G5 should send the command when either 1) 4 digits have been entered; 2) less than 4 digits followed by "enter"; or 3) less than 4 digits are entered followed by a time out (or alternatively a time out could clear the command, maybe that could be a preference to be set by the user).
This is all fine and dandy, but I have only the vaguest notion of where to begin :(
Attached are my plugin so far and the serial protocol.
As usual your help is greatly appreciated!
Brian
I've got G5 talking to the unit, and can send simple commands no problem. 2 issues:
First- the responses from the unit are in hexadecimal- is there a way to tell G5t to convert this to ASCII? When I print (data) from a response from the receiver I get stuff like this: HR20 Data ð. How can "ð" be converted to a form that G5 or NR can use?
Second- a much bigger concern is how to write the script for direct channel input. For a direct channel command, the structure is:
[command byte][major channel hi][major channel lo][minor channel hi][minor channel lo]
So- to change to channel 276 the command is A60114FFFF.
A6=command byte, 01 14 = "276" in hexadecimal, FF FF= no minor channel (most channels do not have minor channels. I haven't figured out what they even are yet, possibly HD vs standard def?). If the hexadecimal for the channel is 2 chars only, then [major channel hi] is "00" eg change to channel 250 = A600FAFFFF.
So- G5 has to know that when a numerical keypress is entered on the remote that it has to "build" a command. My thought is that G5 should send the command when either 1) 4 digits have been entered; 2) less than 4 digits followed by "enter"; or 3) less than 4 digits are entered followed by a time out (or alternatively a time out could clear the command, maybe that could be a preference to be set by the user).
This is all fine and dandy, but I have only the vaguest notion of where to begin :(
Attached are my plugin so far and the serial protocol.
As usual your help is greatly appreciated!
Brian