void serial_response()
{
int incomingByte=0;
if (mySerial.available()>0)
{
incomingByte = mySerial.read();
Serial.print("Response: ");
Serial.print(incomingByte, HEX);
Serial.println("|");
}
else
{
serial_response();
}
}
If there is no data yet, make a recursive call to this function. Nope, not going to work.
You need to learn about while loops! While there is no serial data, sit on your hands and do NOTHING!