XBee S2 Sending data from Coordinator to Router


I am working on a project and I got three XBees modules S2. I’m trying to use Arduino to comunicate them. Now I’m using the NodeDiscovery function (in the Coordinator code), wich reports me back the address of the two Routers. So I save the Address of each router in an array, for example: matDevices[100][8]. 100 the total devices we could found and 8 the length of the address.

The code would be something like this:

int matDevices[100][8];

//In the NodeDiscovery Function
    Serial.print("Sending command to the XBee ");

    while(xbee.readPacket(timeout)) { // should be receiving AT command responses
      if (xbee.getResponse().getApiId() == AT_COMMAND_RESPONSE) {
        if (response.isOk()) {
          for (int i = 2; i < 10; i++) {
            matDevices[nodeCount-1][i]=response.getValue()[i]; //get address of every Router discovered



Sorry if it’s a little weird.

But I would like to be able to send data this way: XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0xXXXXXXXX);

it is possible to send data once I have saved the address in an array, I mean, do I have to send data creating the variable XBeeAddress64 addr64, or it is possible to do it with the same array?

Thank you all and excuse about my poor english at some parts, Spanish over here.

I don't think int matDevices[100][8] is right.

You need [u]unsigned long[/u] which are 32 bits.

If you have 100 devices, you would declare it as unsigned long matDevices[100] .


Thank you ieee488 i will modify that part. I'm still stuck on the part of sending information to the address saved in the matrix. Hope someone has a clue.