From 742e0a8ec019ccb76f03fcc58859ed15e9264c4c Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 31 一月 2024 08:26:30 +0800
Subject: [PATCH] 2024-01-31 朱宝民 电子钱包账户注册接口、充值接口
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
index c1b8d7f..e9677bb 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CommonV1_0_1.java
@@ -82,11 +82,29 @@
public String parseRtuAddr(byte[] bs)throws Exception{
String rtuAddrBCD = "" + ByteUtil.BCD2Long_BE(bs, ProtocolConstantV206V1_0_0.rtuAddr1Index_start, ProtocolConstantV206V1_0_0.rtuAddr1Index_end) ;
String rtuAddrStr = "" + ByteUtilUnsigned.bytes2Short_BE(bs, ProtocolConstantV206V1_0_0.rtuAddr2Index_start) ;
- while(rtuAddrStr.length() < 4){
+ while(rtuAddrStr.length() < 5){
rtuAddrStr = "0" + rtuAddrStr ;
}
return rtuAddrBCD + rtuAddrStr ;
}
+
+
+ /**
+ * 鍒嗘瀽Rtu鍦板潃
+ * @param bs 涓婅瀛楄妭鏁扮粍
+ * @param index 鍚浣�
+ * @return 鎺у埗鍣ㄥ湴鍧�
+ * @throws Exception 寮傚父
+ */
+ public String parseRtuAddr(byte[] bs, int index)throws Exception{
+ String rtuAddrBCD = "" + ByteUtil.BCD2Long_BE(bs, index, index + 2) ;
+ String rtuAddrStr = "" + ByteUtilUnsigned.bytes2Short_BE(bs, index + 3) ;
+ while(rtuAddrStr.length() < 5){
+ rtuAddrStr = "0" + rtuAddrStr ;
+ }
+ return rtuAddrBCD + rtuAddrStr ;
+ }
+
/**
* 鍒嗘瀽鍔熻兘鐮�
@@ -145,6 +163,7 @@
case 7 -> "绱ф�ュ叧闃�";
case 8 -> "鐢ㄦ埛杩滅▼寮�闃�";
case 9 -> "鐢ㄦ埛杩滅▼鍏抽榾";
+ case 16 -> "绠¢亾鏃犳按鑷姩鍏抽榾";
default -> "鏈煡";
};
}
--
Gitblit v1.8.0