From 8d3fbda9a2bac7f1076bfaaae3f10074dadbd58c Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Tue, 30 Jul 2024 14:57:36 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A2=84=E7=BA=A6=E5=85=85=E7=94=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/service/impl/YKCPushCommandServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java index ad5f5e079..a5b808d56 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java @@ -77,8 +77,8 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { log.error("push命令[{}]失败, 桩号:{}无法获取到长连接, 请检查充电桩连接状态!", value, pileSn); return false; } - /** - * 拼接报文 + /* + 拼接报文 */ // 起始标志 byte[] head = new byte[]{0x68}; @@ -100,11 +100,12 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { // 帧校验域 byte[] crc = BytesUtil.intToBytes(CRC16Util.calcCrc16(temp)); + // 返回报文 byte[] writeMsg = Bytes.concat(head, length, temp, crc); + // 返回完整的报文 string类型 String wholeMsg = BytesUtil.binary(writeMsg, 16); - // log.info("[" + channel.remoteAddress() + "] 主动发送push请求信息:{}", wholeMsg); ByteBuf byteBuf = channel.alloc().buffer().writeBytes(writeMsg); ChannelFuture channelFuture = channel.writeAndFlush(byteBuf); channelFuture.addListener((ChannelFutureListener) channelFutureListener -> {