You can remove the started flag and the SOP variable. Any data that comes in when ended is false is considered part of the current packet.
Or, you can have multiple start of packet markers, and save data differently when each one arrives.
What is this external application, and why can't you ditch it? The LEDs can be either on or off. 8 bytes conveys all the information that you need. What do the other commands, A, B, etc. do?