grandcentrix / cobs

This is a C implementation of Consistent Overhead Byte Stuffing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consistent Overhead Byte Stuffing (COBS)

This is a C implementation of Consistent Overhead Byte Stuffing.

Features

  • Designed for efficiency.
  • Designed for robustness. Malformed data is detected and reported.
  • No memory allocations within the library.
  • Inplace decoder variant.
  • Streaming encoders and decoders.
  • Unit tests.
  • Zephyr supports.

History

This implementation was forked from Jacques Fortier and extended heavily. For more information, see Jacques Fortiers blog bost on Consistent Overhead Byte Stuffing.

Implementations

Normal

This is the slightly modified original implementation from Jacques Fortier. They expect you to provide buffers that are large enough and encode/decode data from one buffer into another.

Inplace

Currently only supported for decoding. This removes the need for a second buffer because it overrides the source data. Since the decoded data is always smaller than the encoded data it will always fit.

Streaming

Those allow passing data to the encoder or decoder as it is being received. The encoder/decoder will tell you when the message is complete or when there was an error.

About

This is a C implementation of Consistent Overhead Byte Stuffing.

License:MIT License


Languages

Language:C 87.8%Language:Shell 6.5%Language:CMake 4.7%Language:Python 1.0%