| | |
| | | import com.dy.common.mw.protocol.*; |
| | | import com.dy.common.util.DateTime; |
| | | |
| | | @AnnotationDriver(enable = true, name= ProtocolConstantV206V1.protocolName) |
| | | @AnnotationDriver(enable = true, |
| | | name= ProtocolConstantV206V1.protocolName, |
| | | version= ProtocolConstantV206V1.protocolVer) |
| | | public class DriverV1 extends Driver { |
| | | |
| | | private static String scanRootPackage = "com.dy.common.mw.protocol.p206V1" ; |
| | |
| | | } |
| | | @Override |
| | | public void notify(NotifyInfo ...infos) { |
| | | notify.notify(rtuAddr, ProtocolConstantV206V1.protocolName, ProtocolConstantV206V1.protocolVer, infos); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | isFail = true ; |
| | | return new MidResult[]{(new MidResultError(ProtocolConstantV206V1.protocolName, rtuAddr, "严重错误,分析Rtu数据出错!数据为:" + upHex + (e.getMessage() == null?"":(",出错信息:" + e.getMessage())), e))} ; |
| | | } finally{ |
| | | callback.callback(rtuAddr, upCode, CodeV1.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddr); |
| | | if(upCode != null){ |
| | | //CRC验证失败时,upCode为null,此时不进行回调 |
| | | callback.callback(rtuAddr, upCode, CodeV1.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddr); |
| | | } |
| | | } |
| | | } |
| | | |