| | |
| | | import java.net.URI; |
| | | import java.net.URL; |
| | | |
| | | @AnnotationDriver(name= ProtocolConstantV206V1_0_0.protocolName) |
| | | @AnnotationDriver(enable = true, name= ProtocolConstantV206V1_0_0.protocolName) |
| | | public class DriverV1_0_1 extends Driver { |
| | | |
| | | private static String scanRootPackage = "" ; |
| | | private static String scanRootPackage = "com.dy.common.mw.protocol.p206V1_0_0." ; |
| | | |
| | | //在Driver中是单例,随Driver的单例对象在单线程中运行 |
| | | private ParseParamsForUpV1_0_1 upCpParams ; |
| | |
| | | callback.callback(rtuAddr, upCode, upHex, reportOrResponse_trueOrFalse, isFail, rtuAddrInData); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 构造下行数据(命令) |
| | | * @param isLowPower 是否在低功耗环境下运行 |
| | |
| | | */ |
| | | @Override |
| | | public MidResult[] createCommand(Boolean isLowPower, Command command, Object... params) { |
| | | String RtuResultSendWebUrl = command.getRtuResultSendWebUrl() ; |
| | | if(RtuResultSendWebUrl == null || RtuResultSendWebUrl.trim().equals("")){ |
| | | return new MidResult[]{(new MidResultError(ProtocolConstantV206V1_0_0.protocolName, null, "严重错误,命令中rtu返回命令结果发向目的地web URL为空,不能构建任何命令!", null))} ; |
| | | } |
| | | String rtuAddr = command.getRtuAddr() ; |
| | | if(rtuAddr == null){ |
| | | return new MidResult[]{(new MidResultError(ProtocolConstantV206V1_0_0.protocolName, null, "严重错误,命令中IMEI号为空,不能构建任何命令!", null))} ; |
| | | if(rtuAddr == null || rtuAddr.trim().equals("")){ |
| | | return new MidResult[]{(new MidResultError(ProtocolConstantV206V1_0_0.protocolName, null, "严重错误,命令中Rtu地址为空,不能构建任何命令!", null))} ; |
| | | } |
| | | try { |
| | | String commandCode = command.getCode() ; |
| | | |
| | | this.downCpParams.clear(); |
| | | this.downCpParams.setValue( |
| | | RtuResultSendWebUrl, |
| | | ProtocolConstantV206V1_0_0.protocolName, |
| | | rtuAddr, |
| | | command.getId(), |