|
@@ -628,6 +628,7 @@ public class MainViewModel extends BaseViewModel implements SerialPortHelper.OnS
|
|
* */
|
|
* */
|
|
private IConnectNotifyListener notifyListener = new IConnectNotifyListener() {
|
|
private IConnectNotifyListener notifyListener = new IConnectNotifyListener() {
|
|
//物联网平台发送指令,接收并且响应
|
|
//物联网平台发送指令,接收并且响应
|
|
|
|
+ int closeTimeOver=1;
|
|
@Override
|
|
@Override
|
|
public void onNotify(String connectId, String topic, AMessage aMessage) {
|
|
public void onNotify(String connectId, String topic, AMessage aMessage) {
|
|
System.out.println("收到云端下行的数据:connectId:"+connectId+" topic :"+topic+" aMessage data:"+ aMessage.getData().getClass().getSimpleName());
|
|
System.out.println("收到云端下行的数据:connectId:"+connectId+" topic :"+topic+" aMessage data:"+ aMessage.getData().getClass().getSimpleName());
|
|
@@ -674,20 +675,25 @@ public class MainViewModel extends BaseViewModel implements SerialPortHelper.OnS
|
|
reportProperty();
|
|
reportProperty();
|
|
}
|
|
}
|
|
if(numInt==82){
|
|
if(numInt==82){
|
|
- pushRodMethod();//82秒后关门
|
|
|
|
|
|
+ if(closeTimeOver==1){
|
|
|
|
+ pushRodMethod();//82秒后关门
|
|
|
|
+ closeTimeOver=2;
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
});
|
|
});
|
|
thread.start();
|
|
thread.start();
|
|
}
|
|
}
|
|
if(topic.endsWith("thing/service/RemoteClose")){
|
|
if(topic.endsWith("thing/service/RemoteClose")){
|
|
Log.i(TAG,"收到云端关门========================");
|
|
Log.i(TAG,"收到云端关门========================");
|
|
- pushRodMethod();
|
|
|
|
|
|
+ if(closeTimeOver==1){
|
|
|
|
+ pushRodMethod();
|
|
|
|
+ closeTimeOver=2;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(topic.endsWith("thing/service/RemoteAgentOpen")){//开收运门
|
|
if(topic.endsWith("thing/service/RemoteAgentOpen")){//开收运门
|
|
Log.i(TAG,"收到云端开运收门");
|
|
Log.i(TAG,"收到云端开运收门");
|