|  |  | 
 |  |  |  | 
 |  |  | import com.dy.common.mw.protocol.*; | 
 |  |  | import com.dy.common.mw.protocol.p206V1.ProtocolConstantV206V1; | 
 |  |  | import com.dy.common.mw.protocol.p206V2.ProtocolConstantV206V2; | 
 |  |  | import com.dy.common.util.DateTime; | 
 |  |  |  | 
 |  |  | @AnnotationDriver(name= ProtocolConstantV206V202404.protocolName) | 
 |  |  | @AnnotationDriver(enable = true, | 
 |  |  |       name= ProtocolConstantV206V202404.protocolName, | 
 |  |  |       version= ProtocolConstantV206V202404.protocolVer) | 
 |  |  | public class DriverV202404 extends Driver { | 
 |  |  |     | 
 |  |  |    private static String scanRootPackage = "com.dy.common.mw.protocol.p206V202404" ; | 
 |  |  | 
 |  |  |       String upCode = null ; | 
 |  |  |       try{ | 
 |  |  |          CommonV202404 cp = new CommonV202404() ; | 
 |  |  |          cp.checkHead(upBuffer) ; | 
 |  |  |          Boolean p202404TrueUgFalse = cp.protocolType_p206TrueUgFalse(upBuffer) ; | 
 |  |  |          cp.checkTail(upBuffer) ; | 
 |  |  |          String crcStr = cp.checkCrc_str(upBuffer) ; | 
 |  |  |          String crcStr = cp.checkCrc_str(upBuffer, p202404TrueUgFalse) ; | 
 |  |  |          if(crcStr != null){ | 
 |  |  |             return new MidResult[]{(new MidResultError(ProtocolConstantV206V202404.protocolName, rtuAddr, "严重错误,上行数据CRC检查失败," + crcStr, null))} ; | 
 |  |  |          } | 
 |  |  |          rtuAddr = cp.parseRtuAddr(upBuffer) ; | 
 |  |  |          upCode = cp.parseCode(upBuffer) ; | 
 |  |  |          if(upCode == null){ | 
 |  |  |             return new MidResult[]{(new MidResultError(ProtocolConstantV206V202404.protocolName, rtuAddr, "严重错误,未能从上行数据中解析出功能码!", null))} ; | 
 |  |  | 
 |  |  |                } | 
 |  |  |                @Override | 
 |  |  |                public void notify(NotifyInfo ...infos) { | 
 |  |  |                   notify.notify(rtuAddr, ProtocolConstantV206V1.protocolName, ProtocolConstantV206V1.protocolVer, infos); | 
 |  |  |                } | 
 |  |  |             }); | 
 |  |  |          } |