| | |
| | | */ |
| | | public PrefixedDataAvailableStatus forOnLine(IoBuffer in, |
| | | int remain, |
| | | int minDataLength, //对应ProtocolConstantV2_0.onLineDataMinLength |
| | | int maxDataLength //对应ProtocolConstant.errorMaxLength |
| | | int minDataLength, |
| | | int maxDataLength |
| | | ) throws Exception { |
| | | |
| | | int oldPosition = in.position() ; |
| | |
| | | return new PrefixedDataAvailableStatus().rubbish(remain) ; |
| | | } |
| | | |
| | | |
| | | CommonV1 parseCommon = new CommonV1(); |
| | | boolean isThisProtocolData = parseCommon.isThisProtocolHead(preByte) ; |
| | | Boolean[] isThisProtocolData = parseCommon.isThisProtocolHead(preByte) ; |
| | | |
| | | if(!isThisProtocolData){ |
| | | //不是本协议数据 |
| | | if(isThisProtocolData == null || isThisProtocolData.length != 2 || !isThisProtocolData[0].booleanValue()){ |
| | | //不是本RTU的协议数据 |
| | | return null ; |
| | | } |
| | | |
| | | Integer dataLen = parseCommon.parseFrameLen(preByte) ; |
| | | Integer dataLen = parseCommon.parseFrameLen(preByte, isThisProtocolData[1]) ; |
| | | |
| | | if(dataLen == null){ |
| | | String headHex = ByteUtil.bytes2Hex(preByte, true) ; |