From 587c36e27131f2d028fcabc13b296a8de7470034 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 08 一月 2020 08:59:19 +0800
Subject: [PATCH] 2019.1.8
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs | 61 ++++++++++++++++--------------
1 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
index c9dd905..776aac3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs
@@ -18,50 +18,47 @@
public static void DoUpdateNextFirmware()
{
//涓嬩竴涓鎵ц鏇存柊鐨勭綉鍏�
- GatewayFirmwareUpdateControl gwControl = null;
- foreach (var contr in FirmwareUpdateResourse.dicGatewayUpdateList.Values)
+ HdlDeviceUpdateCommonLogic gwControl = null;
+ //涓嬩竴涓鎵ц鏇存柊鐨勮澶�
+ HdlDeviceUpdateCommonLogic deviceControl = null;
+ foreach (var contr in FirmwareUpdateResourse.dicUpdateList.Values)
{
//濡傛灉鍒殑杩樺湪鍗囩骇涓�,鍒欎笉鍐嶅鐞�
if (contr.IsFinishUpdate == false)
{
return;
}
- //濡傛灉杩欎釜缃戝叧鏄湪绛夊緟鍒楄〃鐨勮瘽
+ //濡傛灉杩欎釜鍦ㄧ瓑寰呭垪琛ㄧ殑璇�
if (contr.UpdateStatu == UpdateStatuMode.Wait && gwControl == null)
{
- //涓嬩竴涓崌绾х殑灏辨槸瀹冧簡
- gwControl = contr;
+ if (contr.ClassDiv == 1 && gwControl == null)
+ {
+ //涓嬩竴涓崌绾х殑灏辨槸瀹冧簡
+ gwControl = contr;
+ }
+ else if (contr.ClassDiv == 2 && deviceControl == null)
+ {
+ //涓嬩竴涓崌绾х殑灏辨槸瀹冧簡
+ deviceControl = contr;
+ }
}
}
- HdlDeviceUpdateLogic deviceControl = null;
- foreach (var contr in FirmwareUpdateResourse.dicDeviceUpdateList.Values)
+ HdlThreadLogic.Current.RunThread(() =>
{
- //濡傛灉鍒殑杩樺湪鍗囩骇涓�,鍒欎笉鍐嶅鐞�
- if (contr.IsFinishUpdate == false)
+ if (gwControl != null)
{
+ //寮�濮嬫墽琛屾洿鏂版搷浣�
+ gwControl.DoStartUpdate();
return;
}
- //濡傛灉杩欎釜璁惧鏄湪绛夊緟鍒楄〃鐨勮瘽
- if (contr.UpdateStatu == UpdateStatuMode.Wait && deviceControl == null)
+
+ if (deviceControl != null)
{
- //涓嬩竴涓崌绾х殑灏辨槸瀹冧簡
- deviceControl = contr;
+ //寮�濮嬫墽琛屾洿鏂版搷浣�
+ deviceControl.DoStartUpdate();
}
- }
-
- if (gwControl != null)
- {
- //寮�濮嬫墽琛屾洿鏂版搷浣�
- gwControl.DoStartUpdate();
- return;
- }
-
- if (deviceControl != null)
- {
- //寮�濮嬫墽琛屾洿鏂版搷浣�
- deviceControl.DoStartUpdate();
- }
+ });
}
#endregion
@@ -136,8 +133,9 @@
/// <returns></returns>
private async static Task<bool> GetFirmwareVersionAndSetToMemmory(FirmwareLevelType levelType, GetFirmwareVersionPra pra)
{
- string resultValue = await UserCenterLogic.GetResponseDataByRequestHttps("FirmwareMana/DetectionPlatformUploadFirmware", false, pra);
- if (resultValue == null)
+ var listNotShow = new List<string>() { "NotSetAgain" };
+ string resultValue = await UserCenterLogic.GetResponseDataByRequestHttps("FirmwareMana/DetectionPlatformUploadFirmware", false, pra, listNotShow);
+ if (string.IsNullOrEmpty(resultValue) == true)
{
return false;
}
@@ -215,6 +213,11 @@
FirmwareVersionInfo newFirInfo = null;
foreach (var verInfo in listdata)
{
+ if (verInfo.Name.EndsWith(".bin") == true)
+ {
+ //瀹冧笉鏄崌绾у浐浠�, .bin鏄壒娈婄殑
+ continue;
+ }
if (verInfo.FirmwareVersion > nowVersion)
{
nowVersion = verInfo.FirmwareVersion;
--
Gitblit v1.8.0