Awesome
COBS
<!-- PROJECT LOGO --> <div align="center"> <a href="https://github.com/rokath/cobs"> <img src="./logo.png" alt="Logo" width="800" height="80"> </a> </div> <!-- TABLE OF CONTENTS --> <details> <summary>Table of Contents</summary> <ol> <!-- vscode-markdown-toc --> <!-- vscode-markdown-toc-config numbering=true autoSave=true /vscode-markdown-toc-config --> <!-- /vscode-markdown-toc --><div id="top"></div> </ol> </details> <!-- ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/rokath/cobs/goreleaser) ![GitHub All Releases](https://img.shields.io/github/downloads/rokath/cobs/total) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/rokath/cobs) ![GitHub commits since latest release](https://img.shields.io/github/commits-since/rokath/cobs/latest) --> <!-- ABOUT THE PROJECT -->1. <a name='AboutTheproject'></a>About The project
This is a COBS implementation in Go and C with tests.
- The C code is copied from Wikipedia and adapted. Some other implementations did not pass all tests.
- The Go code was written from scratch after reviewing other implementations.
See TCOBS as an other possibility.
<p align="right">(<a href="#top">back to top</a>)</p>2. <a name='COBSSpecification'></a>COBS Specification
<p align="right">(<a href="#top">back to top</a>)</p>3. <a name='FolderInformation'></a>Folder Information
Folder | Content |
---|---|
src | C sources ready to be used in any C project |
go | Go source |
cgo | Go project for testing |
4. <a name='GettingStarted'></a>Getting Started
-
Clone the project with
git clone git@github.com:rokath/cobs.git
for example. -
Run
go vet ./...
to check build environment. -
Run
go test ./...
to perform tests. Can take a minute. -
Add src to your embedded project and use function
COBSEncode
to convert a buffer into COBS format. Or use functionCOBSDecode
for the other direction. -
After transmitting one (or more) COBS package(s) transmit a 0-delimiter byte.
-
Encoding is currently not implemented in Go, but its is no big deal to write an encoder in Go or an other language of your choice using the documentation.
-
Anyway you can encode inside Go using function CEncode, which is a Go wrapper for the C COBSEncode function .
-
Contributions are appreciated.
4.1. <a name='Prerequisites'></a>Prerequisites
- Just a C compiler and, for testing or, if using, a Go installation.
4.2. <a name='Installation'></a>Installation
- To use COBS with Go execute
go get github.com/rokath/cobs
- In your Go file:
include( cobs github.com/rokath/cobs/go )
, when using the Go code (decoding only). - In your Go file:
include( cobs github.com/rokath/cobs/c )
, when using the CGO code (encoding and decoding).
4.3. <a name='Roadmap'></a>Roadmap
- Add Changelog
- Add back to top links
- Add Go Reader & Writer interface
- Add Additional Templates w/ Examples
See the open issues for a full list of proposed features (and known issues).
<p align="right">(<a href="#top">back to top</a>)</p> <!-- CONTRIBUTING -->5. <a name='Contributing'></a>Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub
<p align="right">(<a href="#top">back to top</a>)</p> <!-- LICENSE -->6. <a name='License'></a>License
Distributed under the MIT License. See LICENSE.txt for more information.
<p align="right">(<a href="#top">back to top</a>)</p> <!-- CONTACT -->7. <a name='Contact'></a>Contact
Thomas Höhenleitner - <!-- [@twitter_handle](https://twitter.com/twitter_handle) - --> th@seerose.net Project Link: https://github.com/rokath/cobs
<!-- ACKNOWLEDGMENTS -->