zdecoder

package
v0.0.0-...-ef14408 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const HEADER_SIZE = 5
View Source
const TLV_HEADER_SIZE = 8 //表示TLV空包长度

Variables

This section is empty.

Functions

func CheckCRC

func CheckCRC(src []byte, crc []byte) bool

func GetCrC

func GetCrC(buff []byte) []byte

func IsComplete

func IsComplete(src []byte, dst []byte) bool

func NewHTLVCRCDecoder

func NewHTLVCRCDecoder() ziface.IDecoder

func NewTLVDecoder

func NewTLVDecoder() ziface.IDecoder

Types

type HtlvCrcDecoder

type HtlvCrcDecoder struct {
	Head    byte   //头码
	Funcode byte   //功能码
	Length  byte   //数据长度
	Body    []byte //数据内容
	Crc     []byte //CRC校验
	Data    []byte //数据内容
}

func (*HtlvCrcDecoder) GetLengthField

func (hcd *HtlvCrcDecoder) GetLengthField() *ziface.LengthField

func (*HtlvCrcDecoder) Intercept

func (hcd *HtlvCrcDecoder) Intercept(chain ziface.IChain) ziface.IcResp

type TLVDecoder

type TLVDecoder struct {
	Tag    uint32 //消息类型
	Length uint32 //消息长度
	Value  []byte //消息内容
}

func (*TLVDecoder) GetLengthField

func (this *TLVDecoder) GetLengthField() *ziface.LengthField

func (*TLVDecoder) Intercept

func (this *TLVDecoder) Intercept(chain ziface.IChain) ziface.IcResp

Jump to

Keyboard shortcuts

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