zdecoder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

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

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

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

func (*LTV_Little_Decoder) GetLengthField

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

func (*LTV_Little_Decoder) Intercept

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