From ac39680a5ace5c02c63369014993fbfc959dbe5f Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 24 二月 2020 09:09:10 +0800
Subject: [PATCH] 2020-02-24 1.优化更新。

---
 Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs b/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
index b635ffe..0013c38 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
@@ -21,7 +21,7 @@
         /// <summary>
         /// 妫�娴�/杩炴帴杩滅▼
         /// </summary>
-        public static void CheckLinkRemote (int status)
+        public static void CheckLinkRemote (int status, bool IsReconnectRemote = true)
         {
             //if (isConnectiong) {
             //    return;
@@ -65,14 +65,26 @@
                                 obj.Split ('_') [1].ToString () == DeviceType.OnePortMqttFR.ToString ());
                         });
                         bool canRemote = false;
-                        if (CommonPage.IsRemote) {
-                            //await SmartHome.MqttCommon.StartCloudMqtt ();
-                            SmartHome.MqttCommon.MqttRemoteSend (new byte [] { }, 3);
-                        }
+                       
                         if (gateWayList == null || gateWayList.Count == 0) {
                             Utlis.ShowAppLinkStatus (AppLinkStatus.WiFiOffline);
                             await DisConnectRemoteAsync ();
                         }
+
+
+                        if (IsReconnectRemote) {
+                            if (CommonPage.IsRemote) {
+                                CommonPage.IsRemote = false;
+                                Utlis.ShowAppLinkStatus (AppLinkStatus.WiFiOffline);
+                                await SmartHome.MqttCommon.DisConnectRemoteMqttClient ();
+                            }
+                        }
+
+                        if (CommonPage.IsRemote) {
+                            //await SmartHome.MqttCommon.StartCloudMqtt ();
+                            SmartHome.MqttCommon.MqttRemoteSend (new byte [] { }, 3);
+                        }
+
                         //鏈湴鏄惁瀛樺湪涓庡綋鍓嶄綇瀹呯粦瀹氱綉鍏崇殑鏁版嵁
                         bool HomeGatewaysExistsLocally = false;
                         foreach (var gatewayFileName in gateWayList) {

--
Gitblit v1.8.0