From 14e95631f075f951a44033faeab3075bb05eda1d Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 13 五月 2025 14:57:47 +0800
Subject: [PATCH] 解决问题:取水口解绑之后,不能获取取水口详情信息。
---
pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9603.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9603.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9603.java
new file mode 100644
index 0000000..0604a49
--- /dev/null
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-simulate-rtu/src/main/java/com/dy/simRtu/tcpClient/upData/UpCd9603.java
@@ -0,0 +1,53 @@
+package com.dy.simRtu.tcpClient.upData;
+
+import com.dy.common.mw.protocol.p206V1.parse.global.GlCreate;
+import com.dy.common.util.ByteUtil;
+import com.dy.simRtu.ServerProperties;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/11/18 11:26
+ * @Description
+ */
+public class UpCd9603 extends UpData {
+
+ private static final Logger log = LogManager.getLogger(UpCd9603.class);
+
+ public static void upData() {
+ try {
+ if (UpData.session != null && UpData.session.isConnected()) {
+ byte[] bs = createData(ServerProperties.rtuAddr);
+ UpData.upSend(bs);
+ } else {
+ log.error("鏈繛鎺ラ�氫俊涓棿浠讹紝涓嶈兘鍙戦�佹暟鎹�");
+ }
+ } catch (Exception e) {
+ log.error("鍚戦�氫俊涓棿浠跺彂閫佹暟鎹骇鐢熷紓甯�", e);
+ }
+ }
+
+
+ /**
+ * 鏋勯�犳暟鎹�
+ *
+ * @return 瀛楄妭鏁扮粍
+ * @throws Exception 寮傚父
+ */
+ private static byte[] createData(String rtuAddr) throws Exception {
+ byte[] bytes = creatHead4Upgrade(rtuAddr, "96","03");
+
+ byte[] bs = new byte[1];
+ bs[0] = (byte) 0x00;//00 姝g‘ 锛�0xXX 閿欒
+ bytes = ByteUtil.bytesMerge(bytes, bs);
+
+ GlCreate.createLen4PUg(bytes);//闀垮害鏀惧瓧鑺傛暟缁勪腑
+
+ byte[] bsTail = GlCreate.createCrcTail4Ug(bytes);//CRC鍜屽熬鍙犲姞瀛楄妭鏁扮粍涓�
+
+ bytes = ByteUtil.bytesMerge(bytes, bsTail);
+
+ return bytes;
+ }
+}
\ No newline at end of file
--
Gitblit v1.8.0