mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 电单车
This commit is contained in:
@@ -13,13 +13,6 @@ import java.util.Arrays;
|
||||
@Slf4j
|
||||
public class YouDianUtils {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = "1921ed07";
|
||||
|
||||
String s1 = resolvePhysicalId(s);
|
||||
System.out.println(s1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析物理id
|
||||
* 电单车二维码地址:https://api.jsowellcloud.com/app-xcx-h5/pile/pileDetail/1921ed07/ff
|
||||
@@ -122,6 +115,14 @@ public class YouDianUtils {
|
||||
return BytesUtil.reverse(concat);
|
||||
}
|
||||
|
||||
public static String getPhysicalIdHEXStr(int deviceNumber) {
|
||||
byte[] physicalIdBytes = BytesUtil.intToBytes(deviceNumber, 3);
|
||||
// 拼接识别码, 12路插座
|
||||
byte[] concat = Bytes.concat(EBikeTypeEnum.socket_12way.getBytes(), physicalIdBytes);
|
||||
byte[] reverse = BytesUtil.reverse(concat);
|
||||
return BytesUtil.printHexBinary(reverse);
|
||||
}
|
||||
|
||||
// public static String convertPortNumberToHex(int portNumber) {
|
||||
// if (portNumber < 1 || portNumber > 16) {
|
||||
// throw new IllegalArgumentException("Port number must be between 1 and 16.");
|
||||
|
||||
Reference in New Issue
Block a user