mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 电单车协议
This commit is contained in:
@@ -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);
|
||||
// 过载功率
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user