From 9a332594f1efa890997f9ba8d3a4d964f1b68b72 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 30 六月 2025 08:57:39 +0800 Subject: [PATCH] 1、中间件设备日志文件针对FBox设备优化;2、表阀一体机功能码92返回结果判断bug修改;3、remote模块中实现表阀一体机协议的功能码9D(正常远程关阀)。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_21_Down.java | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_21_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_21_Down.java index 2c26258..315c5af 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_21_Down.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V2/parse/Cd_21_Down.java @@ -31,6 +31,7 @@ MidResultToRtu midRs = new MidResultToRtu() ; midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;//rtu杩斿洖鍛戒护缁撴灉 鍙戝悜鐩殑鍦皐eb URL midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О + midRs.protocolVersion = para.protocolVersion ;//鍗忚鐗堟湰鍙� midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 midRs.commandId = para.commandId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉 midRs.downCode = para.commandCode ;//涓嬭鍛戒护鍔熻兘鐮�; @@ -77,24 +78,24 @@ CommonV2 commonV_1 = new CommonV2() ; byte[] bytes ; byte[] bsHead = new byte[ProtocolConstantV206V2.lenHead2Code] ; - byte index = GlCreate.createHead(bsHead); + byte index = GlCreate.createHead(para.protocolVersion, bsHead); index++ ; bsHead[index] = commonV_1.createCtrl((byte)0, (byte)0) ; index++ ; - GlCreate.createRtuAddr(para.rtuAddr, bsHead, index); + GlCreate.createRtuAddr4P206(para.rtuAddr, bsHead, index); index += 5 ; ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; index = 0 ; - byte[] bs = new byte[13] ; - String[] ipPorts = cvo.ip.split(".") ; - ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[0]), index++); - ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[1]), index++); - ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[2]), index++); - ByteUtilUnsigned.short2Bytes_LE(bs, (byte) Integer.parseInt(ipPorts[3]), index++); + byte[] bs = new byte[14] ; + String[] ip = cvo.ip.split("\\.") ; + ByteUtilUnsigned.byte2Byte(bs, (byte) Integer.parseInt(ip[0]), index++); + ByteUtilUnsigned.byte2Byte(bs, (byte) Integer.parseInt(ip[1]), index++); + ByteUtilUnsigned.byte2Byte(bs, (byte) Integer.parseInt(ip[2]), index++); + ByteUtilUnsigned.byte2Byte(bs, (byte) Integer.parseInt(ip[3]), index++); ByteUtilUnsigned.short2Bytes_LE(bs, cvo.port, index); index += 2 ; GlCreate.createPw(bs, index); @@ -105,7 +106,7 @@ GlCreate.createLen(bytes);//闀垮害鏀惧瓧鑺傛暟缁勪腑 - byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC鍜屽熬鍙犲姞瀛楄妭鏁扮粍涓� + byte[] bsTail = GlCreate.createCrcTail4P206(bytes) ;//CRC鍜屽熬鍙犲姞瀛楄妭鏁扮粍涓� bytes = ByteUtil.bytesMerge(bytes, bsTail) ; -- Gitblit v1.8.0