| | |
| | | {
|
| | | 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;
|
| | |
| | | count--;
|
| | | }
|
| | | //移除事件
|
| | | HdlDeviceImageInfoLogic.Current.RemoveDeviceFirmwareVersionThread(otaDevice);
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("HdlDeviceUpdate");
|
| | |
|
| | | //设置进度值直接为100%
|
| | | this.ProgressEvent?.Invoke(100);
|