HELP IRremote.h

I wanna develop a controller for my TV using Arduino and later on I plan to integrate this program with every device controlled by IR in my house. The problem is that the IRremote.h library allows me only to use some formacts like RAW for example. The website bellow generate the RAW code for any device:
http://irdb.tk/find/

The codes generated are like this:

+4512 -4512 +564 -1692 +564 -564 +564 -1692 +564 -1692 +564 -564 +564 -1692 +564 -564 +564 -564 +564 -1692 +564 -564 +564 -1692 +564 -1692 +564 -564 +564 -1692 +564 -564 +564 -564 +564 -564 +564 -1692 +564 -564 +564 -564 +564 -564 +564 -564 +564 -1692 +564 -564 +564 -1692 +564 -564 +564 -1692 +564 -1692 +564 -1692 +564 -1692 +564 -564 +564 -1692 +564 -44268

I have to use it like this in my sketch:

unsigned int raw[rawlen]:
{4512 ,4512 ,564 ,1692 ,564 ,564 ,564 ,1692 ,564 ,1692 ,564 ,564 ,564 ,1692 ,564 ,564 ,564 ,564 ,564 ,1692 ,564 ,564 ,564 ,1692 ,564 ,1692 ,564 ,564 ,564 ,1692 ,564 ,564 ,564 ,564 ,564 ,564 ,564 ,1692 ,564 ,564 ,564 ,564 ,564 ,564 ,564 ,564 ,564 ,1692 ,564 ,564 ,564 ,1692 ,564 ,564 ,564 ,1692 ,564 ,1692 ,564 ,1692 ,564 ,1692 ,564 ,564 ,564 ,1692 ,564 ,44268}

I have two problems:
1 - how can I know the rawlen of the code to set in my program?
2 - I would like to develop a function in which I put the code generated by this webstie, with the "+" and "-" and it has to replace this caracters with a ",".

How can I do this?

1 - how can I know the rawlen of the code to set in my program?

You don't need to. The compiler can count.

2 - I would like to develop a function in which I put the code generated by this webstie, with the "+" and "-" and it has to replace this caracters with a ",".

What has to replace what characters with a comma, and why?

dynnolucinda:
The problem is that the IRremote.h library allows me only to use some formacts like RAW for example.

That is no problem and it is your choice to use that interface.

RAW is no format at all.

It is included to receive/send datagrams from/to devices using unknown (to the library) formats.

It is (mis)used by people too unexperienced or too lazy, to figure out the real format.

The whole command probably fits in an unsigned long or even smaller container,
which is much better than filling the memory with data that would be generated by the library.

So I would suggest asking BigBrother for 'rc code ' or similar to find out the format of your messages,
which hopefully is supported in the library. Probably somebody tried to control a device like yours before.

Having the commands in an unsigned long helps in comparing received messages,
which is quite hard if you only have raw data for the comparison.

I like my intelligent RC nodes to be able to send and receive,
but that's a matter of taste and system design.

Even with my air conditioner remote control, all I needed was this:-

const byte RECV_PIN = 2;                // Use pin D2 to receive.

IRrecv IRRX(RECV_PIN);                  // Create an instance of the IR receiver.
decode_results result;                  // Holds full 32-bit code in 'result.value'.

then

if(IRRX.decode(&result))                    // If an IR code is received, decode it to 32-bit value
{
    Serial.println(result.value);           // Print it.
    IRRX.resume();                          // Receive the next value
}

and for each button I got a nice 32-bit value for the code.

Did you try this before resorting to raw data?

Then if I wanted to send the data, (which I don't need to), I'd just iterate through from the most common format, testing each in turn with that 32-bit code until it worked.
I forgot about 'dump'. It would hopefully then give the format to use, so no iterating through the formats would be needed, and decoding raw data would only be needed if the format wasn't known.

Whandall:
That is no problem and it is your choice to use that interface.

RAW is no format at all.

It is included to receive/send datagrams from/to devices using unknown (to the library) formats.

It is (mis)used by people too unexperienced or too lazy, to figure out the real format.

The whole command probably fits in an unsigned long or even smaller container,
which is much better than filling the memory with data that would be generated by the library.

So I would suggest asking BigBrother for 'rc code ' or similar to find out the format of your messages,
which hopefully is supported in the library. Probably somebody tried to control a device like yours before.

Having the commands in an unsigned long helps in comparing received messages,
which is quite hard if you only have raw data for the comparison.

I like my intelligent RC nodes to be able to send and receive,
but that's a matter of taste and system design.

Thanks for the answer Whandall. Forgive me mine ignorance about the subject.
Let me explain better my project. I work with Home Automation, and wanna develop an Arduino controller for this purpose.
The problem about the IR codes, is that I need a database to work with. In my case, I have a huge database to use in my programs, but the codes are in the formact bellow:
PS.: I don't know the name of this formact, I know it by "hex pronto codes".

Power_ON: (Carrier 37,73585Khz ... One Time Byte Count = 68 ... Repeat Byte Count = 4)
0000 006d 0022 0002 0155 00a8 0016 0014 0016 0014 0016 003f 0016 0014 0016 0014 0016 0014 0016 0014 0016 0014 0016 003f 0016 003f 0016 0014 0016 003f 0016 003f 0016 003f 0016 003f 0016 003f 0016 0014 0016 003f 0016 003f 0016 003f 0016 0014 0016 0014 0016 003f 0016 003f 0016 003f 0016 0014 0016 0014 0016 0014 0016 003f 0016 003f 0016 0014 0016 0014 0016 0600 0155 0053 0016 0e3c

The thing is, I cannot use this code in Arduino, instead I have two options:
1 - use the RAW code that I am able to find on the website;
2 - convert this code to use it with IRremote.h library;

Since I have no idea how to convert it, I already tried a lot, I pretend do use the RAW codes from the website irdb.tk/.

My idea is to program the sketch like this:

unsigned int Power_ON[88]={21916,9050,4350,700,500,650,1550,700,1500,700,550,700,450,700,1550,700,1500,700,550,650,500,700,500,650,500,700,550,650,500,700,1550,650,500,700,550,650,1550,700,1500,700,500,700,500,700,1550,650,1550,700,1500,700,1600,650,1550,650,1600,700,1500,700,500,700,450,700,550,700,1500,700,500,700,450,700,1600,650,500,700,1550,650,1550,650,1600,700,450,700,1550,700,1500,700,450,650};

if(button=="ON"){
irsend.sendRaw(Power_ON,88,38);
delay(40);
}

PaulS:
You don't need to. The compiler can count.
What has to replace what characters with a comma, and why?

Hi PaulS, thanks for the answer.
I would like to replace the characters '+' and '-' for comma because the website that generates this codes does this with the '+' and '-' like above and I found a example of sketch to use this codes, and it is like this:

unsigned int Power_ON[88]={21916,9050,4350,700,500,650,1550,700,1500,700,550,700,450,700,1550,700,1500,700,550,650,500,700,500,650,500,700,550,650,500,700,1550,650,500,700,550,650,1550,700,1500,700,500,700,500,700,1550,650,1550,700,1500,700,1600,650,1550,650,1600,700,1500,700,500,700,450,700,550,700,1500,700,500,700,450,700,1600,650,500,700,1550,650,1550,650,1600,700,450,700,1550,700,1500,700,450,650};

if(button=="ON"){
irsend.sendRaw(Power_ON,88,38);
delay(40);
}

And about the rawlen, I tried to take it off, but it didn't compile, because it is missing a field in the function irsend.sendRaw(rawbuf, rawlen, frequency);

I played a little with IRemote and the last of the codes you posted.

You can make IRecv decode your raw values,
just adjust them to the internayl used format of 50µS units (your values are in 1µS units),
feed them to the samples array and decode it.

Details in the sketch

/*
 * based on: IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
 * No IR detector/demodulator must be connected to the input RECV_PIN.
 */
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

int rawValues[] = /**/ {21916, 9050, 4350, 700, 500, 650, 1550, 700, 1500, 700, 550, 700, 450, 700, 1550, 700, 1500, 700, 550, 650, 500, 700, 500, 650, 500, 700, 550, 650, 500, 700, 1550, 650, 500, 700, 550, 650, 1550, 700, 1500, 700, 500, 700, 500, 700, 1550, 650, 1550, 700, 1500, 700, 1600, 650, 1550, 650, 1600, 700, 1500, 700, 500, 700, 450, 700, 550, 700, 1500, 700, 500, 700, 450, 700, 1600, 650, 500, 700, 1550, 650, 1550, 650, 1600, 700, 450, 700, 1550, 700, 1500, 700, 450, 650};
void setup()
{
  Serial.begin(115200);
  if ((sizeof(rawValues) / 2) < 101) {
    irparams.rcvstate = STATE_STOP;
    irparams.rawlen = sizeof(rawValues) / 2;
    for (int idx = 0; idx < irparams.rawlen; idx++) {
      irparams.rawbuf[idx] = rawValues[idx] / 50;
    }
    if (irrecv.decode(&results)) {
      Serial.print("Protocol = ");
      Serial.print(protoName(results.decode_type));
      Serial.print(" (");
      Serial.print(results.decode_type);
      Serial.print(") value = 0x");
      Serial.println(results.value, HEX);
    }
  } else {
    Serial.print("Too many samples ");
    Serial.print(sizeof(rawValues) / 2);
    Serial.println(" max is 101");
  }
}
void loop() {}
const char* pText[] = {
  "ILLEGAL", "UNKNOWN", "UNUSED", "RC5", "RC6", "NEC", "SONY", "PANASONIC", "JVC", "SAMSUNG",
  "WHYNTER", "AIWA_RC_T501", "LG", "SANYO", "MITSUBISHI", "DISH", "SHARP", "DENON", "PRONTO"
};
const char* protoName(int pTyp) {
  if (pTyp < -1 || pTyp > PRONTO) {
    return pText[0];
  }
  return pText[pTyp + 2];
}
Protocol = NEC (3) value = 0x6604CFE2