The serial monitor outputs characters instead hex code. But if it is only for better reading, ok.
The code that does that? We ARE trying to help you, with the code, but, more importantly, with the process of writing and understanding the code.
These two println() statements are going to product different output.
int val = 0x40;
Serial.println(val);
Serial.println(val, HEX);
One is going to output "characters" while the other is going to output "hex code". In reality, both are outputting characters; it's just that the characters are different.
So I have to watch for response in loop and access the response in the switch case somehow.
Yes. Though I don't know what switch case you are referring to.
This could be difficult.
Or easy. If you haven't tried, how do you know?
Therefore I wanted to wait a bit.
How long? That is the key question.