Documentation
¶
Overview ¶
Package cobs implenments COBS (https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing).
Package cobs implenments COBS (https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing).
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 CDecode ¶
CDecode decodes `i` into `o` and returns number of bytes in `o`. For details see https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing. The CDencode implementation is done in C because the aimed use case is an embedded device running C. This function is mainly for testing.
func CEncode ¶
CEncode encodes `i` into `o` and returns number of bytes in `o`. For details see https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing. The Encode implementation is done in C because the aimed use case is an embedded device running C. This function is mainly for testing.
func NewDecoder ¶
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.
func NewEncoder ¶
NewEncoder creates an encoder instance and returns its address. w will be used as inner writer and size is used as initial size for the inner buffer.
Types ¶
This section is empty.