From d9765e031e100e1d8eea34e086cb9c81766e1a00 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 21 二月 2025 09:52:14 +0800
Subject: [PATCH] 针对王江海制定的协议: 1、优化相关注释; 2、优化代码; 3、协议中报警信息有变化:外门报警改为电池电压报警、增加阀门开关状态、增加阀门堵转报警等。
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/DriverV2.java | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/DriverV2.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/DriverV2.java
index 5dba5f7..614e5b6 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/DriverV2.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/DriverV2.java
@@ -1,6 +1,7 @@
package com.dy.common.mw.protocol.p206V2;
import com.dy.common.mw.protocol.*;
+import com.dy.common.mw.protocol.p206V1.ProtocolConstantV206V1;
import com.dy.common.util.DateTime;
@AnnotationDriver(enable = true,
@@ -60,6 +61,7 @@
boolean isFail = false ;
String upCode = null ;
Short protocolVersion = null ;
+ Object[] codeDataGrp = {null};
try{
CommonV2 cp = new CommonV2() ;
Boolean p206TrueUgFalse = cp.protocolType_p206TrueUgFalse(upBuffer) ;
@@ -101,12 +103,14 @@
}else{
return codeParse.parse(isLowPower, this.upCpParams, new CodeParseCallback(){
@Override
- public void callback(Boolean flag) {
+ public void callback(Boolean flag, Object codeData) {
reportOrResponse_trueOrFalse = flag ;
rtuAddrInData = dV2.getRtuAddr() ;
+ codeDataGrp[0] = codeData ;
}
@Override
public void notify(NotifyInfo ...infos) {
+ notify.notify(rtuAddr, ProtocolConstantV206V1.protocolName, ProtocolConstantV206V1.protocolVer, infos);
}
});
}
@@ -115,7 +119,7 @@
isFail = true ;
return new MidResult[]{(new MidResultError(ProtocolConstantV206V2.protocolName, rtuAddr, "涓ラ噸閿欒锛屽垎鏋怰tu鏁版嵁鍑洪敊锛佹暟鎹负锛�" + upHex + (e.getMessage() == null?"":("锛屽嚭閿欎俊鎭細" + e.getMessage())), e))} ;
} finally{
- callback.callback(rtuAddr, upCode, CodeV2.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddr);
+ callback.callback(rtuAddr, upCode, CodeV2.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddr, codeDataGrp[0]);
}
}
--
Gitblit v1.8.0