From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 28 二月 2020 15:25:13 +0800
Subject: [PATCH] 2020.2.28

---
 ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
index fb91f54..86ca1f3 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -101,7 +101,7 @@
             }
         }
 
-        #region variable 
+        #region variable
         /// <summary>
         /// 杩滅▼杩炴帴鎴愬姛鏃剁殑鏃堕棿
         /// </summary>
@@ -224,6 +224,7 @@
         /// <para>绗竴涓弬鏁帮細濡傛灉涓� DDevice/IsGetEpointInfo:鏈夋柊璁惧鍔犲叆zigbee缃戠粶鍙嶉</para>璁惧璇锋眰APP鑾峰彇鍗囩骇鏁版嵁
         /// <para>绗竴涓弬鏁帮細濡傛灉涓� Device/DeviceJoinZbNet:鑾峰彇鏂拌澶囨墍鏈夌鐐逛俊鎭槸鍚︽垚鍔熷弽棣�</para>
         /// <para>绗竴涓弬鏁帮細濡傛灉涓� DeviceRequestAcUpdateData: 璁惧璇锋眰绌鸿皟鍙戝崌绾ф暟鎹�</para>
+        /// "宸茬粡閫氱煡");//宸茬粡閫氱煡");
         /// </summary>
         [Newtonsoft.Json.JsonIgnore]
         public Action<string, object> ReportAction;
@@ -3324,7 +3325,7 @@
         /// 杩滅▼MqttClient
         /// </summary>
         public static IMqttClient RemoteMqttClient= new MqttFactory().CreateMqttClient();
-        static bool remoteIsConnected; 
+        static bool remoteIsConnected;
         private int IsLogin = 0;
         [Newtonsoft.Json.JsonIgnore]
         static Action actionTemp;
@@ -3391,6 +3392,8 @@
                                     //璁㈤槄涓�涓垎浜暟鎹凡缁忓彉鏇寸殑涓婚
                                     await RemoteMqttClient.SubscribeAsync("/ZigbeeGateWayToClient/" + myGuid + "/Push/DeletedShareData");
                                 }
+                                //璁㈤槄涓�涓尋涓嬬嚎鐨勪富棰�
+                                await RemoteMqttClient.SubscribeAsync("/ZigbeeGateWayToClient/" + Config.Instance.ConnEmqClientId + "/Push/NotifySqueeze");
 
                                 await initGateWayBaseInfomation();
                                 Shared.Phone.UserCenter.HdlGatewayLogic.Current.CheckGatewayByConnectChanged(Shared.Phone.UserCenter.GatewayConnectMode.Remote);
@@ -3482,6 +3485,8 @@
                                 var connEmqClientId = responseData["ConnEmqClientId"]?.ToString();
                                 var connEmqUserName = responseData["ConnEmqUserName"]?.ToString();
                                 var connEmqPwd = responseData["ConnEmqPwd"]?.ToString();
+                                //璁板綍璧峰綋鍓嶇殑瀹㈡埛绔疘D
+                                Config.Instance.ConnEmqClientId = connEmqClientId;
 
                                 var connEmqDomainPorts = connEmqDomainPort.Replace("//", "").Split(':');
                                 var domain = connEmqDomainPorts[1];
@@ -3552,7 +3557,7 @@
                     await RemoteMqttClient.DisconnectAsync();
                 }
             }
-            catch(Exception e) { 
+            catch(Exception e) {
                 DebugPrintLog($"Remote鏂紑閫氳杩炴帴鍑哄紓甯�:{e.Message}");
             }
         }
@@ -3884,7 +3889,10 @@
                     epoint = topic.Split('/')[3];
                     cluID = topic.Split('/')[4];
                     attrId = topic.Split('/')[5];
-                }
+                }
+
+                //鍏ㄥ眬鎺ユ敹缃戝叧鎺ㄩ�佺殑鐨勯�昏緫(涓轰簡鎵ц閫熷害,灏藉彲鑳界殑鍒姞鑰楁椂鐨勬搷浣�)
+                Shared.Phone.UserCenter.HdlGatewayReceiveLogic.Current.GatewayOverallMsgReceive(gatewayID, topic, reportStatus, message);
 
                 var gwa = GateWayList.Find(obj => obj.getGatewayBaseInfo.gwID == gatewayID);
                 if (gwa == null)
@@ -3916,9 +3924,6 @@
                 {
                     jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
                 }
-
-                //鍏ㄥ眬鎺ユ敹缃戝叧鎺ㄩ�佺殑鐨勯�昏緫(涓轰簡鎵ц閫熷害,灏藉彲鑳界殑鍒姞鑰楁椂鐨勬搷浣�)
-                Shared.Phone.UserCenter.HdlGatewayReceiveLogic.Current.GatewayOverallMsgReceive(gatewayID, topic, reportStatus, jobject);
 
                 #region 杩滅▼,涓荤綉鍏充笂鎶ラ�氱煡
                 if (IsRemote)

--
Gitblit v1.8.0