Table of Contents
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.
Folder | Content |
---|---|
src | C sources ready to be used in any C project |
go | Go source |
cgo | Go project for testing |
-
Clone the project with
git clone [email protected]: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.
- Just a C compiler and, for testing or, if using, a Go 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).
- 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).
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
Distributed under the MIT License. See LICENSE.txt for more information.
Thomas Höhenleitner - [email protected] Project Link: https://github.com/rokath/cobs