From 7fd3ff6715939467e3850763206d37fac8564e41 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期一, 02 十二月 2024 11:15:26 +0800
Subject: [PATCH] 修改升级协议中的bug,未在下行数据中放入帧长度
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/CRC16.java | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/CRC16.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/CRC16.java
index 09f307c..e056bdc 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/CRC16.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/CRC16.java
@@ -34,7 +34,7 @@
* @return CRC
*/
@SuppressWarnings("unused")
- public int CRC(byte[] b, int startIndex, int endIndex) {
+ public short CRC(byte[] b, int startIndex, int endIndex) {
int crc = 0xFFFF;
for (int j = startIndex ; j <= endIndex; j++) {
crc = crc ^ ((b[j] + 256) % 256) ;//杞崲鎴愭棤绗﹀彿鏁帮紝鍥犱负缁堢瀹炵幇(C璇█鎴栨眹缂栬瑷�)閮界敤鐨勬槸鏃犵鍙锋暟
@@ -46,7 +46,7 @@
}
}
}
- return crc;
+ return (short)crc;
}
--
Gitblit v1.8.0