mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 电单车
This commit is contained in:
@@ -133,4 +133,18 @@ public class YouDianUtils {
|
||||
// 转换为字节数组
|
||||
return BytesUtil.intToBytesLittle(hexValue, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 端口号从0开始
|
||||
* @param portNumber
|
||||
* @return
|
||||
*/
|
||||
public static String convertPortNumberToString(int portNumber) {
|
||||
if (portNumber < 0 || portNumber > 15) {
|
||||
throw new IllegalArgumentException("Port number must be between 0 and 15.");
|
||||
}
|
||||
|
||||
// 转换为字节数组
|
||||
return String.format("%02d", portNumber + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user