| | |
| | | import com.dy.common.mw.protocol.p206V202404.*; |
| | | import com.dy.common.mw.protocol.p206V202404.upVos.DataCd83Vo; |
| | | import com.dy.common.util.ByteUtil; |
| | | import com.dy.common.util.DateTime; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | |
| | | */ |
| | | protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { |
| | | DataV202404 dV1 = (DataV202404)data.getSubData() ; |
| | | DataCd83Vo cdData = new DataCd83Vo() ; |
| | | DataCd83Vo cdData = new DataCd83Vo(CodeV202404.getCodeName(dataCode)) ; |
| | | dV1.subData = cdData ; |
| | | int index = ProtocolConstantV206V202404.dataIndex ; |
| | | cdData.controllerType = ByteUtil.bytes2Hex(bs, false, index, 1) ; |
| | |
| | | index += 4 ; |
| | | cdData.batteryVolt = ByteUtil.BCD2Int_LE(bs, index, index + 1)/100.0D ; |
| | | |
| | | index += 2 ; |
| | | String hh = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String dd = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String mm = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | index ++ ; |
| | | String yy = ByteUtil.BCD2String_LE(bs, index, index) ; |
| | | |
| | | String ymd = "20" + yy + "-" + mm + "-" + dd ; |
| | | |
| | | cdData.rtuDt = ymd + " " + hh ; |
| | | |
| | | cdData.dataDt = DateTime.lastXDay_yyyy_MM_dd(ymd, 1) ; |
| | | } |
| | | |
| | | } |