New file |
| | |
| | | package com.dy.common.mw.protocol.p206V1_0_0; |
| | | |
| | | import com.dy.common.mw.protocol.AnnotationOnLine; |
| | | import com.dy.common.mw.protocol.OnLine; |
| | | |
| | | @AnnotationOnLine( |
| | | protocolName = ProtocolConstantV206V1_0_0.protocolName, |
| | | priority = ProtocolConstantV206V1_0_0.priority) |
| | | @SuppressWarnings("unused") |
| | | public class OnLineV1_0_1 implements OnLine{ |
| | | |
| | | /** |
| | | * 对上线数据进行分析 |
| | | * @param upBuf 上行数据 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public OnLineResult parse(byte[] upBuf)throws Exception { |
| | | OnLineResult olr = new OnLineResult() ; |
| | | CommonV1_0_1 cp = new CommonV1_0_1() ; |
| | | Boolean flag = cp.isThisProtocolHead(upBuf) ; |
| | | if(flag == null){ |
| | | //出错 |
| | | olr.result = OnLine.OnLineAction_fail ; |
| | | olr.rtuAddr = null ; |
| | | }else if(!flag.booleanValue()){ |
| | | //不是本协议数据 |
| | | olr.result = OnLine.OnLineAction_success_noMe ; |
| | | olr.rtuAddr = null ; |
| | | }else{ |
| | | //是本协议数据 |
| | | olr.result = OnLine.OnLineAction_success ; |
| | | olr.rtuAddr = cp.parseRtuAddr(upBuf) ; |
| | | olr.protocolName = ProtocolConstantV206V1_0_0.protocolName ; |
| | | } |
| | | return olr; |
| | | } |
| | | |
| | | } |