1078-支持位置汇报

This commit is contained in:
648540858
2024-03-16 23:22:07 +08:00
parent 9bc9dbe43b
commit 3e672ca38c
5 changed files with 202 additions and 30 deletions

View File

@@ -0,0 +1,17 @@
package com.genersoft.iot.vmp.jt1078.util;
public class BCDUtil {
public static String transform(byte[] bytes) {
if (bytes.length == 0) {
return null;
}
// BCD[6] 解析时间
StringBuffer temp = new StringBuffer(bytes.length * 2);
for (int i = 0; i < bytes.length; i++) {
temp.append((byte) ((bytes[i] & 0xf0) >>> 4));
temp.append((byte) (bytes[i] & 0x0f));
}
return temp.toString();
}
}