Documentation ¶
Index ¶
- Constants
- func Checksum(src []byte) (rv byte)
- func DataFrame(frameType byte, body []byte) (frame []byte)
- func DataRequest(body []byte) (frame []byte)
- func DataResponse(body []byte) (frame []byte)
- func UnpackDataFrame(frame []byte) []byte
- func UnpackRequest(frame []byte) []byte
- func UnpackResponse(frame []byte) []byte
- type ValidateDataFrameResult
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 DataFrame ¶
DataFrame creates valid data frame for provided frame type (request or response) and body (serial api command + parameters)
func DataRequest ¶
DataRequest creates request data frame for provided body (serial api command + parameters)
func DataResponse ¶
DataResponse creates response data frame for provided body (serial api command + parameters)
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
Click to show internal directories.
Click to hide internal directories.