From bd68f0a389e4e47b108749afea26a4eb5418e31b Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 09 六月 2022 11:07:04 +0800
Subject: [PATCH] 平台迁移功能,手动升级功能

---
 Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs b/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
index 7ba7fa6..2daf543 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
@@ -98,7 +98,25 @@
             try {
                 List<byte> ButtonBkeyModelList = new List<byte> ();
                 switch (command) {
-                case Command.readGatewayVision:
+                case Command.InitializationGatewayACK:
+                    if (usefullBytes.Length == 4) {
+                        if (usefullBytes [0] == 0xF8 && usefullBytes [3] == 0) {
+                            MainPage.GatewayStatus = "Initialization_complete";//鍒濆鍖栧畬鎴�
+                        }
+                    }
+                    break;
+                case Command.enjoyUpgrade2ACK:
+                    if (usefullBytes.Length > 1) {
+                        if(usefullBytes [0] == 0xF8 && usefullBytes [1] == 0xF8) {
+                            MainPage.GatewayStatus = "upgrade_100_success";//鍗囩骇鎴愬姛
+                        }
+                        else {
+                            MainPage.GatewayStatus = "upgrading_" + (usefullBytes [0] * 256 + usefullBytes [1])+"_"+subnetID+"_"+deviceID;//鍗囩骇涓�
+                            Console.WriteLine (MainPage.GatewayStatus);
+                        }
+                    }
+                    break;
+                case Command.readGatewayVisionACK:
                     var visionString = MyEncodingGB2312.GetString (usefullBytes);
                     Console.WriteLine ($"褰撳墠缃戝叧鐗堟湰淇℃伅:{visionString}");
                     break;
@@ -965,6 +983,9 @@
                             superWireless.WirelessPassword = MyEncodingGB2312.GetString (usefullBytes, 64, 16).Trim ('\0');
                         }
                         GateWayList.Add (superWireless);
+                        Application.RunOnMainThread (() => {
+                            GuideAddGateway.InitGatewayRowView (superWireless);
+                        });
                         //IO.FileUtils.SaveEquipmentMessage (superWireless);
                         //System.Threading.Tasks.Task.Run (() => {
                         //    if (string.IsNullOrEmpty (UserConfig.Current.RemoteModeFile)) {

--
Gitblit v1.8.0