Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Consistent Overhead Byte Stuffing](http://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing) is an encoding that removes all 0 bytes | ||
from arbitrary binary data. The encoded data consists only of bytes with values from 0x01 to 0xFF. This is useful for preparing data for | ||
transmission over a serial link (RS-232 or RS-485 for example), as the 0 byte can be used to unambiguously indicate packet boundaries. COBS | ||
also has the advantage of adding very little overhead (at least 1 byte, plus up to an additional byte per 254 bytes of data). For messages | ||
smaller than 254 bytes, the overhead is constant. | ||
|
||
This is an implementation of COBS for C. It is designed to be both efficient and robust. The code is implemented in modern C99. The decoder | ||
is designed to detect malformed input data and report an error upon detection. A test suite is included to validate the encoder and decoder. | ||
|
||
For more information, see my blog bost on [Consistent Overhead Byte Stuffing](http://www.jacquesf.com/2011/03/consistent-overhead-byte-stuffing). |