Atmega328p-pu RX "freezing"

Hi

This looks like it would spend a lot of time discarding serial buffer data when the buffer isn't a multiple of commandlength. As an alternative why not drop out of the function if the buffer is shorter than 15, and then come back and process 15 at a time leaving the remainder in the buffer for next time once you've processed down to less than 15?

As an additional check, is there a known shape to these command strings so you can further verify the 15 bytes are valid?

Geoff