update 电单车

This commit is contained in:
Guoqs
2024-09-13 09:33:23 +08:00
parent e154b0c0dc
commit decd185c79
3 changed files with 21 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
package com.jsowell.pile.domain.ebike.deviceupload;
import com.jsowell.common.YouDianUtils;
import com.jsowell.common.util.BytesUtil;
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
import lombok.Getter;
@@ -42,7 +43,7 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
@Setter
public static class PowerHeartbeat {
/**
* 端口号当前充电的端口号。注00表示1号端口01表示2号端口
* 端口号当前充电的端口号。注00表示1号端口01表示2号端口; port+1为实际端口
*/
private String port;
@@ -135,7 +136,8 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
public PowerHeartbeat(byte[] dataBytes) {
int startIndex = 0;
int length = 1;
this.port = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(dataBytes, startIndex, startIndex = startIndex + length)) + "";
int i = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(dataBytes, startIndex, startIndex = startIndex + length));
this.port = i + YouDianUtils.convertPortNumberToString(i);
length = 1;
this.portStatus = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(dataBytes, startIndex, startIndex = startIndex + length)) + "";