Skip to content

Commit 591f569

Browse files
committed
COBS Serial Communication package document.
1 parent 59d146e commit 591f569

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/cobs_serial/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# COBS Serial
2+
3+
This package provides a C++ library for serial communication that uses COBS (Consistent Overhead Byte Stuffing) encoding. It is designed to simplify and improve the reliability of data transmission over serial connections in embedded systems or microcontroller applications.
4+
5+
## Package Overview
6+
7+
The COBS Serial library helps you send and receive data reliably over serial ports (like RS-232, RS-485, or USB-to-serial). It uses a special encoding technique called COBS to ensure that:
8+
9+
- Data packets are easily separated using zero bytes as delimiters.
10+
- No unwanted zero bytes appear in the actual data being transmitted.
11+
- Minimal extra data is added to the original message (low overhead).
12+
13+
This makes it ideal for applications where reliable communication is critical, such as industrial automation, robotics, or IoT devices.
14+
15+
## Advantages of COBS Serial
16+
17+
Reliable communication over serial connections can be tricky. Without proper framing, it's easy to lose track of where one packet ends and another begins. The COBS encoding used in this library solves these problems by:
18+
19+
- Making it simple to detect the start and end of each data packet.
20+
- Eliminating false triggers caused by zero bytes in the data.
21+
- Adding minimal overhead compared to other framing methods.
22+
23+
This means you can focus on your application logic while letting the library handle the details of reliable communication.
24+
25+
## Getting Started
26+
27+
The library provides an abstract interface (CobsSerial) that defines how serial communication should work. You can implement this interface for specific hardware or software (e.g., a USB-to-serial adapter). The key features are:
28+
29+
1. Open/Close Management: Easily manage the lifecycle of your serial connection.
30+
2. Read/Write Operations: Send and receive data in a straightforward way.
31+
3. COBS Encoding: Automatically handle the encoding and decoding of data to ensure reliable communication.

0 commit comments

Comments
 (0)