Documentation
¶
Overview ¶
Protocol package implements a simple protocol for sending and receiving data.
Protocol format: ABBCCCCDDD...DDDFFFF Where: A: command byte B: counter (2 bytes, big endian) optional used to debug and validate package order C: payload length (32 bits, big endian) D: payload (array of bytes) F: checksum (FNV-1a, 32 bits, big endian)
The checksum is calculated over the command byte, counter, payload length, and the data itself.
Index ¶
Examples ¶
Constants ¶
View Source
const (
MaxPackageSize = constants.BufferSize + 11 // max package size
)
Variables ¶
View Source
var ( ErrInvalidSize = errors.New("invalid size") ErrInvalidChecksum = errors.New("invalid checksum") )
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.