Reply question

Hi,All

I already got reply(OK) from Xbee, but I need to reprogram the code each time. When I use the delay function to keep sending the (+++), then I can not get “OK”. I tried when I use the delay function, then I can not get “OK”.
Someone who is experienced please help.

Many thanks

Below is my function

if(rxbuffer[0]==‘O’&&rxbuffer[1]==‘K’)
{

--rx_buf_write_pointer;

flag=1;//flag is initialized 0 as global varialbe

}
//--------------------------------------------------
void enter_command(){

while(flag!=1) {
SendMsg(“+++”);
delay();
}
}
//------------------------------------------------
void delay() {
volatile int i,j,k;

for (i=0;i<5000;i++)
for (j=0;j<5000;j++)
k++;
}
//----------------------------------------------

Hi,the problem has been solved.