From ec34983e291d1c85284472a27109d55891f9a6b5 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 07 八月 2020 16:20:16 +0800
Subject: [PATCH] 不是新代码,别 合并

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
old mode 100755
new mode 100644
index 37fe00a..9fadede
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs
@@ -164,6 +164,10 @@
         /// 鍙樻洿缃戠粶鏃剁殑浜嬩欢
         /// </summary>
         private string changedNetworkTime = string.Empty;
+        /// <summary>
+        /// 褰撳墠 wifi 鐨�
+        /// </summary>
+        private string oldSsid = string.Empty;
 
         #endregion
 
@@ -373,9 +377,24 @@
         /// 鐩戝惉瀹夊崜缃戠粶鍙樺寲
         /// </summary>
         /// <param name="value">0:娌℃湁缃戠粶 1:4G  2:wifi</param>
-        private void NetworkStateChanged(int value)
+        public void NetworkStateChanged(int value)
         {
-            //娌℃湁缃戠粶
+            if(Common.Config.Instance.HomeId==string.Empty)
+            {
+                //鍦ㄧ櫥褰曠晫闈笉澶勭悊
+                return;
+            }
+#if iOS
+            var nowSsid = this.SSID;
+            if (this.oldSsid == nowSsid)
+            {
+                //濡傛灉褰撳墠 wifi 鐨勫悕瀛椾竴鏍凤紝鍒欎笉澶勭悊
+                return;
+            }
+            this.oldSsid = nowSsid;
+#endif
+
+            //娌℃湁缃戠粶
             if (value == 0)
             {
                 this.CanAccessHttp = false;
@@ -411,11 +430,14 @@
                     }
                     //閲嶆柊鍒濆鍖朣ocket
                     ZigBee.Common.Application.FindGateWaySocket.Stop();
+                    System.Threading.Thread.Sleep(100);
+
                     //鏂帀鏈湴杩炴帴
-                    HdlGatewayLogic.Current.ClearAllRealGateway();
+                    HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                     //鏂帀杩滅▼
                     ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
 
+                    //濡傛灉鏄痺ifi
                     if (value == 2)
                     {
                         ZigBee.Common.Application.FindGateWaySocket.Start();

--
Gitblit v1.8.0