Usage of IRremote Lib

I'm trying to interface with an off-the-shelf relay box using the codes I've pulled from the devices remote.

Im using lirc to record codes from the remote. I believe my config is set up to record RC-6 (36Hz?). I'm getting an output like this:

//when the remote's ON button is pressed
space 16777215
pulse 100

//when the remote's OFF button is pressed
space 1677215
pulse 150

sometimes i get different values (interference?). anyway, how can i apply these codes to the IRremote lib? What am i looking at here?

The sample ir send code for the library is as follows

#include <IRremote.h>
IRsend irsend;

void setup()
{
  Serial.begin(9600);
}

void loop() {
  if (Serial.read() != -1) {
    for (int i = 0; i < 3; i++) {
      irsend.sendSony(0xa90, 12); // Sony TV power code
      delay(100);
    }
  }
}

It looks like the library is looking for a hex value.. right? and I'm not sure what the 12 is there for. Is it the carrier wave frequency?

and I'm not sure what the 12 is there for. Is it the carrier wave frequency?

I doubt it. Look in the library, to see what the second argument is supposed to be.

No, the second parameter is the length in bits for the protocol.
Usually 12 for Sony and 32 for Nec.
You can read here (it's a long tutorial):

Be patient ...I had many failed attempts before getting a working IR device going. Then I spent time decoding and writing down the hex codes for most of the remotes I had in my house. It helped to see the differences between IR codes + it made it easy when I wanted to add device control around the house . Keep in mind that you will ultimately find a few remotes that just don't seem to be recognised without putting extra effort looking at the number of bits . I had a remote that had to be set at 31 instead of 32 , and then it decoded properly.
As suggested , spend time reading Ken's information as it will help a great deal. Best of luck and enjoy the rewards!
BobbyD

Thanks for the info everyone. My problem is that i dont understand how the output of LIRC applies to the arduino library. There is an option in the library to input "raw codes" but i dont know what exactly that means. Raw codes in what form? Hex, binary, i dont know. I assume its hex, but i dont know how to get from the pulse/space output LIRC is giving me to hex. Can anyone provide any info on that?

Im not using the library to decode these codes (this is my problem). Im using mode2 on LIRC because i only have one arduino and its busy driving the remote that im trying to record these codes from. I think the codes im recording are correct, ive spent a fair amount of time recording them. Is LIRC giving me encoded codes? (sounds stupid, i dont know what im talking about). How can i decode them?
Also... How many bits is this output?