LG TV IRremote problem?

Sorry for my terrible English :confused:
I'm making a remote control with wifi,now I met a problem,when I send the code which is decoded by IRremote,my TV couldn't read it.
Im sure that the send function is working,beacuse when I send the command,the it receiver could decode the code which I send,but my TV couldn't recognize them.
My TV Is LG 42LS4600,which remoter is compatible with LG LD45 0

This is the program which I use

irsend.sendRC5(0x20DF8877, 32); 
 delay(400);
                break;

I could see Arduino's receiver blink,and computer could get the code correctly ,too.

But I have use this program before

for (int i = 0; i < 3; i++) {
                irsend.sendRC5(0x20DF8877, 32); // TV power code
                delay(400);

                break;

If I use this program,my tv could recognize them,but it will send the code for three times.

How can I solve this problem?does it mean that my TV needs to send the code for more than one time ?

Sorry for my terrible English.

Some IR protocols (I can't remember which ones) do need the data sent 3 times.

marco_c:
Some IR protocols (I can't remember which ones) do need the data sent 3 times.

Thanks.
I found that the problem is the old irremote library defines type 3 as RC5,but in newer library is NEC,so what I need to do is Change sendRC5 into sendNEC.

Thanks for helping,!