From c5a873df96e4a797426e4dd5eafe5b43f7aea564 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期六, 19 十二月 2020 15:41:53 +0800 Subject: [PATCH] 20201218-2 --- 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