From 0a25ee317011df06a991069999749ee0fa3597b6 Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Thu, 30 May 2024 16:58:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]11=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=E8=81=94=E9=94=81=E6=95=B0=E6=8D=AE=E8=A7=A3=E6=9E=90=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=95=B0=E6=8D=AE=E9=95=BF=E5=BA=A6=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- third_party/interlock/beijing11/msg.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/third_party/interlock/beijing11/msg.go b/third_party/interlock/beijing11/msg.go index 3c48962..4005824 100644 --- a/third_party/interlock/beijing11/msg.go +++ b/third_party/interlock/beijing11/msg.go @@ -2,8 +2,6 @@ package beijing11 import ( "encoding/binary" - "errors" - "fmt" ) // FromInterlockFrame 来自联锁的数据帧 @@ -26,9 +24,9 @@ type FromInterlockFrame struct { func (f *FromInterlockFrame) Decode(data []byte) error { f.Len = binary.BigEndian.Uint16(data[1:3]) - if int(f.Len) != len(data)-3 { - return errors.New(fmt.Sprintf("%s数据长度不对[%d:%d]", logTag, f.Len, len(data)-3)) - } + //if int(f.Len) != len(data)-3 { + // return errors.New(fmt.Sprintf("%s数据长度不对[%d:%d]", logTag, f.Len, len(data)-3)) + //} f.InterlockCode = binary.BigEndian.Uint16(data[3:5]) f.WaysideCode = binary.BigEndian.Uint16(data[5:7])