From fef8136ca77f03dc4fb8988da94dcaf9dcabc9e0 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 22 四月 2020 19:09:54 +0800
Subject: [PATCH] 2020-04-22 1.增加远程连接过程提示,请求参数合并到一个接口。

---
 Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs b/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
index 2a1d2e1..df7ec49 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
@@ -27,7 +27,7 @@
             if (mFlagDateTime.AddSeconds (20).Ticks <= System.DateTime.Now.Ticks) {
                 mFlagDateTime = DateTime.Now;
                 if (isConnectiong) {
-                    Console.WriteLine ("20s銆媔sConnectiong true ");
+                    Utlis.WriteLine ("20s銆媔sConnectiong true ");
                     isConnectiong = false;
                 }
             }
@@ -111,6 +111,9 @@
                                     if (status == 2) {
                                         //var result = Control.ControlBytesSendHasReturn (Command.ReadGateway, common.SubnetID, common.DeviceID, new byte [] { (byte)new Random ().Next (255), (byte)new Random ().Next (255) });
                                         #region
+                                        //寮�濮嬫湰鍦版悳绱㈢綉鍏�...
+                                        MainPage.AddTip ("Searching local gateway...");
+
                                         var control = new Control ();
                                         control.Send (new Target () {
                                             IPEndPoint = new System.Net.IPEndPoint (System.Net.IPAddress.Parse (new Net.NetWiFi ().BroadcastIpAddress.ToString ()), 6000),
@@ -133,10 +136,19 @@
                                                     UserMiddle.btnLinkStatus.UnSelectedImagePath = MainPage.WiFiStatus;
                                                     MainPage.Loading.Hide ();
                                                 });
+                                                //鎼滅储鎴愬姛锛屽惎鐢ㄦ湰鍦拌繛鎺�
+                                                MainPage.AddTip ("Gateway searched successfully, enable local connection.");
+
                                                 Shared.SimpleControl.Phone.UserMiddle.ReadAllDeviceStatus ();
                                                 await SmartHome.MqttCommon.DisConnectRemoteMqttClient ();
                                                 return;
+                                            } else {
+
                                             }
+                                        } else {
+                                            //鎼滅储澶辫触锛屽惎鐢ㄨ繙绋嬭繛鎺�
+                                            MainPage.AddTip ("Gateway not found, enable remote connection.");
+                                            
                                         }
                                     } else {
                                         break;
@@ -153,6 +165,8 @@
                                 if (UserConfig.Instance.CheckHomeGateways ()) {
                                     if (!string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.HomeGateways [0].GatewayUniqueId)) {
                                         // 5.1鑳借繙绋�,鏄剧ずCloudUnlink鐘舵�侊紝IsRemote璁句负true寮�濮嬭繙绋�
+                                        MainPage.AddTip ("Starting remote connection mode...");
+
                                         Utlis.ShowAppLinkStatus (AppLinkStatus.CloudUnlink);
                                         CommonPage.IsRemote = true;
                                         SmartHome.MqttCommon.IsGatewayOnline = false;
@@ -178,7 +192,7 @@
                         }
                     }
                 } catch (Exception ex) {
-                    Console.WriteLine ("CheckLinkRemote : " + ex.ToString ());
+                    Utlis.WriteLine ("CheckLinkRemote : " + ex.ToString ());
                 } finally {
                     isConnectiong = false;
                     Application.RunOnMainThread (() => {

--
Gitblit v1.8.0