s101

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FirstMultiPacket is byte to identify a multilayer packet in S101.
	FirstMultiPacket = 0x80
	// BodyMultiPacket is byte to identify a packet in a multilayer packet message in S101.
	BodyMultiPacket = 0x00
	// LastMultiPacket is byte to identify end of a multilayer packet in S101.
	LastMultiPacket = 0x40
	// SinglePacket is byte to identify a single packet message in S101.
	SinglePacket = 0xC0
)

Variables

This section is empty.

Functions

func Decode

func Decode(s101s [][]byte) ([]byte, byte, error)

Decode removes all the S101 addons from the packet returning only glow data, currently does not check CRC.

func Encode

func Encode(message []byte, packetType uint8) []uint8

Encode creates a 101 packet from the message adding all the required S101 bytes based on the S101 protocol, if package type is multi packet message, adds an empty packet to the end as require by the protocol.

func GetS101s

func GetS101s(message []byte) ([][]byte, []byte, error)

GetS101s returns all s101 data packets from message, if the message contains an incomplete packet it will return the raw data in the second response value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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