!12 充电过程BMS信息

* Merge branch 'master' into Feat_BMS_Charging_Info
* 修改实体名称
* Merge branch 'master' into Feat_BMS_Charging_Info
* 充电过程BMS信息
* 充电过程BMS信息
* 充电过程BMS信息
This commit is contained in:
increment
2025-08-01 07:20:12 +00:00
committed by 三丙
parent 48d7209ed4
commit 6c439fb4a0
6 changed files with 130 additions and 1 deletions

View File

@@ -58,8 +58,11 @@
`68 31 00 16 00 17 32 01 02 00 00 00 00 11 15 11 16 15 55 35 02 60 20 23 12 12 00 00 10 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BB 78`
---
---
#### 0x1B 充电桩与 BMS 充电错误报文
`68 24 00 17 00 1B 32 01 02 00 00 00 00 11 15 11 16 15 55 35 02 06 20 23 12 12 00 00 10 01 00 00 00 00 00 00 00 00 79 00`
---
---
#### 0x25 充电过程BMS信息
`68 31 01 00 00 25 32 01 02 00 00 00 00 11 15 11 16 15 55 35 02 60 20 23 12 12 00 00 10 01 01 01 01 01 01 01 00 01 00 01 00 01 00 01 00 01 00 01 00 00 00 BE C8`

View File

@@ -0,0 +1,96 @@
package sanbing.jcpp.protocol.yunkuaichong.v150.cmd;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import lombok.extern.slf4j.Slf4j;
import sanbing.jcpp.infrastructure.util.codec.BCDUtil;
import sanbing.jcpp.infrastructure.util.jackson.JacksonUtil;
import sanbing.jcpp.proto.gen.ProtocolProto.BmsChargingInfoProto;
import sanbing.jcpp.proto.gen.ProtocolProto.UplinkQueueMessage;
import sanbing.jcpp.protocol.ProtocolContext;
import sanbing.jcpp.protocol.listener.tcp.TcpSession;
import sanbing.jcpp.protocol.yunkuaichong.YunKuaiChongUplinkCmdExe;
import sanbing.jcpp.protocol.yunkuaichong.YunKuaiChongUplinkMessage;
import sanbing.jcpp.protocol.yunkuaichong.annotation.YunKuaiChongCmd;
/**
* 充电过程BMS信息
*
* @author facai
*/
@Slf4j
@YunKuaiChongCmd(0x25)
public class YunKuaiChongV150BmsChargingInfoULCmd extends YunKuaiChongUplinkCmdExe {
@Override
public void execute(TcpSession tcpSession, YunKuaiChongUplinkMessage yunKuaiChongUplinkMessage, ProtocolContext ctx) {
log.debug("{} 云快充1.5.0充电过程BMS信息", tcpSession);
ByteBuf byteBuf = Unpooled.wrappedBuffer(yunKuaiChongUplinkMessage.getMsgBody());
ObjectNode additionalInfo = JacksonUtil.newObjectNode();
// 1.交易流水号
byte[] tradeNoBytes = new byte[16];
byteBuf.readBytes(tradeNoBytes);
String tradeNo = BCDUtil.toString(tradeNoBytes);
// 2.桩编号
byte[] pileCodeBytes = new byte[7];
byteBuf.readBytes(pileCodeBytes);
String pileCode = BCDUtil.toString(pileCodeBytes);
// 3.枪号
byte[] gunCodeBytes = new byte[1];
byteBuf.readBytes(gunCodeBytes);
String gunCode = BCDUtil.toString(gunCodeBytes);
// 4.BMS最高单体动力蓄电池电压所在编号
additionalInfo.put("BMS最高单体动力蓄电池电压所在编号", byteBuf.readByte());
// 5.BMS最高动力蓄电池温度
additionalInfo.put("BMS最高动力蓄电池温度", byteBuf.readByte());
// 6.最高温度检测点编号
additionalInfo.put("最高温度检测点编号", byteBuf.readByte());
// 7.最低动力蓄电池温度
additionalInfo.put("最低动力蓄电池温度", byteBuf.readByte());
// 8.最低动力蓄电池温度检测点编号
additionalInfo.put("最低动力蓄电池温度检测点编号", byteBuf.readByte());
// 9.BMS单体动力蓄电池电压过高/过低 00:正常 01:过高 10:过低
additionalInfo.put("BMS单体动力蓄电池电压过高/过低", stateToStr(byteBuf.readShortLE()));
// 10.BMS整车动力蓄电池荷电状态SOC 过高/过低 00:正常 01:过高 10:过低
additionalInfo.put("BMS整车动力蓄电池荷电状态SOC", stateToStr(byteBuf.readShortLE()));
// 11.BMS动力蓄电池充电过电流 00:正常 01:过流 10:不可信状态
additionalInfo.put("BMS动力蓄电池充电过电流", stateToStr1(byteBuf.readShortLE()));
// 12.BMS动力蓄电池温度过高 00:正常 01:过流 10:不可信状态
additionalInfo.put("BMS动力蓄电池温度过高", stateToStr1(byteBuf.readShortLE()));
// 13.BMS动力蓄电池绝缘状态 00:正常 01:过流 10:不可信状态
additionalInfo.put("BMS动力蓄电池绝缘状态", stateToStr1(byteBuf.readShortLE()));
// 14.BMS动力蓄电池组输出连接器连接状态 00:正常 01:过流 10:不可信状态
additionalInfo.put("BMS动力蓄电池组输出连接器连接状态", stateToStr1(byteBuf.readShortLE()));
// 15.充电禁止 00:禁止 01:允许
additionalInfo.put("BMS动力蓄电池组输出连接器连接状态", byteBuf.readShortLE() == 0 ? "禁止" : "允许");
// 16.预留位
byteBuf.skipBytes(2);
BmsChargingInfoProto bmsCharingInfoProto = BmsChargingInfoProto.newBuilder()
.setPileCode(pileCode)
.setTradeNo(tradeNo)
.setGunCode(gunCode)
.setAdditionalInfo(additionalInfo.toString())
.build();
UplinkQueueMessage uplinkQueueMessage = uplinkMessageBuilder(bmsCharingInfoProto.getPileCode(), tcpSession, yunKuaiChongUplinkMessage)
.setBmsChargingInfoProto(bmsCharingInfoProto)
.build();
tcpSession.getForwarder().sendMessage(uplinkQueueMessage);
}
private String stateToStr(short state) {
return switch (state) {
case 0 -> "正常";
case 1 -> "过高";
default -> "过低";
};
}
private String stateToStr1(short state) {
return switch (state) {
case 0 -> "正常";
case 1 -> "过高";
default -> "不可信状态";
};
}
}