seqint seqhex

This commit is contained in:
zz 2021-09-15 17:47:46 +08:00
parent 449a351629
commit 844c5ecafe
2 changed files with 11 additions and 7 deletions

View File

@ -90,7 +90,7 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler {
String version = ChargingPileServer.getVersion(handler.getName());
Map<String, Object> req = analysis(data, serviceName, version);
int seq = HexUtils.toInteger(data, 2, 4);
req.put("seq", seq);
req.put("seqint", seq);
String pileNo = (String) req.get("pileNo");
ServiceParameter sp = new ServiceParameter(serviceName, pileNo, req);
ServiceResult result = servicemainLogic.process(sp);

View File

@ -180,13 +180,17 @@ public class HexUtils {
public static void main(String[] args) {
System.out.println(Integer.parseInt("FF00", 16));
System.out.println(reverseHexInt("FF00"));
byte[] data1 = toBytes(reverseHex("FC080000"));
System.out.println(toInteger(data1, 0, 4));
System.out.println(reverseHexInt("FC080000"));
// System.out.println(Integer.parseInt("FF00", 16));
// System.out.println(reverseHexInt("FF00"));
// byte[] data1 = toBytes(reverseHex("FC080000"));
// System.out.println(toInteger(data1, 0, 4));
// System.out.println(reverseHexInt("FC080000"));
// System.out.println(toHexInt(100000));
System.out.println(toBits("1000"));
// System.out.println(toBits("1000"));
System.out.println(toHex(new byte[]{104, 48, 0, 119, 0, 37, 105, -123, 33, 69, -119, 101, 72, 2, 33, 9, 21, 22, 2, 40
, 1, 121, 105, -123, 33, 69, -119, 101, 72, 2, 17, 34, 51, 68, 85, 0, -48, 61, 46}));
System.out.println(toHex(new byte[]{104, 48, 0, -19, 0, 37, 105, -123, 33, 69, -119, 101, 72, 2, 33, 9, 21, 22, 2, 40
, 1, 121, 105, -123, 33, 69, -119, 101, 72, 2, 17, 34, 51, 68, 85, 0, -48, 14, 12}));
}
}