From 9a7978c3a82ce66c87be2a42ca15beeb4617a096 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 20 八月 2025 14:42:24 +0800
Subject: [PATCH] 修改bug
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java
index 9032398..9111656 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_87_Up.java
@@ -54,9 +54,9 @@
* @throws Exception 寮傚父
*/
protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
- DataV202404 dV1 = (DataV202404)data.getSubData() ;
+ DataV202404 dV202404 = (DataV202404)data.getSubData() ;
DataCd87Vo cdData = new DataCd87Vo(CodeV202404.getCodeName(dataCode)) ;
- dV1.subData = cdData ;
+ dV202404.subData = cdData ;
int index = ProtocolConstantV206V202404.dataIndex ;
cdData.controllerType = ByteUtil.bytes2Hex(bs, false, index, 1) ;
@@ -73,10 +73,17 @@
short portLen = ByteUtilUnsigned.byte2Byte(bs, index) ;
index++ ;
- cdData.domain = ByteUtil.bytes2String_BE(bs, index, index + domainLen - 1) ;
-
+ if(domainLen > 0){
+ cdData.domain = ByteUtil.bytes2String_BE(bs, index, index + domainLen - 1) ;
+ }else{
+ cdData.domain = "" ;
+ }
index += domainLen ;
- cdData.port = Integer.parseInt(ByteUtil.bytes2String_BE(bs, index, index + portLen - 1)) ;
+ if(portLen > 0){
+ cdData.port = Integer.parseInt(ByteUtil.bytes2String_BE(bs, index, index + portLen - 1)) ;
+ }else{
+ cdData.port = 0 ;
+ }
}
}
--
Gitblit v1.8.0