From c7df85937f73fb347ee0b19e9c052d2d00a6df6c Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 18 九月 2020 13:58:19 +0800
Subject: [PATCH] 新版本
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
index c44215c..a76bb38 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
@@ -204,7 +204,7 @@
return;
}
var tempZb = (ZbGateway)objValue;
- if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.zbGateway))
+ if (tempZb.GwId != this.zbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
@@ -363,7 +363,7 @@
return;
}
var tempZb = (ZbGateway)objValue;
- if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.zbGateway))
+ if (tempZb.GwId != this.zbGateway.GwId)
{
//涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊
return;
@@ -412,7 +412,7 @@
/// </summary>
/// <param name="statusData"></param>
/// <returns></returns>
- private bool CheckStatusCode(ZbGatewayData.OTAScheduleResponData statusData)
+ private bool CheckStatusCode(CommonDevice.OTAScheduleResponData statusData)
{
if (statusData == null)
{
@@ -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