Simple protocol for sending minimal length serial messages for devices using RS-232 directly or over USB. Messages are minimized by sending data as raw binary with only symbols 0xFF and 0xFE defined as special. 0xFF is the message start symbol and 0xFE is the escape symbol. Data values 0x00 to 0xFD are sent verbatim. Data value 0xFF is sent as byte pair 0xFE, 0xFD and 0xFE is sent as byte pair 0xFE, 0xFE.
Data messages are minimized by maximizing the common knowledge of the sender and receiver. The escape symbol followed with one or more bytes is used to create a 'hint' by the sender for how the receiver should interpret the following data bytes. Both sender and receiver have perfect knowledge of how hints should be interpreted, therefore only a minimal amount of data needs to be sent.
The message receiver is a state machine. When it receives 0xFF it resets its output buffer and waits for the message hint. The message hint is then used to select a function to receive the message.

Project Activity

See All Activity >

Follow simple_serial_protocol

simple_serial_protocol Web Site

Other Useful Business Software
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of simple_serial_protocol!

Additional Project Details

Registered

2023-03-12