黄学彪
2020-11-19 9ef48d7b2da7c408b53f73be0f6eef3cbac1c84a
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;
            }