mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
update 电单车协议
This commit is contained in:
@@ -142,24 +142,26 @@ public class EBikeMessageCmd82 extends AbsEBikeMessage {
|
||||
// 获取字节数组
|
||||
public byte[] getBytes() {
|
||||
// 费率模式
|
||||
byte[] rateModeBytes = BytesUtil.stringToHexBytes(rateMode, 1);
|
||||
byte[] rateModeBytes = BytesUtil.intToBytesLittle(Integer.parseInt(rateMode), 1);
|
||||
// 余额/有效期
|
||||
byte[] balanceOrValidityBytes = BytesUtil.stringToHexBytes(balanceOrValidity, 4);
|
||||
byte[] balanceOrValidityBytes = BytesUtil.intToBytesLittle(Integer.parseInt(balanceOrValidity), 4);
|
||||
// 端口号
|
||||
byte[] portNumberBytes = YouDianUtils.convertPortNumberToBytes(portNumber);
|
||||
// 充电命令
|
||||
byte[] chargeCommandBytes = BytesUtil.stringToHexBytes(chargeCommand, 1);
|
||||
byte[] chargeCommandBytes = BytesUtil.intToBytesLittle(Integer.parseInt(chargeCommand), 1);
|
||||
// 充电时长/电量
|
||||
byte[] chargeDurationOrPowerBytes = BytesUtil.stringToHexBytes(chargeDurationOrPower, 2);
|
||||
// 订单编号
|
||||
// byte[] orderNumberBytes = BytesUtil.stringToHexBytes(orderNumber, 16);
|
||||
byte[] orderNumberBytes = BytesUtil.str2Bcd(orderNumber);
|
||||
byte[] orderNumberBytes = BytesUtil.ensureLength(BytesUtil.str2Bcd(orderNumber), 16);
|
||||
// 最大充电时长
|
||||
byte[] maxChargeDurationBytes = BytesUtil.stringToHexBytes(maxChargeDuration, 2);
|
||||
// byte[] maxChargeDurationBytes = BytesUtil.stringToHexBytes(maxChargeDuration, 2);
|
||||
byte[] maxChargeDurationBytes = BytesUtil.intToBytesLittle(Integer.parseInt(maxChargeDuration), 2);
|
||||
// 过载功率
|
||||
byte[] overloadPowerBytes = BytesUtil.stringToHexBytes(overloadPower, 2);
|
||||
// byte[] overloadPowerBytes = BytesUtil.stringToHexBytes(overloadPower, 2);
|
||||
byte[] overloadPowerBytes = BytesUtil.intToBytesLittle(Integer.parseInt(overloadPower), 2);
|
||||
// 二维码灯
|
||||
// byte[] qrCodeLightBytes = BytesUtil.stringToHexBytes(qrCodeLight, 1);
|
||||
byte[] qrCodeLightBytes = BytesUtil.intToBytesLittle(Integer.parseInt(qrCodeLight), 1);
|
||||
// 长充模式
|
||||
// byte[] longChargeModeBytes = BytesUtil.stringToHexBytes(longChargeMode, 1);
|
||||
// 额外浮充时间
|
||||
|
||||
Reference in New Issue
Block a user