From d8eb22351c6d0bfe0c9f233edfd593538e6838c9 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 24 四月 2025 13:58:49 +0800 Subject: [PATCH] 1、表阀一体机协议开阀类型变化; 2、表阀一体机协议开关阀报中增加水价数据; --- pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu3rd/src/main/java/com/dy/rtuMw3rd/tcp4Bjnl/protocol/BjnlCommon.java | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu3rd/src/main/java/com/dy/rtuMw3rd/tcp4Bjnl/protocol/BjnlCommon.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu3rd/src/main/java/com/dy/rtuMw3rd/tcp4Bjnl/protocol/BjnlCommon.java new file mode 100644 index 0000000..ca065e7 --- /dev/null +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu3rd/src/main/java/com/dy/rtuMw3rd/tcp4Bjnl/protocol/BjnlCommon.java @@ -0,0 +1,21 @@ +package com.dy.rtuMw3rd.tcp4Bjnl.protocol; + +import com.dy.common.util.ByteUtil; + +import java.nio.charset.StandardCharsets; + +/** + * @Author: liurunyu + * @Date: 2025/3/18 15:06 + * @Description + */ +public class BjnlCommon { + public static byte[] wrap(String msg){ + byte[] bs = BjnlProtocol.FrameHeadBytes; + if(msg != null && msg.length() > 0){ + bs = ByteUtil.bytesMerge(bs, msg.getBytes(StandardCharsets.UTF_8)) ; + } + bs = ByteUtil.bytesMerge(bs, BjnlProtocol.FrameTailBytes) ; + return bs; + } +} -- Gitblit v1.8.0