Skip to content

Commit 74fe3fd

Browse files
author
Stefano Avallone
committed
wifi: Member variables of Configuration classes can be accessed directly
1 parent 94be633 commit 74fe3fd

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

src/wifi/helper/wifi-mac-helper.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,8 @@ WifiMacHelper::Create(Ptr<WifiNetDevice> device, WifiStandard standard) const
160160
}
161161

162162
// create and install the AP EMLSR Manager if this is an EHT AP MLD with EMLSR activated
163-
if (BooleanValue emlsrActivated;
164-
standard >= WIFI_STANDARD_80211be && apMac && apMac->GetNLinks() > 1 &&
165-
device->GetEhtConfiguration()->GetAttributeFailSafe("EmlsrActivated", emlsrActivated) &&
166-
emlsrActivated.Get())
163+
if (standard >= WIFI_STANDARD_80211be && apMac && apMac->GetNLinks() > 1 &&
164+
device->GetEhtConfiguration()->m_emlsrActivated)
167165
{
168166
auto apEmlsrManager = m_apEmlsrManager.Create<ApEmlsrManager>();
169167
apMac->SetApEmlsrManager(apEmlsrManager);

src/wifi/test/inter-bss-test-suite.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -879,15 +879,15 @@ TestInterBssConstantObssPdAlgo::RunOne()
879879
Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration();
880880
if (i == 0)
881881
{
882-
heConfiguration->SetAttribute("BssColor", UintegerValue(m_bssColor1));
882+
heConfiguration->m_bssColor = m_bssColor1;
883883
}
884884
else if (i == 1)
885885
{
886-
heConfiguration->SetAttribute("BssColor", UintegerValue(m_bssColor2));
886+
heConfiguration->m_bssColor = m_bssColor2;
887887
}
888888
else
889889
{
890-
heConfiguration->SetAttribute("BssColor", UintegerValue(m_bssColor3));
890+
heConfiguration->m_bssColor = m_bssColor3;
891891
}
892892
}
893893

src/wifi/test/wifi-mlo-test.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -853,13 +853,11 @@ MultiLinkSetupTest::DoSetup()
853853
MultiLinkOperationsTestBase::DoSetup();
854854

855855
m_staMacs[0]->SetAttribute("ActiveProbing", BooleanValue(m_scanType == WifiScanType::ACTIVE));
856-
m_apMac->GetEhtConfiguration()->SetAttribute("TidToLinkMappingNegSupport",
857-
EnumValue(m_apNegSupport));
856+
m_apMac->GetEhtConfiguration()->m_tidLinkMappingSupport = m_apNegSupport;
858857
// For non-AP MLD, it does not make sense to set the negotiation type to 0 (unless the AP MLD
859858
// also advertises 0) or 1 (the AP MLD is discarded if it advertises a support of 3)
860859
auto staEhtConfig = m_staMacs[0]->GetEhtConfiguration();
861-
staEhtConfig->SetAttribute("TidToLinkMappingNegSupport",
862-
EnumValue(WifiTidToLinkMappingNegSupport::ANY_LINK_SET));
860+
staEhtConfig->m_tidLinkMappingSupport = WifiTidToLinkMappingNegSupport::ANY_LINK_SET;
863861
staEhtConfig->SetAttribute("TidToLinkMappingDl", StringValue(m_dlTidLinkMappingStr));
864862
staEhtConfig->SetAttribute("TidToLinkMappingUl", StringValue(m_ulTidLinkMappingStr));
865863

@@ -954,8 +952,7 @@ MultiLinkSetupTest::DoSetup()
954952
// are compatible
955953
for (auto staMac : m_staMacs)
956954
{
957-
staMac->GetVhtConfiguration()->SetAttribute("Support160MHzOperation",
958-
BooleanValue(m_support160MHzOp));
955+
staMac->GetVhtConfiguration()->m_160MHzSupported = m_support160MHzOp;
959956
uint8_t linkId = 0;
960957
for (const auto& str : m_staChannels)
961958
{

src/wifi/test/wifi-phy-mu-mimo-test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ TestUlMuMimoPhyTransmission::SetBssColor(Ptr<WifiPhy> phy, uint8_t bssColor)
15361536
{
15371537
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice>(phy->GetDevice());
15381538
Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration();
1539-
heConfiguration->SetAttribute("BssColor", UintegerValue(bssColor));
1539+
heConfiguration->m_bssColor = bssColor;
15401540
}
15411541

15421542
void

src/wifi/test/wifi-phy-ofdma-test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3756,7 +3756,7 @@ TestUlOfdmaPhyTransmission::SetBssColor(Ptr<WifiPhy> phy, uint8_t bssColor)
37563756
{
37573757
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice>(phy->GetDevice());
37583758
Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration();
3759-
heConfiguration->SetAttribute("BssColor", UintegerValue(bssColor));
3759+
heConfiguration->m_bssColor = bssColor;
37603760
}
37613761

37623762
void
@@ -5714,7 +5714,7 @@ TestUlOfdmaPowerControl::DoSetup()
57145714
TimeValue(MicroSeconds(1024 * 600)));
57155715
m_apDev = DynamicCast<WifiNetDevice>(wifi.Install(spectrumPhy, mac, apNode).Get(0));
57165716
NS_ASSERT(m_apDev);
5717-
m_apDev->GetHeConfiguration()->SetAttribute("BssColor", UintegerValue(m_bssColor));
5717+
m_apDev->GetHeConfiguration()->m_bssColor = m_bssColor;
57185718
m_phyAp = DynamicCast<SpectrumWifiPhy>(m_apDev->GetPhy());
57195719
NS_ASSERT(m_phyAp);
57205720
// ReceiveOkCallback of AP will be set to corresponding test's method once BA sessions have been

0 commit comments

Comments
 (0)