黄学彪
2019-11-04 c7698e163e43cea9e7f8ee45f8e3f91c9265cca4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs
@@ -19,6 +19,7 @@
        /// <para> 0:更新状态正常变化,后面的值为状态变更的文本翻译</para>
        /// <para> 1:升级成功</para>
        /// <para> 2:主动终止升级</para>
        /// <para> 3:从等待中取消(目前还没有用)</para>
        /// </summary>
        public Action<int, string> UpdateStatuChangedEvent = null;
        /// <summary>
@@ -92,7 +93,9 @@
                {
                    FirmwareUpdateResourse.dicDeviceUpdateList.Remove(otaDevice.DeviceAddr);
                }
                //取消
                this.UpdateStatu = UpdateStatuMode.None;
                this.UpdateStatuChangedEvent?.Invoke(3, "");
                return;
            }
            //如果它有状态,则表示之前它被什么错误中断了
@@ -382,12 +385,11 @@
            {
                this.zbGateway.ReportAction -= this.UpdateDeviceProgress;
                new System.Threading.Thread(async () =>
                HdlThreadLogic.Current.RunThread(async () =>
                {
                    //终止升级
                    await this.otaDevice.KillUpdateAsync(this.zbGateway, 200);
                })
                { IsBackground = true }.Start();
                });
                this.UpdateStatu = UpdateStatuMode.DeviceUpdateFail;
                return;
@@ -556,7 +558,7 @@
            //升级成功
            this.UpdateStatu = UpdateStatuMode.UpdateSuccess;
            new System.Threading.Thread(() =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                System.Threading.Thread.Sleep(3000);
@@ -592,8 +594,7 @@
                    //设备升级成功!
                    this.UpdateStatuChangedEvent?.Invoke(1, Language.StringByID(R.MyInternationalizationString.uDeviceUpdateSuccess));
                });
            })
            { IsBackground = true }.Start();
            });
        }
        #endregion
@@ -636,7 +637,7 @@
        private void StartDownLoadTimeOutThread()
        {
            this.downLoadTimeOutCount = 30;
            new System.Threading.Thread(() =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                while (true)
                {
@@ -665,8 +666,7 @@
                        break;
                    }
                }
            })
            { IsBackground = true }.Start();
            });
        }
        /// <summary>
@@ -691,7 +691,7 @@
        private void StartUpdateTimeOutThread()
        {
            this.UpdateTimeOutCount = 60;
            new System.Threading.Thread(() =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                while (true)
                {
@@ -719,8 +719,7 @@
                        break;
                    }
                }
            })
            { IsBackground = true }.Start();
            });
        }
        /// <summary>