View Full Version : What format of IR Hex codes is this?


aymanme
06-17-08, 01:55 AM
I've asked about this in some JP1 related forums, but thought I might ask here as well. Basically, one of our (potential) users has requested IR codes in "hex" format. What I have is the deviceId and functionId, for example:

Sony DVD Audio Button: 9D,64

They would like this format:

Audio = 00 01 B5 00 54 A0 00 23 00 01 00 00 01 00 00 02 0F FF

I am not familiar with this format and not sure how to convert what I have to this format. Any pointers?

Thanks
- ame

dobyken
06-22-08, 04:23 PM
Sony DVD Audio Button: 9D,64

They would like this format:

Audio = 00 01 B5 00 54 A0 00 23 00 01 00 00 01 00 00 02 0F FF

I am not familiar with this format and not sure how to convert what I have to this format. Any pointers?

Thanks
- ame

It looks like Decimal codes to me. I wrote some software a couple of years ago to convert Pronto hex codes and convert them to DEC codes used by my Global Cache GC100 network IP module. The code below works opposite to what you want to do but should give you an idea.

Private Function hex2Dec(ByVal HexStr As String) As Integer

Dim decimalInt As Integer = System.Convert.ToInt32(HexStr, 16)
hex2Dec = decimalInt
End Function

'Convert each hex commnd to dec and
'format the native GC100 command
GCFREQ = 4145146 / hex2Dec(ProntoCode(1))
GCCmd = "SendIR," & GCDev & ":" & GCPort & ",101," & Str(GCFREQ)
For k = ProntoCode.GetLowerBound(0) To ProntoCode.GetUpperBound(0)
If k > 1 Then
GCCmd = GCCmd & "," & Str(hex2Dec(ProntoCode(k)))