Cannot connect to powered off APs

This commit is contained in:
Tim Young 2017-03-11 11:07:01 +03:00
parent 4500416364
commit 0b3213bf67
3 changed files with 11 additions and 1 deletions

View File

@ -1350,6 +1350,7 @@ namespace EduNetworkBuilder
if(NB.GetComponentType(nc) == GeneralComponentType.device)
{
checking = (NetworkDevice)nc;
if (checking.PowerOff) continue; //we cannot connect to a powered-off device
if (checking == starting) continue;
answer = checking.HasWPortSSIDKey(start.SSID, start.EncryptionKey);
if(answer != null)

View File

@ -694,6 +694,7 @@ namespace EduNetworkBuilder
if (ItemClickedOn != null)
{
ItemClickedOn.PowerOff = false;
UpdateLinks();
UpdateVisuals();
}
}
@ -703,6 +704,7 @@ namespace EduNetworkBuilder
if (ItemClickedOn != null)
{
ItemClickedOn.PowerOff = true;
UpdateLinks();
UpdateVisuals();
}
}

View File

@ -806,7 +806,7 @@ namespace EduNetworkBuilder
tryit = true;
if(!tryit)
{
//Check distance
//Check distance and power for AP
NetworkComponent nc = myNet.GetComponentFromID(nic.ConnectedLink);
if(nc != null)
{
@ -814,6 +814,13 @@ namespace EduNetworkBuilder
double distance = nl.LinkDistance();
if (distance > NB.WirelessReconnectDistance)
tryit = true;
//Make sure the far end is powered on
HostNicID EndPoint = nl.Dst;
if (nic.myID.HostID == EndPoint.HostID) EndPoint = nl.Src;
NetworkDevice End = myNet.GetDeviceFromID(EndPoint);
if (End != null && End.PowerOff)
tryit = true;
}
}
//Tryit tells us if we should try to reconnect.