From 792ca2a402feb952ef890d653f2e049c1230baf1 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期六, 19 十二月 2020 18:48:33 +0800 Subject: [PATCH] 1111 --- HDL_ON/DAL/DriverLayer/Control.cs | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index d1164c5..13b5269 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -182,6 +182,8 @@ public void SearchLoaclGateway() { MainPage.Log($"鎼滅储鏈湴缃戝叧鍒楄〃锛岀綉鍏崇被鍨�:{DB_ResidenceData.Instance.GatewayType}"); + if (MainPage.InternetStatus == 0) + return; OpenUdp(DB_ResidenceData.Instance.GatewayType == 0 ? 6000 : 8585); new System.Threading.Thread(() => { @@ -199,13 +201,13 @@ } System.Threading.Thread.Sleep(500); } + if (!GatewayOnline)//缃戝叧涓嶅湪绾跨殑鏃跺�欐墠鍙皾璇曡繙绋嬭繛鎺� + { + Ins.IsRemote = true; + DAL.Mqtt.MqttClient.InitState(); + } }) { IsBackground = true }.Start(); - if (!GatewayOnline)//缃戝叧涓嶅湪绾跨殑鏃跺�欐墠鍙皾璇曡繙绋嬭繛鎺� - { - Ins.IsRemote = true; - DAL.Mqtt.MqttClient.InitState(); - } } /// <summary> -- Gitblit v1.8.0