Exemple #1
0
        // Here we will switch based on the router
        private void SetupAccessPoints()
        {
            bool bSameSSID = false;

            APConfigs = new List <APConfig>();

            APConfigs.Add(WlanAccessPointHelper.CreateWirelessAccessPoint(
                              m_AP1Config24GHz.Auth, m_AP1Config24GHz.Cipher, m_AP1Config24GHz.Phy, "TestPassphrase2",
                              m_AP1Config5GHz.Auth, m_AP1Config5GHz.Cipher, m_AP1Config5GHz.Phy, "TestPassphrase1"));

            if (m_ScanTestOptions.HasFlag(SCAN_TEST_OPTIONS.DuplicateSSIDs))
            {
                // Both APs should have same SSID
                APConfigs.Add(WlanAccessPointHelper.DuplicateAPForRoaming(APConfigs[0]));
                bSameSSID = true;
            }
            else
            {
                APConfigs.Add(WlanAccessPointHelper.CreateWirelessAccessPoint(
                                  m_AP2Config24GHz.Auth, m_AP2Config24GHz.Cipher, m_AP2Config24GHz.Phy, "TestPassphrase2",
                                  m_AP2Config5GHz.Auth, m_AP2Config5GHz.Cipher, m_AP2Config5GHz.Phy, "TestPassphrase1"));
            }

            APConfigs[1].BSSID_24GHZ = WlanAccessPointHelper.GenerateBSSID();
            APConfigs[1].BSSID_5GHZ  = WlanAccessPointHelper.GenerateBSSID();

            APConfigs[0].RadioChannel24Ghz = m_AP1Config24GHz.Channel;
            APConfigs[0].RadioChannel5Ghz  = m_AP1Config5GHz.Channel;

            APConfigs[1].RadioChannel24Ghz = m_AP2Config24GHz.Channel;
            APConfigs[1].RadioChannel5Ghz  = m_AP2Config5GHz.Channel;

            APConfigs[0].BeaconEnabled_24GHZ = !m_AP1Config24GHz.IsHidden;
            APConfigs[0].BeaconEnabled_5GHZ  = !m_AP1Config5GHz.IsHidden;
            APConfigs[1].BeaconEnabled_24GHZ = !m_AP2Config24GHz.IsHidden;
            APConfigs[1].BeaconEnabled_5GHZ  = !m_AP2Config5GHz.IsHidden;

            // For the same SSID case, we want the APs to be configured with the specific SSID
            if (bSameSSID)
            {
                APConfigs[0].SmartCompare = false;
                APConfigs[1].SmartCompare = false;
            }

            Guid[] routerList = new Guid[2];
            routerList[0] = routers[0];
            routerList[1] = routers[1];

            Collection <ConfiguredSSIDs> configuredSSIDs = new Collection <ConfiguredSSIDs>();

            LogMajor("Configuring Router0");
            LogMajor("Configuring Router1");

            APConfig[] apConfigArray = new APConfig[APConfigs.Count];
            for (int index = 0; index < APConfigs.Count; index++)
            {
                apConfigArray[index] = APConfigs[index];
            }

            AC.ApplyConfigurationParallel(routerList, apConfigArray, out configuredSSIDs);

            if (!bSameSSID)
            {
                APConfigs[0].SSID_24GHZ = configuredSSIDs[0].TwoPoint4GhzSSID;
                APConfigs[0].SSID_5GHZ  = configuredSSIDs[0].FiveghzSSID;
                APConfigs[1].SSID_24GHZ = configuredSSIDs[1].TwoPoint4GhzSSID;
                APConfigs[1].SSID_5GHZ  = configuredSSIDs[1].FiveghzSSID;
            }

            LogMajor("Configured Router0 SSID:" + APConfigs[0].SSID_24GHZ + "/" + APConfigs[0].SSID_5GHZ);
            LogMajor("Configured Router1 SSID:" + APConfigs[1].SSID_24GHZ + "/" + APConfigs[1].SSID_5GHZ);


            Log("Reading the BSSIDs configured on router for validation when connected");
            for (int i = 0; i < 2; i++)
            {
                APConfigs[i].BSSID_24GHZ = AC.GetAccessPointBSSID(routers[i], false);
                LogMajor("BSSID(" + APConfigs[i].SSID_24GHZ + ") = " + APConfigs[i].BSSID_24GHZ);
                LogMajor("Authentication(" + APConfigs[i].SSID_24GHZ + ") = " + APConfigs[i].Authentication_24GHZ.ProfileValue);
                LogMajor("Encryption(" + APConfigs[i].SSID_24GHZ + ") = " + APConfigs[i].Encryption_24GHZ.ProfileValue);
                LogMajor("Phy(" + APConfigs[i].SSID_24GHZ + ") = " + APConfigs[i].PhyType_24GHZ.ProfileValue);
                LogMajor("Channel(" + APConfigs[i].SSID_24GHZ + ") = " + APConfigs[i].RadioChannel24Ghz);
                LogMajor("Hidden(" + APConfigs[i].SSID_24GHZ + ") = " + ((APConfigs[i].BeaconEnabled_24GHZ == false) ? "Yes" : "No"));

                APConfigs[i].BSSID_5GHZ = AC.GetAccessPointBSSID(routers[i], true);
                LogMajor("BSSID(" + APConfigs[i].SSID_5GHZ + ")= " + APConfigs[i].BSSID_5GHZ);
                LogMajor("AuthenticationMethod(" + APConfigs[i].SSID_5GHZ + ") = " + APConfigs[i].Authentication_5GHZ.ProfileValue);
                LogMajor("Encryption(" + APConfigs[i].SSID_5GHZ + ") = " + APConfigs[i].Encryption_5GHZ.ProfileValue);
                LogMajor("Phy(" + APConfigs[i].SSID_5GHZ + ") = " + APConfigs[i].PhyType_5GHZ.ProfileValue);
                LogMajor("Channel(" + APConfigs[i].SSID_5GHZ + ") = " + APConfigs[i].RadioChannel5Ghz);
                LogMajor("Hidden(" + APConfigs[i].SSID_5GHZ + ") = " + ((APConfigs[i].BeaconEnabled_5GHZ == false) ? "Yes" : "No"));
            }
        }