| | |
| | | * @throws Exception 异常 |
| | | */ |
| | | public static String parseIcCardNo(byte[] bs, int index)throws Exception{ |
| | | String rtuAddrStr = "" + ByteUtilUnsigned.bytes2Short_LE(bs, index) ; |
| | | String rtuAddrBCD = "" + ByteUtil.BCD2Long_LE(bs, index + 2, index + 7) ; |
| | | while(rtuAddrStr.length() < 5){ |
| | | rtuAddrStr = "0" + rtuAddrStr ; |
| | | String icNoStr = "" + ByteUtilUnsigned.bytes2Short_LE(bs, index) ; |
| | | String icNoBCD = "" + ByteUtil.BCD2Long_LE(bs, index + 2, index + 7) ; |
| | | while(icNoStr.length() < 5){ |
| | | icNoStr = "0" + icNoStr ; |
| | | } |
| | | return rtuAddrBCD + rtuAddrStr ; |
| | | return icNoBCD + icNoStr ; |
| | | } |
| | | |
| | | |