From 44180ee779c038ad628fcd847a0b8e2ca9b6f4ee Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期五, 22 十一月 2024 10:46:17 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/CommonV1.java |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/CommonV1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/CommonV1.java
index d77f480..9c147bf 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/CommonV1.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/CommonV1.java
@@ -75,7 +75,7 @@
 			int len = ByteUtilUnsigned.byte2Byte(bs, ProtocolConstantV206V1.dataLenIndex);
 			return len + ProtocolConstantV206V1.lenHead2ctrl + ProtocolConstantV206V1.lenTail;
 		}else{
-			int len = ByteUtilUnsigned.bytes2Short_BE(bs, ProtocolConstantV206V1.UG_dataLenIndex_start);
+			int len = ByteUtilUnsigned.bytes2Short_LE(bs, ProtocolConstantV206V1.UG_dataLenIndex_start);
 			return len + ProtocolConstantV206V1.UG_lenHead2Cmd + ProtocolConstantV206V1.UG_lenTail;
 		}
 	}
@@ -176,8 +176,9 @@
 				return "璁$畻CRC鏄�:" + crcCompute + "锛屼笂浼燙RC鏄�" + crcInBs ;
 			}
 		}else{
-			int crcCompute = (byte)new CRC16().CRC(bs, ProtocolConstantV206V1.ctrlIndex, bs.length - 3) ;
-			int crcInBs = ByteUtilUnsigned.bytes2Short_BE(bs, bs.length - 3) ;
+			short crcCompute = new CRC16().CRC(bs, 0, bs.length - 4) ;
+			short crcInBs = ByteUtil.bytes2Short_BE(bs,bs.length - 3) ;
+			//int crcInBs = ByteUtilUnsigned.bytes2Short_BE(bs, bs.length - 3) ;
 			if(crcCompute == crcInBs){
 				return null ;
 			}else{

--
Gitblit v1.8.0