From 9ef48d7b2da7c408b53f73be0f6eef3cbac1c84a Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 19 十一月 2020 10:23:45 +0800 Subject: [PATCH] Evoyo.Home1.1.0120111601_Release --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs index 1f3fe59..2b14197 100755 --- 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 @@ -181,6 +185,7 @@ tcpClient = new System.Net.Sockets.TcpClient(); tcpClient.Connect("192.168.8.1", 5000); networkStream = tcpClient.GetStream(); + networkStream.ReadTimeout = 1000; //鍔犲瘑鏁版嵁 string sendDataMsg = "hdl1985."; string DefaultdesKey = "hdl1985."; @@ -373,8 +378,23 @@ /// 鐩戝惉瀹夊崜缃戠粶鍙樺寲 /// </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 鐨勫悕瀛椾竴鏍凤紝鍒欎笉澶勭悊 + ZigBee.Common.Application.FindGateWaySocket.Start(); + return; + } + this.oldSsid = nowSsid; +#endif //娌℃湁缃戠粶 if (value == 0) { @@ -416,7 +436,7 @@ //鏂帀鏈湴杩炴帴 HdlGatewayLogic.Current.ClearAllRealGatewayConection(true); //鏂帀杩滅▼ - ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient(); + ZigBee.Device.ZbGateway.CloseRemoteConnectionOnForce(); //濡傛灉鏄痺ifi if (value == 2) -- Gitblit v1.8.0