zdecoder

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const HEADER_SIZE = 5
View Source
const LTV_HEADER_SIZE = 8 //表示TLV空包长度
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 NewLTV_Little_Decoder added in v1.1.17

func NewLTV_Little_Decoder() ziface.IDecoder

func NewTLVDecoder

func NewTLVDecoder() ziface.IDecoder

Types

type HtlvCrcDecoder

type HtlvCrcDecoder struct {
	Head    byte   //HeaderCode(头码)
	Funcode byte   //FunctionCode(功能码)
	Length  byte   //DataLength(数据长度)
	Body    []byte //BodyData(数据内容)
	Crc     []byte //CRC校验
	Data    []byte //// Original data content(原始数据内容)
}

func (*HtlvCrcDecoder) GetLengthField

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

func (*HtlvCrcDecoder) Intercept

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

type LTV_Little_Decoder added in v1.1.17

type LTV_Little_Decoder struct {
	Length uint32 //L
	Tag    uint32 //T
	Value  []byte //V
}

func (*LTV_Little_Decoder) GetLengthField added in v1.1.17

func (ltv *LTV_Little_Decoder) GetLengthField() *ziface.LengthField

func (*LTV_Little_Decoder) Intercept added in v1.1.17

func (ltv *LTV_Little_Decoder) Intercept(chain ziface.IChain) ziface.IcResp

type TLVDecoder

type TLVDecoder struct {
	Tag    uint32 //T
	Length uint32 //L
	Value  []byte //V
}

func (*TLVDecoder) GetLengthField

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

func (*TLVDecoder) Intercept

func (tlv *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