黄学彪
2020-09-23 c0ce2f57a4f836ebeb9e7b8b4b5a4407fd78dc86
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewaySearchForm.cs
@@ -292,10 +292,10 @@
        private void StartCheckGatewayThread()
        {
            this.isGatewaySearching = true;
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                //清空全部列表
                HdlGatewayLogic.Current.ClearAllRealGateway();
                HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                ZigBee.Common.Application.IsSearchingGateway = true;
                int count = 0;
@@ -311,7 +311,7 @@
                    }
                    count = 0;
                    await this.CheckZbGatewayAndSetRow();
                    this.CheckZbGatewayAndSetRow();
                    if (this.newGatewayGetting == true)
                    {
@@ -325,7 +325,7 @@
        /// <summary>
        /// 检测搜索到的网关,然后添加到画面的行里面
        /// </summary>
        private async Task<bool> CheckZbGatewayAndSetRow()
        private bool CheckZbGatewayAndSetRow()
        {
            List<string> listId = new List<string>();
            for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
@@ -358,8 +358,9 @@
            for (int i = 0; i < listId.Count; i++)
            {
                ZbGateway way = ZbGateway.GateWayList.Find((obj) => obj.GwId == listId[i]);
                if (way == null)
                if (way == null || way.localIsConnected == false)
                {
                    //2020.09.18 本地连接没有连接上,则不处理
                    continue;
                }
@@ -389,7 +390,7 @@
                if (mode == GatewayBindMode.First || mode == GatewayBindMode.Binded)
                {
                    //添加搜索到的网关到缓存(执行网关保存操作)
                    var result = await HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    var result = HdlGatewayLogic.Current.AddNewGateway(way, ShowErrorMode.NO);
                    if (result == false)
                    {
                        continue;