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 |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs b/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
index 684043f..2daf543 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
@@ -18,6 +18,7 @@
         public static string FindGatewayChilrenIPAddress = new Net.NetWiFi ().BroadcastIpAddress.ToString ();
         public static bool LocalPhoneFindDevice = false;
         public static int searchTotal = 0;
+        public static int newDevice = 0;
         private static string ip="0.0.0.0";
         public static System.Net.IPEndPoint EndPoint {
             get {
@@ -97,6 +98,34 @@
             try {
                 List<byte> ButtonBkeyModelList = new List<byte> ();
                 switch (command) {
+                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;
+                case Command.enjoyUpgradeACK://杩涘叆鍗囩骇妯″紡锛屽崌绾у嵃搴︾綉鍏筹紝2022-05-30 11:26:48 wxr
+                    var deviceName = MyEncodingGB2312.GetString (usefullBytes);
+                    Console.WriteLine ($"褰撳墠缃戝叧:{deviceName}");
+                    break;
+
+
                 case Command.PushtoServer_DevMsg:
 #if DEBUG
                     string pushBytesString = "PushtoServer_DevMsg : " + subnetID + "," + deviceID + ",";
@@ -954,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