cobs

package
v0.0.0-...-4ebbe9b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cobs implenments COBS (https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing).

Package cobs implements COBS. For encoding create an Encoder and use the Write method as shown in TestWrite. For decoding create a Decoder and use the Read method as shown in TestSingleRead and TestMultiRead. It is possible to use only the functions cobs.Decode or cobs.CEncode. Package cobs is also a helper for testing the target C-code. Each C function gets a Go wrapper which ist tested in appropriate test functions. For some reason inside the cobs_test.go an 'import "C"' is not possible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(dec, cobs []byte) (n int, e error)

Decode a COBS frame to a slice of bytes.

decoded := dec[:n]

func NewDecoder

func NewDecoder(r io.Reader, size int) (p *decoder)

NewDecoder creates a decoder instance and returns its address. r will be used as inner reader. size is used as size for the inner buffers. Max one decoded COBS package is returned by Read.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL