Skip to content

Commit 879a33e

Browse files
authored
Update htlvcrcdecoder.go
use MaxUint8
1 parent 0a2ab19 commit 879a33e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zdecoder/htlvcrcdecoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (hcd *HtlvCrcDecoder) GetLengthField() *ziface.LengthField {
8181
// initialBytesToStrip = 0 (这个0表示完整的协议内容,如果不想要A2,那么这里就是1) 从解码帧中第一次去除的字节数
8282
// maxFrameLength = 255 + 4(起始码、功能码、CRC) (len是1个byte,所以最大长度是无符号1个byte的最大值)
8383
return &ziface.LengthField{
84-
MaxFrameLength: math.MaxInt8 + 4,
84+
MaxFrameLength: math.MaxUint8 + 4,
8585
LengthFieldOffset: 2,
8686
LengthFieldLength: 1,
8787
LengthAdjustment: 2,

0 commit comments

Comments
 (0)