| | |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataAlarmVo; |
| | | import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataStateVo; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.ByteUtilUnsigned; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | |
| | | return avo ; |
| | | } |
| | | |
| | | /** |
| | | * 分析IC卡编号 |
| | | * @param bs 上行字节数组 |
| | | * @param index 启始位 |
| | | * @return 控制器地址 |
| | | * @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 ; |
| | | } |
| | | return rtuAddrBCD + rtuAddrStr ; |
| | | } |
| | | |
| | | |
| | | |
| | | public static String parseTp(byte[] bs, short index){ |
| | | String dt = "" ; |
| | | try{ |