I'm working on a communication protocol between embedded devices. The protocol will definitely need new commands and fields in the future. What do I need to do to make sure I'm not painting myself into a corner?
This is a wide open question. Here are some random thoughts about it:
In summary, Leave spares.
If at all possible, allow a human at one end of a cable to figure out what is at the other end of the cable. Ideally, a human could hook up a dumb terminal and hit the keyboard three times (Enter Question-mark Enter), then a long, detailed message would come back describing what kind of machine it is, what is its model number, the name and phone number and web site of the organization that built it, the "official" protocol version number, and the unofficial build time:
__DATE__ ": " __TIME__
Also send the same detailed message every time the machine boots up.
If at all possible, try to design your protocol so that a human being with a dumb terminal can talk to your device. The HTTP is one such human-readable protocol, and I suspect this is one of the reasons for its popularity. Human-readable implies, among other things:
You might also want to glance over the list of common protocols for embedded systems. Perhaps one already meets your requirements? Is there any reason to use something more difficult to decode than the standard Netstring format?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With