Help please, how do you send data on API mode on Xbee series 1?

Hello everyone,
I am just starting to play with the arduino Fio and xbee’s for a project. I did successfully send data from one xbee to the other on transparent mode (AT). Now, after understanding how API works, I want to send data on API mode and then play with the fields (like RSSI, payload, etc) on the receiver side. I know that I have to form a frame that starts with 0x73…etc etc, but I dont see them communicating at all (receiver doesnt get any info) when I turn the arduino Fios on. Here is my code for the transmitter and receiver nodes. I would really appreciate it if someone could tell me where I am failing (PS: I configured transmitter with MY = 0001 and receiver with MY = 0002. Both work at same boud rate, are in the same channel and PAN ID):

Sender code:

// Sender
uint8_t frame[] = {0x7E, 0x00, 0x0A, 0x01, 0x01, 0x00, 0x02, 0x00, 0x48, 0x65, 
                  0x6C, 0x6C, 0x6F, 0xB8};

void setup()
{
  Serial.begin(57600);
  delay(1000);
  Serial.flush();
}

void sendByte(uint8_t &data)
{
  Serial.print(data, BYTE);
}

void loop()
{
  // 7E 00 0A 01 01 00 02 00 48 65 6C 6C 6F B8
  
  for(int j = 0; j < sizeof(frame); j++) 
    sendByte(frame[j]);
  
  Serial.flush();
  delay(3000);
}

For the receiver:

#include <stdlib.h>
// Receiver
uint8_t incomingByte;

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

void loop()
{
  while(Serial.available())
  {
    incomingByte = Serial.read();
    Serial.print(incomingByte, HEX);
  }
  Serial.println();
}

Thank you very much!!!

There is a library, XBee, that builds the frames for you. Is there some reason not to use it?

I dont want to use it for the main reasons:

  1. I am doing the code in arduino and then need to pass it to an FPGA (Spartan 6 using Eclipse). This library uses some other Arduino libraries and I will probably find lots of errors...
  2. I wanted to go for something more simple. I don't need to extract a lot of info from the packages or maybe yes. I mean, that library includes a lot of things that I won't use...anyways, I was this close to use...

I was reading some more yesterday about the xbees and I think it may not work because both of the Xbees are end nodes, what do you think? I am not sure about it anyways. Usually people have one coordinator, but I want to form a point-to-multipoint network...so I can reach destination hop by hop and I can decide which hop to take at each time...Series 1 and end-nodes with API mode should do this right?

This library uses some other Arduino libraries and I will probably find lots of errors...

You'd be the first one, then. Lots of other people have used it successfully.

but I want to form a point-to-multipoint network...so I can reach destination hop by hop and I can decide which hop to take at each time...Series 1 and end-nodes with API mode should do this right?

No. If you want a mesh network, get the right kind of XBees (series 2) and be done with it.

What I tried to explain is that in my project/work, I need to program a routing algorithm (that's why I don't want series 2, because I am doing my own algorithm). I think I will find errors whenever I take this code from the Arduino and try to compile it for a Spartan6 FPGA on Eclipse, because the Xbee library uses (I checked it already) some other libraries that are only related to Arduino platform, so I will be (maybe, maybe not but first I want to go more simple) a little headache.

I just would like to know if anyone finds an error in my code that could lead me to know why both Xbee's (both end-nodes) are not communicating at all when I send those bytes over serial.