router send to coordinator

hello
i have two xbees S2 one is configurated as an API coordinator connected to ARDUINO and the other AT router.
the coordinator send a frame to the router to switch on a LED.
i want to switch off that LED with a button and the router send a message to the coordinator to tell him that it switch off the LED.
how can i make this?

i have two xbees S2 one is configurated as an API coordinator connected to ARDUINO and the other AT router.

I have two friends. One speaks English. The other speaks Swahili. How can I get them to communicate?

how can i make this?

Are there Arduinos involved?

I have two friends. One speaks English. The other speaks Swahili. How can I get them to communicate?

they already speak and i use this code to switch on the LED and this works perfectly

String inputString;
int led = 13;
void setup() {
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop() {
while (Serial.available() ) {
    // get the new byte:
    delay(3);  
    char inChar = Serial.read();
    // add it to the inputString:
    inputString += inChar;
    }
  if (inputString.length() >0) {
    Serial.println(inputString);
if (inputString == "on"){
 digitalWrite(led,HIGH);
  setRemoteState(5);

}
inputString=""; 
}
}

void setRemoteState(char value){
  Serial1.write(0x7E); // start byte
  Serial1.write((byte)0x0);
  Serial1.write(0x10);
  Serial1.write(0x17);
  Serial1.write((byte)0x0);
  // id of recipient or use 0xFFFF for broadcast
  Serial1.write((byte)00);
  Serial1.write((byte)00);
  Serial1.write((byte)00);
  Serial1.write((byte)00);
  Serial1.write((byte)00);
  Serial1.write((byte)00);
  Serial1.write(0xFF);
  Serial1.write(0xFF);
  // 16 bit of reciepent 
  Serial1.write(0xFF);
  Serial1.write(0xFE);  
  
   Serial1.write(0x02); 
   
   Serial1.write('D');
   Serial1.write('2');
   
   Serial1.write(value);
   
   long sum = 0x17 + 0xFF + 0xFF + 0xFF + 0xFE + 0x02 + 'D' + '2' + value;
   Serial1.write(0xFF - ( sum & 0xFF) );
   Serial1.print(sum,HEX);
}

now i want to connect a button to the router to switch off the LED and send data to the router to tell him that the LED is switched off

Are there Arduinos involved?

there is an arduino uno withe the coordinator

Why are both XBees not using API mode? Why are both not using AT mode?

when i put the coordinator in the AT mode nothing works ! the coordinator must be in API mode to can send that frame i am going to try to make both of them in the API mode but actually i' asking haw can the coordinator receive the infirmation ? i want an example of code