update 电单车协议

This commit is contained in:
Guoqs
2024-09-03 12:13:12 +08:00
parent e668f6c4ab
commit 5aa69b379b
2 changed files with 2 additions and 35 deletions

View File

@@ -152,7 +152,8 @@ public class EBikeMessageCmd82 extends AbsEBikeMessage {
// 充电时长/电量
byte[] chargeDurationOrPowerBytes = BytesUtil.stringToHexBytes(chargeDurationOrPower, 2);
// 订单编号
byte[] orderNumberBytes = BytesUtil.stringToHexBytes(orderNumber, 16);
// byte[] orderNumberBytes = BytesUtil.stringToHexBytes(orderNumber, 16);
byte[] orderNumberBytes = BytesUtil.str2Bcd(orderNumber);
// 最大充电时长
byte[] maxChargeDurationBytes = BytesUtil.stringToHexBytes(maxChargeDuration, 2);
// 过载功率

View File

@@ -1,34 +0,0 @@
package com.jsowell.pile.service.impl;
import com.jsowell.common.enums.ykc.PileChannelEntity;
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* 电单车发送指令service
*/
@Slf4j
@Service
public class EBikeSendCommandService {
/**
* 公共方法发送指令
* @param pileSn 装编号
* @param msg 消息
* @param timeout 超时时间
* @param unit 时间单位
*/
private void sendCommand(String pileSn, Class<? extends AbsEBikeMessage> msg, long timeout, TimeUnit unit) {
// 通过桩编号获取channel
ChannelHandlerContext ctx = PileChannelEntity.getChannelByPileSn(pileSn);
if (Objects.isNull(ctx)) {
log.error("push命令[{}]失败, 桩号:{}无法获取到长连接, 请检查充电桩连接状态!", "value", pileSn);
throw new NullPointerException("channel");
}
}
}