| | |
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //清空全部列表
|
| | | HdlGatewayLogic.Current.ClearAllRealGateway();
|
| | | HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
|
| | | ZigBee.Common.Application.IsSearchingGateway = true;
|
| | |
|
| | | int index = 1;
|
| | |
| | | if (timeCount == 10)
|
| | | {
|
| | | //5秒后清空网关列表
|
| | | HdlGatewayLogic.Current.ClearAllRealGateway();
|
| | | HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
|
| | | ZigBee.Common.Application.IsSearchingGateway = true;
|
| | | }
|
| | | if (timeCount % 2 == 0)
|
| | |
| | | private void StartCheckGatewayThread()
|
| | | {
|
| | | this.isGatewaySearching = true;
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | int count = 0;
|
| | | while (this.Parent != null && this.isGatewaySearching == true)
|
| | |
| | | }
|
| | | count = 0;
|
| | |
|
| | | await this.CheckZbGatewayAndSetRow();
|
| | | this.CheckZbGatewayAndSetRow();
|
| | |
|
| | | if (this.newGatewayGetting == true)
|
| | | {
|
| | |
| | | /// <summary>
|
| | | /// 检测搜索到的网关
|
| | | /// </summary>
|
| | | private async Task<bool> CheckZbGatewayAndSetRow()
|
| | | private bool CheckZbGatewayAndSetRow()
|
| | | {
|
| | | for (int i = 0; i < ZbGateway.GateWayList.Count; i++)
|
| | | {
|
| | |
| | | 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;
|