       }
     }
 
-    delay(10);
     if (XBee.available()) {
       delay(10);
       while (XBee.available()) {

int ir_current_rssi = 0;
char current_id[03] = "00";
bool is_increase_available = false;
char message[20];
unsigned long start_time;
boolean isWaitingReply;

	}
      }
    }
    if (BT.available()) {
      delay(10);
      DEBUG_PRINT("[BT]: ");
      readStringfromSerial(&BT, message);
      // if it's LIST command, then list all available devices by sending IR
      if ( message[0] == 'F' && message[1] == 'F') {
	// return currentId
	BT.println(currentId);
      }
      is_connected = true;
      ir_bcast_mode = false;
    }
  }
  else { // if(ir_bcast_mode){
    // this is the place when we only have a single connection with one device
    // TODO: implement later
  }

}

boolean isPacketValid(char *message) {
