Along the same lines of recieving data,
I frame the data with a start(to take) and end(to trigger) char, fast enough to be handled in the interrupt routine, then flag basic looping at 10X/sec.

IE......... [ abcdxyz...COMMAND.....1234]

"[" to start taking chars to array,
"]" to stop taking and flag to basic to parse for command ete etc.

the "[" always sets the array back to start.

Don
Amgen