Home/Support/Support Forum/XBee S2 Sending data from Coordinator to Router - Arduino

XBee S2 Sending data from Coordinator to Router - Arduino

0 votes
Hi.

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
request.setCommand(ND);
Serial.print("Sending command to the XBee ");
xbee.send(request);
request.clearCommandValue();
Serial.println("");


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

}
Serial.println("");


}
}
}

///


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 her
asked Mar 26 in RF Solutions and XBee by AntonioGR96 New to the Community (1 point)

Please log in or register to answer this question.

2 Answers

0 votes
Antonio,

This is the wrong forum for this kind of question. You really need to ask this question on a forum for the Arduino.

Digi Support
answered Mar 27 by mvut Veteran of the Digi Community (12,309 points)
0 votes
You may want to post this code on stackoverflow.com for help.
answered Apr 7 by asgm Veteran of the Digi Community (1,499 points)
...