As I am getting further into my star network deployment, I am seeing that it is harder to differentiate what packets go to what responses. For example, when I send a packet out and listen for an ACK, many other packets are coming in at the same time. I want to make sure the receiver got it or otherwise I would resend it. I do not understand how to act on another packet coming in (lets say its a command to turn on an LED) while not leaving that for loop checking for the ACK.
I haven’t done programming with the XBee on Arduino, but if it uses the Serial API then I think you’ll be fine leaving the loop briefly to act on a command. The incoming data will be buffered so as long as you are handling the commands fast enough, everything should still be available to be read when you return to the main loop.
Chris