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:
@@ -64,7 +64,7 @@ public class ChargingOperationResponse extends AbsEBikeMessage2 {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = "444e591d00198bca07f106820013273881052409191439471814850828040000ad06";
|
||||
String s = "444e591d00198bca0727268200132738810524091914394718148508280400000306";
|
||||
byte[] messageBytes = BytesUtil.hexStringToByteArray(s);
|
||||
ChargingOperationResponse response = new ChargingOperationResponse(messageBytes);
|
||||
System.out.println(response);
|
||||
|
||||
@@ -7,19 +7,21 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
public class EBikeMessageCmd03 extends AbsEBikeMessage2 {
|
||||
private int chargingTime; // 充电时长, 单位:"秒"
|
||||
private int maxPower; // 最大功率, 单位:"0.1W"
|
||||
private int consumedEnergy; // 耗电量, 单位:"0.01度"
|
||||
private BigDecimal maxPower; // 最大功率, 桩给的数据单位:"0.1W", 代码已经转为瓦
|
||||
private BigDecimal consumedEnergy; // 耗电量, 桩给的数据单位:"0.01度", 代码已经转为度
|
||||
private String connectorCode; // 端口号
|
||||
private int startMode; // 在线/离线启动/验证码
|
||||
private int cardNumberOrVerificationCode; // 卡号/验证码
|
||||
private int stopReason; // 停止原因
|
||||
private String orderNumber; // 订单编号
|
||||
private int secondMaxPower; // 第二最大功率
|
||||
private BigDecimal secondMaxPower; // 第二最大功率
|
||||
// private String timestamp; // 时间戳 上发指令当时的时间,有时候不准确,该字段属于调试使用,服务器无需关心此字段
|
||||
// private String placeholderDuration; // 占位时长 充电柜专用,其他设备忽略此字段 表示充满后占用设备的时长,单位为分钟
|
||||
|
||||
@@ -32,11 +34,12 @@ public class EBikeMessageCmd03 extends AbsEBikeMessage2 {
|
||||
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
this.maxPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(messageBytes, startIndex, length));
|
||||
this.maxPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(messageBytes, startIndex, length))).multiply(new BigDecimal("0.1"));
|
||||
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
this.consumedEnergy = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(messageBytes, startIndex, length));
|
||||
this.consumedEnergy = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(messageBytes, startIndex, length)))
|
||||
.multiply(new BigDecimal("0.01"));
|
||||
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
@@ -60,7 +63,7 @@ public class EBikeMessageCmd03 extends AbsEBikeMessage2 {
|
||||
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
this.secondMaxPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(messageBytes, startIndex, length));
|
||||
this.secondMaxPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(messageBytes, startIndex, length))).multiply(new BigDecimal("0.1"));
|
||||
|
||||
// this.timestamp = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(messageBytes, 31, 35)) + "";
|
||||
// this.placeholderDuration = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(messageBytes, 35, 37)) + "";
|
||||
|
||||
Reference in New Issue
Block a user