From 08fc154ca750b446e97b4b7764f0ffe130348f24 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期二, 26 十一月 2024 11:25:40 +0800
Subject: [PATCH] 创建工单时通过mosquitto推送消息
---
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