update 电单车

This commit is contained in:
Guoqs
2024-09-13 16:12:26 +08:00
parent 09a8709618
commit 871b8bea77
2 changed files with 20 additions and 32 deletions

View File

@@ -150,7 +150,8 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
startIndex += length;
length = 2;
this.totalUsedElectricity = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.01 + "";
this.totalUsedElectricity = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.01")).toString();
startIndex += length;
length = 1;
@@ -158,19 +159,23 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
startIndex += length;
length = 2;
this.realTimePower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.1 + "";
this.realTimePower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 2;
this.maxPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.1 + "";
this.maxPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 2;
this.minPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.1 + "";
this.minPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 2;
this.avgPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.1 + "";
this.avgPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 16;
@@ -182,7 +187,8 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
startIndex += length;
length = 2;
this.peakPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) + "";
this.peakPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 2;
@@ -196,11 +202,13 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
startIndex += length;
length = 1;
this.ambientTemperature = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) + "";
this.ambientTemperature = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.subtract(new BigDecimal("65")).toString();
startIndex += length;
length = 1;
this.portTemperature = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) + "";
this.portTemperature = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.subtract(new BigDecimal("65")).toString();
startIndex += length;
length = 2;