query

Hello,

return Serial.read();

What is logic behind this coding ?

Without context, it's hard to give a useful answer. It will return the result of the Serial.read() to whatever called the function containing that line.