From eb424d24e39bab4a245725f35deab3f234ea0f13 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 13 十二月 2019 10:48:50 +0800
Subject: [PATCH] 2019.12.13
---
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