From c7df85937f73fb347ee0b19e9c052d2d00a6df6c Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 18 九月 2020 13:58:19 +0800 Subject: [PATCH] 新版本 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlWifiLogic.cs index 1f3fe59..c7bc442 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) { -- Gitblit v1.8.0