IRTrans Hex code format

Software related support

Moderator: marcus

Re: IRTrans Hex code format

Postby IRTrans » Tue 21. Feb 2012, 16:49

Hi,
the IRTrans keeps the TCP connection open. In general that works very reliable, therefore I suppose the problem is on the Android side.

Anyways, I would strongly recommend to use UDP - it is a lot easier to handle and more reliable as it does not use any connections.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: IRTrans Hex code format

Postby touchsquid » Tue 21. Feb 2012, 17:28

Translation Problem solved. The timings are reversed from what was in the previous post, the OFF timings come first

Offset 18 - 82: Timing data. 8 words of OFF times followed by 8 words of ON times

Also these are in increments of 8 microseconds, must multiply by 8 to get actual timings, then divide by pulse length in microseconds to get number of pulses.

Anyway, I now have a workable pronto code. I will have to test a few other examples before I'm confident, but at least codes for a Sharp TV can be captured and resent as pronto ccf.

It would be useful to document this correctly and in detail. Thanks for the help!

I will use UDP for sending.
touchsquid
 
Posts: 7
Joined: Mon 13. Feb 2012, 18:11

Re: IRTrans Hex code format

Postby IRTrans » Tue 21. Feb 2012, 22:12

Your are right, the pause values come first.

You are also right regarding the 8µs resolution.

In general the format is not documented because we do not encourage anybody to use this (internal) format.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: IRTrans Hex code format

Postby billytcherno » Thu 10. May 2012, 07:46

Hi all

can someone tell me what is put in the upper 4 bits of the Mode flag byte? from the previous posts I seen that only 4 bits are used

with reference to the .rem file definitions, where does the No Toggle flag go into the Hex representation of the IR command?

and lastly, is it important to to calculate the checksum field when doing Asndhex, or is that ignored? (I have a LAN version of the IRTrans transceiver)

Tx
billytcherno
 
Posts: 16
Joined: Thu 10. May 2012, 07:43

Re: IRTrans Hex code format

Postby IRTrans » Thu 10. May 2012, 13:19

The additional options are quite complicated because they also depend on the options set in the lower part of the modeflag.
As already said this is an internal format that is not documented.

If you are using sndhex the checksum is not needed.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: IRTrans Hex code format

Postby billytcherno » Thu 10. May 2012, 15:26

Tx

is the Command byte of any relevance? (I understand the Address and Mask bytes are not)

I am going to the C code of the server implementation, and it is quite hard to read without any comments in the code. For example, in remote.h I find this

#define START_BIT 1
#define REPEAT_START 2
#define START_MASK 3
#define RC5_DATA 4
#define RC6_DATA 8
#define IRDA_DATA 12
#define NO_TOGGLE 2
#define NO_TOGGLE_H 64
#define MACRO_DATA 32

but is nowhere used in any .c file (unless Spotlight on my Mac did not index properly the files) ?
billytcherno
 
Posts: 16
Joined: Thu 10. May 2012, 07:43

Re: IRTrans Hex code format

Postby IRTrans » Thu 10. May 2012, 15:55

Some of the flags are used - mainly in lowlevel.c and fileio.c. Others are only used by the firmware.

Anyways, the mode flags are quite complicated as they depend on other bits of the mode. The reason is that this is a "grown" structure and memory is very valuable in an embedded design.

We strongly suggest to use our IRDB devices that can be controlled with ASCII Strings.

In general we cannot support the binary structure as an API and it can and will change from time to time.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: IRTrans Hex code format

Postby billytcherno » Sun 20. May 2012, 12:35

I try to understand of the command, mask... fields at the beginning are really needed or not. A previous post seems to say that they are not important. However,

when sending a command through IR Red, i capture on the network:

0000 00 22 3e 08 07 dd b8 8d 12 08 45 44 08 00 45 00 .">..... ..ED..E.
0010 00 ae 39 f2 00 00 40 11 bd ee c0 a8 00 90 c0 a8 ..9...@. ........
0020 00 7e c5 86 52 08 00 9a 39 b6 c8 00 00 00 00 00 .~..R... 9.......
0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4e 8f ........ ......N.
0070 06 01 ff ff 22 26 03 0b 02 37 00 bd 00 00 00 00 ...."&.. .7......
0080 00 00 00 00 00 00 00 33 04 4b 00 4b 00 00 00 00 .......3 .K.K....
0090 00 00 00 00 00 00 00 00 83 5b 53 31 30 31 30 30 ........ .[S10100
00a0 31 30 31 30 31 30 31 31 30 31 30 30 31 30 31 30 10101011 01001010
00b0 30 30 30 31 30 31 30 31 31 31 31 30 00010101 1110

doing the same command via Asndhex based on the posts in this thread, I send :

Asndhex LD,H4E00000000002226030B023700BD000000000000000000000033044B004B000000000000000000000003835B53313031303031303130313031313031303031303130303030313031303131313130

which is the same apart from the fields in the beginning. I get a RESULT OK back from the transceiver, but nothing happens when I send the Asndhex. IR Red works, obviously.

IRRed however, does not include the number of pulse pair definitions (before the repeats byte), even if captured via the learn mode
([N]3[1]8600 4184[2]600 440[3]600 1512[RC]3[FL]91[FREQ]38[SB][RS][D]S101001010101101001010000101011110 is the format in .rem)

so, are the command/mask/... fields required or not? Am I missing something here ? (this is on the LAN version of the ir transceiver, connected via TCP/IP ) (IRRed does everything via UDP)

Tx for the help
billytcherno
 
Posts: 16
Joined: Thu 10. May 2012, 07:43

Re: IRTrans Hex code format

Postby billytcherno » Sun 20. May 2012, 14:09

Ok i switched the endianness but that not change the result
billytcherno
 
Posts: 16
Joined: Thu 10. May 2012, 07:43

Re: IRTrans Hex code format

Postby IRTrans » Sun 20. May 2012, 14:15

You cannot directly compare the binary commands with the commands sent with sndhex. The sndhex codes are pre/postprocessed while the binary codes are not.

In the binary format they are needed and some (e.g. Time count) are even used as special flags when sending.

As I already wrote - the format is very complex as it is highly compressed to save space for the IR Code itself.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

PreviousNext

Return to Software

Who is online

Users browsing this forum: No registered users and 13 guests