update 电单车协议

This commit is contained in:
Guoqs
2024-09-04 15:26:08 +08:00
parent bff743fc28
commit 40581a1402
2 changed files with 12 additions and 5 deletions

View File

@@ -76,7 +76,9 @@ public class EBikeMessageCmd82 extends AbsEBikeMessage {
// 告知设备的充电时长/电量, 如是0x0000则说明是充满自停, 其他数值则按照时长/电量充电, 且充满不会自停,
private int chargeDurationOrPower; // 充电时长/电量 (2字节)
private String orderNumber; // 订单编号 (16字节)
// 生成给桩的交易流水号, 桩协议叫订单编号
private String transactionCode; // 订单编号 (16字节)
// 最大充电时长、过载功率只对当前端口当前订单有效不影响其他端口动态设置此参数如果参数为0表示不修改会使用设备的设置值默认10小时
private int maxChargeDuration; // 最大充电时长 (2字节)
@@ -113,7 +115,7 @@ public class EBikeMessageCmd82 extends AbsEBikeMessage {
this.chargeDurationOrPower = BytesUtil.bytesToIntLittle(chargeDurationOrPowerBytes);
byte[] orderNumberBytes = Arrays.copyOfRange(dataBytes, 9, 25);
this.orderNumber = BytesUtil.bcd2StrLittle(orderNumberBytes);
this.transactionCode = BytesUtil.bcd2StrLittle(orderNumberBytes);
byte[] maxChargeDurationBytes = Arrays.copyOfRange(dataBytes, 25, 27);
this.maxChargeDuration = BytesUtil.bytesToIntLittle(maxChargeDurationBytes);
@@ -159,7 +161,7 @@ public class EBikeMessageCmd82 extends AbsEBikeMessage {
// 充电时长/电量
byte[] chargeDurationOrPowerBytes = BytesUtil.intToBytesLittle(chargeDurationOrPower, 2);
// 订单编号
byte[] orderNumberBytes = BytesUtil.ensureLength(BytesUtil.str2Bcd(orderNumber), 16);
byte[] orderNumberBytes = BytesUtil.ensureLength(BytesUtil.str2Bcd(transactionCode), 16);
// 最大充电时长
byte[] maxChargeDurationBytes = BytesUtil.intToBytesLittle(maxChargeDuration, 2);
// 过载功率