update 预约充电

This commit is contained in:
Guoqs
2024-07-30 14:57:36 +08:00
parent 0279b9819c
commit 8d3fbda9a2

View File

@@ -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 -> {