| package com.dy.common.mw.protocol; | 
|   | 
| /** | 
|  * 从RTU收到数据 | 
|  */ | 
| public class MidResultFromRtu  implements MidResult{ | 
|   | 
|     public static final long serialVersionUID; | 
|     static { | 
|         serialVersionUID = 201606271057002L; | 
|     } | 
|   | 
|     public String commandId ;//发送命令的ID,如果是命令结果,并且匹配了下发命令,此值不为空 | 
|      | 
|     public String protocolName ;//协议名称 | 
|     public String rtuAddr ;//Rtu地址 | 
|     public String upCode ;//上行数据中的功能码 | 
|     public String upHex ;//上行数据十六进制形式 | 
|     public byte[] upBuffer ;//上行数据字节数组 | 
|     public Data data ;//解析后的数据 | 
|     public Boolean reportOrResponse_trueOrFalse ;//数据是自动上报还是命令应答,自动上报(report)为true,命令应答(response)为false | 
|   | 
|     @Override | 
|     public void action() { | 
|         ProtocolUnit.getInstance().adapter.getSingleActionFromRtu(this.protocolName).doAction(this);  | 
|     } | 
|      | 
|     public void setCommandId(String commandId){ | 
|         this.commandId = commandId ; | 
|         if(this.data != null){ | 
|             this.data.setCommandId(commandId); | 
|         } | 
|     } | 
|   | 
| } |