| | |
| | | } |
| | | var visionString = Encoding.GetEncoding ("gb2312").GetString (bytes); |
| | | |
| | | |
| | | int result = -99; |
| | | |
| | | |
| | | if (visionString.Contains("Ind_V03.01U_2021/07/12")) { |
| | | if (visionString.Contains ("Ind_C03.02U_2022/06/22")) { |
| | | Application.RunOnMainThread (() => { |
| | | btnTipMsg.Text = "Gateway firmware has been upgraded, initializing gateway."; |
| | | btnTipMsg.TextColor = SkinStyle.Current.TextColor; |
| | | }); |
| | | result = 100; |
| | | } else if (!visionString.Contains ("Ind_V02.35U_2019/06/25")) {//目前只允许升级这个固件的网关 |
| | | Application.RunOnMainThread (() => { |
| | | btnTipTitle.Text = "The gateway does not support automatic migration. Please contact technical support."; |
| | | btnTipTitle.Height = Application.GetRealHeight (150); |
| | | btnTipTitle.TextColor = SkinStyle.Current.DelColor; |
| | | btnTipMsg.Text = ""; |
| | | etPwd.Visible = false; |
| | | loading.Hide (); |
| | | btnSave.Visible = false; |
| | | btnClose.Width = Application.GetRealWidth (500); |
| | | }); |
| | | return; |
| | | } else { |
| | | Application.RunOnMainThread (() => { |
| | | btnTipMsg.Text = "Upgrading gateway."; |
| | |
| | | btnTipMsg.Text = "Gateway upgrade succeeded. Initializing gateway."; |
| | | btnTipMsg.TextColor = SkinStyle.Current.TextColor; |
| | | }); |
| | | //初始化标记 |
| | | MainPage.GatewayStatus = ""; |
| | | break; |
| | | } |
| | | else { |
| | | } else { |
| | | if (upgradeData.Count >= result) { |
| | | var listPack = upgradeData [result-1];// |
| | | byte [] packData = new byte [2 + listPack.Count]; |
| | |
| | | if (MainPage.GatewayStatus != "Initialization_complete") { |
| | | System.Threading.Thread.Sleep (100); |
| | | } else if (initiaIndex == 0) { |
| | | //初始化标记 |
| | | MainPage.GatewayStatus = ""; |
| | | Application.RunOnMainThread (() => { |
| | | btnTipMsg.Text = "Successfully initialized the gateway. Opening the gateway remote configuration."; |
| | | btnTipMsg.TextColor = SkinStyle.Current.TextColor; |