From 9ef48d7b2da7c408b53f73be0f6eef3cbac1c84a Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 19 十一月 2020 10:23:45 +0800
Subject: [PATCH] Evoyo.Home1.1.0120111601_Release

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
index e92d774..d9e3d0c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs
@@ -87,8 +87,8 @@
                 listReceiptTopic[i] = gatewayID + "/" + listReceiptTopic[i];
             }
 
-            //鎺ユ敹鏁�
-            int receiptCount = 0;
+            //钃濇墠鍒氭暣浜嗕釜鍚屼竴涓富棰樺彲鑳戒細鎺ㄩ�佸涓繃鏉ョ殑鏈鸿兘
+            var listCheckTopic = new HashSet<string>();
             Action<string, string> receiptAction = (topic, message) =>
             {
                 var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
@@ -104,6 +104,11 @@
                 {
                     if (topic == listReceiptTopic[i])
                     {
+                        if (listCheckTopic.Contains(topic) == true)
+                        {
+                            //杩欓噷鍐欒繖涓笢瑗挎槸鏈夌偣鐢ㄥ鐨�
+                            continue;
+                        }
                         string deviceMac = jobject["DeviceAddr"].ToString();
                         int deviceEpoint = 200;
                         if (jobject.Property("Epoint") != null)
@@ -128,7 +133,11 @@
                             jobject.Remove("Time");
                         }
                         reResult.JsonData[i] = jobject.ToString();
-                        receiptCount++;
+                        if (listCheckTopic.Contains(topic) == false)
+                        {
+                            //鍔犲埌妫�娴嬩富棰樺璞′腑
+                            listCheckTopic.Add(topic);
+                        }
                     }
                 }
 
@@ -140,7 +149,7 @@
             //瓒呮椂鏃堕棿
             int TimeOut = 0;
             waitTime = 20 * waitTime;
-            while (receiptCount != listReceiptTopic.Count && TimeOut < waitTime)
+            while (listCheckTopic.Count != listReceiptTopic.Count && TimeOut < waitTime)
             {
                 //鍏ㄩ儴鎺ユ敹鎵嶉��鍑�
                 System.Threading.Thread.Sleep(50);
@@ -148,7 +157,7 @@
             }
             myGateway.Actions -= receiptAction;
             receiptAction = null;
-            if (receiptCount != listReceiptTopic.Count)
+            if (listCheckTopic.Count != listReceiptTopic.Count)
             {
                 reResult.ErrorMsgDiv = 0;
             }

--
Gitblit v1.8.0