From 3a26f6025130dcaae4aa82ea19b16ad902450eb8 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 28 十一月 2019 11:43:47 +0800
Subject: [PATCH] 合并全部代码完成

---
 ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
index f4c69b6..93698ba 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
@@ -65,7 +65,7 @@
                             //鏈�鍚庡啀鏂紑mqtt杩炴帴
                             for (int i = 0; i < list.Count; i++)
                             {
-                                list[i].DisConnect("1");
+                                list[i].DisConnectLocalMqttClient("1");
                             }
                             list.Clear();
                             oldHomeID = Shared.Common.Config.Instance.HomeId;
@@ -111,6 +111,10 @@
                         else
                         {
                             ZbGateway.IsRemote = true;
+                            for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
+                            {
+                                 ZbGateway.GateWayList[i].DisConnectLocalMqttClient("1");
+                            }
                         }
 
                         searchCount--;
@@ -208,8 +212,8 @@
                                     var gateWay = ZbGateway.GateWayList.Find(obj => obj.getGatewayBaseInfo != null && obj.getGatewayBaseInfo.gwID == zbGateWay.getGatewayBaseInfo.gwID);
                                     if (gateWay == null)
                                     {
-                                        await zbGateWay.StartLocalMqtt(ipAddress);
                                         ZbGateway.GateWayList.Add(zbGateWay);
+                                        await zbGateWay.StartLocalMqtt(ipAddress);
                                         NewGateWayAction?.Invoke(zbGateWay);
                                     }
                                     else
@@ -219,11 +223,11 @@
                                         gateWay.GatewayOnlineFlage = true;
                                         if (gateWay.getGatewayBaseInfo.IpAddress != ipAddress)
                                         {
-                                            gateWay.DisConnect("2");
+                                            await gateWay.DisConnectLocalMqttClient("2");
                                             ZbGateway.GateWayList.Remove(gateWay);
                                             gateWay = zbGateWay;
-                                            await zbGateWay.StartLocalMqtt(ipAddress);
                                             ZbGateway.GateWayList.Add(gateWay);
+                                            await zbGateWay.StartLocalMqtt(ipAddress);
                                         }
                                         else
                                         {
@@ -270,7 +274,7 @@
                     try
                     {
                         //瀹氭椂妫�娴嬭繙绋嬭繛鎺ユ儏鍐�
-                        await ZbGateway.StartCloudMqtt(); 
+                        await ZbGateway.StartRemoteMqtt(); 
                         if (!ZbGateway.IsRemote)
                         {
                             System.Threading.Thread.Sleep(500);

--
Gitblit v1.8.0