黄学彪
2020-09-18 c7df85937f73fb347ee0b19e9c052d2d00a6df6c
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)
            {