From dee21bf452a8979d0515d13e534fbb69ed9715dd Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 01 九月 2020 15:33:13 +0800
Subject: [PATCH] 上传一个版本

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
index 0420de5..a76bb38 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
@@ -556,11 +556,22 @@
             {
                 System.Threading.Thread.Sleep(3000);
 
-                //閲嶆柊鍒锋柊缂撳瓨
-                HdlDeviceImageInfoLogic.Current.SetAllImageInfoToOtaDevice(otaDevice, (device, reportData) =>
-                {
-                    this.IsFinishUpdate = true;
-                });
+                string checkKey = Common.LocalDevice.Current.GetDeviceMainKeys(otaDevice.DeviceAddr, otaDevice.DeviceEpoint);
+                HdlGatewayReceiveLogic.Current.AddAttributeEvent("HdlDeviceUpdate" + otaDevice.DeviceAddr, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) =>
+                 {
+                     if (report.DeviceStatusReport.CluterID == (int)Cluster_ID.Ota)
+                     {
+                         string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(report.DeviceAddr, report.DeviceEpoint);
+                         if (checkKey == mainKey)
+                         {
+                            //宸茬粡鎺ユ敹寰楀埌
+                            this.IsFinishUpdate = true;
+                         }
+                     }
+                 });
+
+                //鍙戦�佸懡浠�
+                HdlDeviceImageInfoLogic.Current.SetFirmwareVersionComand(otaDevice);
 
                 System.Threading.Thread.Sleep(1500);
                 int count = 12;
@@ -572,7 +583,7 @@
                     count--;
                 }
                 //绉婚櫎浜嬩欢
-                HdlDeviceImageInfoLogic.Current.RemoveDeviceFirmwareVersionThread(otaDevice);
+                HdlGatewayReceiveLogic.Current.RemoveEvent("HdlDeviceUpdate");
 
                 //璁剧疆杩涘害鍊肩洿鎺ヤ负100%
                 this.ProgressEvent?.Invoke(100);

--
Gitblit v1.8.0