public bool bValidateGHZRadioAssociation(int APIndex, string expectedBssid) { string associatedWith = Helpers.GetBSSID(m_WlanApi, m_TestInterface); if (associatedWith == expectedBssid) { Log("Associated with Router " + APIndex + " having bssid " + expectedBssid + " as expected"); return(true); } LogError("Not associated with Router " + APIndex + " having bssid " + expectedBssid + ". Assoicated with " + associatedWith); return(false); }
public bool bValidateGHZRadioAssociation(int APIndex, string expectedBssid) { for (int i = 0; i < 4; i++) { string associatedWith = Helpers.GetBSSID(Api, TestInterface); if (associatedWith == expectedBssid) { Log("bValidateGHZRadioAssociation Associated with Radio " + APIndex + " having bssid " + expectedBssid + " as expected"); return(true); } Log("bValidateGHZRadioAssociation Not associated with Radio " + APIndex + " having bssid " + expectedBssid + ". Assoicated with" + associatedWith + ". Will Retry to account for propogation issues"); Wlan.Sleep(500); } LogError("bValidateGHZRadioAssociation Giving up. Not associated with Radio " + APIndex + " having bssid " + expectedBssid); return(false); }
public void GradualLossOfSignal(bool b5Ghz) { LogMajor("Scenario - Gradual loss of signal starts"); LogMajor("Resetting Wlan Adaptor"); ToggleAdapter(); SetupRoutersAndProfilesIfNeeded(); string profilename = null; if (b5Ghz) { profilename = APConfigs[0].SSID_5GHZ; } else { profilename = APConfigs[0].SSID_24GHZ; } LogMajor("Testing Roaming with router " + profilename); LogMajor("Turning Router 0 on"); if (!SetRadioState(0, true, b5Ghz)) { return; } LogMajor("Turning Router 1 on"); if (!SetRadioState(1, true, b5Ghz)) { return; } LogMajor("Calling WlanConnect using a Wlan Profile " + profilename); if (!ConnectToAP(profilename)) { return; } LogMajor("Making a TCP connection to Echo Services"); if (!ConnectToEchoServer()) { return; } LogMajor("Turning Router 0 on"); if (!SetRadioState(0, true, b5Ghz)) { return; } LogMajor("Turning Router 1 on"); if (!SetRadioState(1, true, b5Ghz)) { return; } for (int power0 = 84, power1 = 4; power0 >= 4 && power1 <= 84;) { if (power0 < 4) { power0 = 4; } if (power1 > 84) { power1 = 84; } if (power0 == 4) { LogMajor("Turning Router 0 off"); if (!SetRadioState(0, false, b5Ghz)) { return; } } LogMajor("Setting txPower on Router 0 to " + power0); SetRadioPower(0, power0, b5Ghz); LogMajor("Setting txPower on Router 1 to " + power1); SetRadioPower(1, power1, b5Ghz); Wlan.Sleep(500); LogMajor("Currently Associated with " + Helpers.GetBSSID(Api, TestInterface)); LogMajor("Ensuring echo Network session is alive and functional by performing echo"); PerformEcho(); power0 -= 10; power1 += 10; Wlan.Sleep(500); } LogMajor("Scenario - Sudden loss of signal ends"); }
public void SuddenDropOfSignal(bool b5Ghz) { LogMajor("Starting - Scenario Sudden Drop of Signal"); LogMajor("Resetting Wlan Adaptor"); ToggleAdapter(); SetupRoutersAndProfilesIfNeeded(); string profilename = null; if (b5Ghz) { profilename = APConfigs[0].SSID_5GHZ; } else { profilename = APConfigs[0].SSID_24GHZ; } LogMajor("Testing Roaming with router " + profilename); LogMajor("Turning Router 0 on"); if (!SetRadioState(0, true, b5Ghz)) { return; } LogMajor("Turning Router 1 on"); if (!SetRadioState(1, true, b5Ghz)) { return; } LogMajor("Calling WlanConnect using a Wlan Profile " + profilename); if (!ConnectToAP(profilename)) { return; } LogMajor("Turning Router 0 on"); if (!SetRadioState(0, true, b5Ghz)) { return; } LogMajor("Turning Router 1 off"); if (!SetRadioState(1, false, b5Ghz)) { return; } LogMajor("Setting txPower on Router 0 to 84"); SetRadioPower(0, 84, b5Ghz); LogMajor("Setting txPower on Router 1 to 84"); SetRadioPower(1, 84, b5Ghz); LogMajor("Making a TCP connection to Echo Services"); if (!ConnectToEchoServer()) { return; } Log("Ensuring echo Network session is alive and functional"); PerformEcho(); LogMajor("Turning Router 1 on"); if (!SetRadioState(1, true, b5Ghz)) { return; } LogMajor("Turning Router 0 off"); if (!SetRadioState(0, false, b5Ghz)) { return; } LogMajor("Currently associated with " + Helpers.GetBSSID(Api, TestInterface)); LogMajor("Ensuring echo Network session is alive and functional by performing echo"); PerformEcho(); LogMajor("Ensuring associated with AP 1"); if (!ValidateRadioAssociation(1, b5Ghz)) { return; } LogMajor("Turning Router 1 on"); if (!SetRadioState(0, true, b5Ghz)) { return; } LogMajor("Turning Router 1 on"); if (!SetRadioState(1, true, b5Ghz)) { return; } LogMajor("Currently associated with " + Helpers.GetBSSID(Api, TestInterface)); LogMajor("Ensuring echo Network session is alive and functiona by performing echol"); PerformEcho(); LogMajor("Setting txPower on Router 0 to 84"); SetRadioPower(0, 84, b5Ghz); LogMajor("Setting txPower on Router 1 to 4"); SetRadioPower(1, 4, b5Ghz); LogMajor("Currently associated with " + Helpers.GetBSSID(Api, TestInterface)); LogMajor("Ensuring echo Network session is alive and functional by performing echo"); PerformEcho(); LogMajor("Scenario - Sudden drop of signal ends"); }