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:
@@ -73,7 +73,7 @@ public abstract class AbsEBikeMessage {
|
||||
|
||||
// 读取物理ID
|
||||
byte[] physicalIdBytes = Arrays.copyOfRange(messageBytes, 5, 9);
|
||||
int physicalId = BytesUtil.bytesToIntLittle(physicalIdBytes);
|
||||
int physicalId = BytesUtil.convertToPhysicalId(physicalIdBytes);
|
||||
|
||||
// 读取消息ID
|
||||
byte[] messageIdBytes = Arrays.copyOfRange(messageBytes, 9, 11);
|
||||
|
||||
@@ -84,8 +84,13 @@ public class EBikeMessageCmd21 extends AbsEBikeMessage {
|
||||
statusList.add(PortStatusEnum.getDescriptionByValue(status));
|
||||
}
|
||||
this.portStatus = statusList;
|
||||
this.rssi = BytesUtil.bcd2StrLittle(Arrays.copyOfRange(dataBytes, dataBytes.length - 2, dataBytes.length - 1));
|
||||
this.temperature = BytesUtil.bcd2StrLittle(Arrays.copyOfRange(dataBytes, dataBytes.length - 1, dataBytes.length));
|
||||
this.rssi = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(dataBytes, dataBytes.length - 2, dataBytes.length - 1)) + "";
|
||||
//
|
||||
int i = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(dataBytes, dataBytes.length - 1, dataBytes.length));
|
||||
if (i > 65) {
|
||||
i = i - 65;
|
||||
}
|
||||
this.temperature = i + "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user