|
|
@@ -39,6 +39,8 @@ public class ExecutionServer {
|
|
|
}
|
|
|
|
|
|
public String ExecutionData(String data) {
|
|
|
+ System.out.println("writer==================="+writer);
|
|
|
+ System.out.println("reader==================="+reader);
|
|
|
try {
|
|
|
String msg = "AT+STACH1=1\r\n";
|
|
|
System.out.println("第1路闭合,发送指令:AT+STACH1=1\\r\\n");
|
|
|
@@ -48,6 +50,11 @@ public class ExecutionServer {
|
|
|
//读数据
|
|
|
msg = reader.readLine();
|
|
|
System.out.println("msg================:"+msg);
|
|
|
+ if (msg != null) {
|
|
|
+ msg = msg.replace("\r\n", "\\r\\n");
|
|
|
+ } else {
|
|
|
+ msg = "发送指令成功:没有返回信息";
|
|
|
+ }
|
|
|
msg = msg.replace("\r\n", "\\r\\n");
|
|
|
System.out.println("设备应答:" + msg);
|
|
|
System.out.println("指令执行成功!");
|