黄学彪
2019-11-25 160785587667cc0d927f85e44c139ec9dde13a9e
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs
@@ -149,13 +149,15 @@
                        return;
                    }
                    //让网关允许入网
                    this.realGateway.AddNewDeviceToGateway(255);
                    this.realGateway.AddNewDeviceToGateway(180);
                    System.Threading.Thread.Sleep(1000);
                }
            });
            //添加监视设备新上报的事件
            this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
            //开启连接的假想动画效果线程
            this.StartConcetionAnimeteThread();
        }
        #endregion
@@ -339,9 +341,17 @@
            HdlThreadLogic.Current.RunThread(() =>
            {
                int index = 1;
                int timeCount = 0;
                while (this.Parent != null)
                {
                    System.Threading.Thread.Sleep(500);
                    timeCount++;
                    if (timeCount >= 240)
                    {
                        //120秒后,再次发送网关设备入网命令
                        this.realGateway.AddNewDeviceToGateway(180);
                        timeCount = 0;
                    }
                    Application.RunOnMainThread(() =>
                    {
                        if (btnRound != null)
@@ -517,9 +527,8 @@
        /// <summary>
        /// 画面关闭
        /// </summary>
        public override void CloseForm()
        public override void CloseFormBefore()
        {
            base.CloseForm();
            //停止接收
            this.realGateway.GwResDataAction -= this.AdjustGatewayResultData;
@@ -529,6 +538,7 @@
                //关闭入网模式
                this.realGateway.AddNewDeviceToGateway(0);
            });
            base.CloseFormBefore();
        }
        #endregion