Our great sponsors
-
bakelite
Bakelite is a utility that makes it simple to communicate with your firmware. (by brendan0powers)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I've seen people mention Messagepack, Asn.1 and Nanopb, which are data serialization libraries. Since in your example you mention that your protocol is like {START_COMMAND} {MODE_BYTE} {MODE_LENGTH} {MODE_DATA} I suppose that what you want is not only to transmit data, but also commands. I believe that RPC (Remote Procedure Call) is what you're looking for. Unfortunately I haven't found any really mature and well-known RPC frameworks for embedded. There is eRPC, but it is not so actively maintained. The RPC module from Pigweed, a embedded toolkit from Google, looks promising but IMHO it's a work in progress (especially the documentation is quite lacking).
Here's a link: https://github.com/brendan0powers/bakelite An Arduino/Python example: https://github.com/brendan0powers/bakelite/tree/master/examples/arduino