For these kinds of program, the best way to handle it is using state-machines.
-
You send the command
-
Go to wait-state
-
check response, if no response yet, go back to wait-state
-
if there is response, proceed to next state
For these kinds of program, the best way to handle it is using state-machines.
You send the command
Go to wait-state
check response, if no response yet, go back to wait-state
if there is response, proceed to next state