From what I understand is that it tries to read until a timeout, that introduces waiting time.
In my application i am waiting for some user input OR serial input. So I am scanning the buttons of a 4x4 keypad in a continous loop. I want to add scanning if a specific message has been deleivered.
So I need something like:
if button 1 is pressed, result = resutl + 1
if button 7 is pressed, result = result + 7
if message == "pincode"
So the message needs to be received in a buffer and the loop only checks if it is there