What is the first element in decode_results->rawbuf array in IRRemote library?

Hi All,

I've been trying to reverse engineer an LG and a Haier AC and in the process I have captured IR data transmitted by multiple remotes (Sony TV remote, LG AC remote etc, a small general purpose IR remote used for hobby projects) and I've noticed the first pulse to be a unusually long entry on all the remotes. I've tried retransmitting this raw data using an IR transmitter and oddly when I transmit the data with this first entry included the transmitter doesn't work with the device, but with the entry excluded it works just fine. What is this entry why does excluding it and then sending the raw data makes the transmitter work?

Some of the dump from IRRecvDemo Sketch:

LG AC Remote:

Raw (58): 9850, 450, 1600, 450, 600, 450, 550, 500, 550, 450, 1600, 450, 600, 450, 550, 450, 550, 500, 550, 450, 600, 450, 550, 450, 600, 450, 1600, 450, 600, 400, 600, 450, 600, 450, 550, 450, 600, 450, 1600, 450, 1600, 450, 550, 450, 1600, 450, 600, 450, 550, 450, 1600, 450, 1600, 450, 1650, 450, 1550, 500, 

Raw (58): 9850, 500, 1600, 450, 550, 450, 600, 450, 550, 450, 1600, 500, 550, 450, 600, 450, 550, 450, 550, 500, 550, 500, 550, 450, 600, 450, 1600, 450, 550, 450, 600, 450, 550, 500, 550, 450, 600, 450, 1600, 450, 1600, 450, 550, 450, 1600, 450, 550, 500, 550, 450, 1650, 450, 1550, 450, 1650, 450, 1600, 450,

cheap hobby project remote:

Raw (68): 1315400, 8900, 4500, 500, 600, 550, 600, 550, 600, 550, 600, 550, 600, 550, 600, 500, 600, 550, 1650, 550, 1700, 550, 1650, 550, 1650, 550, 1650, 550, 1650, 550, 1700, 500, 1700, 500, 650, 500, 1700, 500, 650, 500, 1700, 500, 650, 500, 600, 550, 600, 550, 600, 550, 600, 550, 600, 550, 1650, 550, 600, 550, 1650, 550, 1650, 550, 1650, 550, 1650, 550, 1700, 500, 
3E3D6F9

Raw (68): 1047300, 8900, 4500, 500, 650, 500, 600, 550, 600, 550, 600, 550, 600, 550, 600, 550, 600, 500, 1700, 550, 1650, 550, 1650, 550, 1650, 550, 1650, 550, 1700, 500, 1700, 500, 1700, 500, 650, 500, 1700, 500, 650, 500, 1700, 500, 650, 500, 650, 500, 600, 550, 600, 550, 600, 550, 600, 550, 1650, 550, 600, 550, 1650, 550, 1650, 550, 1650, 550, 1700, 500, 1700, 500,

Sony TV Remote:

C10
Value of Decode_type: 4  Decoded SONY: C10 (12 bits)
Raw (26): 1546850, 2300, 650, 1150, 600, 1150, 650, 550, 650, 550, 600, 550, 650, 600, 550, 600, 600, 1150, 650, 550, 600, 550, 650, 550, 600, 550, 

C10
Value of Decode_type: 4  Decoded SONY: C10 (12 bits)
Raw (26): 1607100, 2350, 600, 1150, 650, 1150, 600, 550, 650, 550, 600, 600, 600, 550, 600, 600, 600, 1150, 650, 550, 600, 550, 650, 550, 650, 550, 

C10
Value of Decode_type: 4  Decoded SONY: C10 (12 bits)
Raw (26): 928350, 2350, 600, 1150, 650, 1150, 600, 550, 650, 550, 600, 600, 600, 550, 650, 550, 600, 1150, 650, 550, 600, 550, 650, 550, 650, 550,

What is this entry

It is the number of micro seconds since the listening was started until the first pulse arrived. (Yes, almost always an absolute uninteresting piece of information :o )

... why does excluding it and then sending the raw data makes the transmitter work?

Because the to-be-sent data must start with a pulse ("flash", "mark", "on") not with a gap ("space", "off"). (The even numbered entries are sent as "on", the other ones as "off".)

IMHO, really bad design.

For an alternative, check out "Infrared4Arduino", available in the Arduino library manager using the name "Infrared".