zwave

package
v0.0.0-...-ad0604f Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Data frame Start of Frame (SOF)
	FrameSOF = 0x01
	// Acknowledge frame (data frame is accepted)
	FrameASK = 0x06
	// Not-acknowledge frame (data frame is not valid and not accepted)
	FrameNAK = 0x15
	// Data frame is valid but not accepted (race condition or other reasons)
	FrameCAN = 0x18
)

Frame types

View Source
const (
	// Request data frame
	FrameRequest = 0
	// Response data frame
	FrameResponse = 1
)

Data frame type

View Source
const (
	FrameMinLength = 3
	FrameMaxLength = 253
)

Data frame min and max length

View Source
const (
	FrameOK = ValidateDataFrameResult(iota)
	FrameIncomplete
	FrameNoSOFByte
	FrameWrongLength
	FrameWrongChecksum
)
View Source
const (
	ZW_LIB_CONTROLLER_STATIC = 0x01
	ZW_LIB_CONTROLLER        = 0x02
	ZW_LIB_SLAVE_ENHANCED    = 0x03
	ZW_LIB_SLAVE             = 0x04
	ZW_LIB_INSTALLER         = 0x05
	ZW_LIB_SLAVE_ROUTING     = 0x06
	ZW_LIB_CONTROLLER_BRIDGE = 0x07
	ZW_LIB_DUT               = 0x08
)

library type

View Source
const (
	ZW_VERSION = 0x15
)

Serial API command ID

Variables

This section is empty.

Functions

func Checksum

func Checksum(src []byte) (rv byte)

Checksum calculates data frame checksum

func DataFrame

func DataFrame(frameType byte, body []byte) (frame []byte)

DataFrame creates valid data frame for provided frame type (request or response) and body (serial api command + parameters)

func DataRequest

func DataRequest(body []byte) (frame []byte)

DataRequest creates request data frame for provided body (serial api command + parameters)

func DataResponse

func DataResponse(body []byte) (frame []byte)

DataResponse creates response data frame for provided body (serial api command + parameters)

func UnpackDataFrame

func UnpackDataFrame(frame []byte) []byte

unpack data frame payload

func UnpackRequest

func UnpackRequest(frame []byte) []byte

unpack data request frame payload

func UnpackResponse

func UnpackResponse(frame []byte) []byte

unpack data response frame payload

Types

type ValidateDataFrameResult

type ValidateDataFrameResult byte

func ValidateDataFrame

func ValidateDataFrame(frame []byte) (ValidateDataFrameResult, int)

ValidateDataFrame validates data frame and returns validation result plus position after validated frame

Jump to

Keyboard shortcuts

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