Reading Mixed Serial If/Else ? ?

J-M-L:
How do you get there if you don’t have a specific timeout ?

If it is just a safety timeout then that may be fine. The waitForString() function was not in the OP's snippet.

But I would not like a function that just twiddles its thumbs until the timeout expires. I would prefer to have the timeout separate so that other stuff can continue during the waiting period.

...R