I'm working on a project where I have to communicate different lengths command from my PC to a microcontroller. (using usb to uart bridge)
I already make a litle protocol (start byte, some data, checksum …) but I need to adapt it for my new need.
I'm wondering if there is already a standard or a common way to do that.
Best Answer
variable-length commands
Many people highly prefer fixed-length commands. If you need to have variable-length commands, you need to think about:
general protocol design tips
There are many more or less simple protocols listed in the "Serial Programming" Wikibook.
If you're lucky, perhaps one of them is already perfect for your application. Or at least close enough that it only requires a little tweaking to fit.
Pretty much everyone who successfully develops a new protocol goes through these phases: