From 74fe3fd974ee3b234e2a582a0f3981707b0fd8f3 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 6 Nov 2024 19:37:16 +0100 Subject: [PATCH] wifi: Member variables of Configuration classes can be accessed directly --- src/wifi/helper/wifi-mac-helper.cc | 6 ++---- src/wifi/test/inter-bss-test-suite.cc | 6 +++--- src/wifi/test/wifi-mlo-test.cc | 9 +++------ src/wifi/test/wifi-phy-mu-mimo-test.cc | 2 +- src/wifi/test/wifi-phy-ofdma-test.cc | 4 ++-- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/wifi/helper/wifi-mac-helper.cc b/src/wifi/helper/wifi-mac-helper.cc index da6648ba8..f622fab7b 100644 --- a/src/wifi/helper/wifi-mac-helper.cc +++ b/src/wifi/helper/wifi-mac-helper.cc @@ -160,10 +160,8 @@ WifiMacHelper::Create(Ptr device, WifiStandard standard) const } // create and install the AP EMLSR Manager if this is an EHT AP MLD with EMLSR activated - if (BooleanValue emlsrActivated; - standard >= WIFI_STANDARD_80211be && apMac && apMac->GetNLinks() > 1 && - device->GetEhtConfiguration()->GetAttributeFailSafe("EmlsrActivated", emlsrActivated) && - emlsrActivated.Get()) + if (standard >= WIFI_STANDARD_80211be && apMac && apMac->GetNLinks() > 1 && + device->GetEhtConfiguration()->m_emlsrActivated) { auto apEmlsrManager = m_apEmlsrManager.Create(); apMac->SetApEmlsrManager(apEmlsrManager); diff --git a/src/wifi/test/inter-bss-test-suite.cc b/src/wifi/test/inter-bss-test-suite.cc index 9c9c00b53..3aa869aad 100644 --- a/src/wifi/test/inter-bss-test-suite.cc +++ b/src/wifi/test/inter-bss-test-suite.cc @@ -879,15 +879,15 @@ TestInterBssConstantObssPdAlgo::RunOne() Ptr heConfiguration = device->GetHeConfiguration(); if (i == 0) { - heConfiguration->SetAttribute("BssColor", UintegerValue(m_bssColor1)); + heConfiguration->m_bssColor = m_bssColor1; } else if (i == 1) { - heConfiguration->SetAttribute("BssColor", UintegerValue(m_bssColor2)); + heConfiguration->m_bssColor = m_bssColor2; } else { - heConfiguration->SetAttribute("BssColor", UintegerValue(m_bssColor3)); + heConfiguration->m_bssColor = m_bssColor3; } } diff --git a/src/wifi/test/wifi-mlo-test.cc b/src/wifi/test/wifi-mlo-test.cc index 0b5a2b37f..23a14494d 100644 --- a/src/wifi/test/wifi-mlo-test.cc +++ b/src/wifi/test/wifi-mlo-test.cc @@ -853,13 +853,11 @@ MultiLinkSetupTest::DoSetup() MultiLinkOperationsTestBase::DoSetup(); m_staMacs[0]->SetAttribute("ActiveProbing", BooleanValue(m_scanType == WifiScanType::ACTIVE)); - m_apMac->GetEhtConfiguration()->SetAttribute("TidToLinkMappingNegSupport", - EnumValue(m_apNegSupport)); + m_apMac->GetEhtConfiguration()->m_tidLinkMappingSupport = m_apNegSupport; // For non-AP MLD, it does not make sense to set the negotiation type to 0 (unless the AP MLD // also advertises 0) or 1 (the AP MLD is discarded if it advertises a support of 3) auto staEhtConfig = m_staMacs[0]->GetEhtConfiguration(); - staEhtConfig->SetAttribute("TidToLinkMappingNegSupport", - EnumValue(WifiTidToLinkMappingNegSupport::ANY_LINK_SET)); + staEhtConfig->m_tidLinkMappingSupport = WifiTidToLinkMappingNegSupport::ANY_LINK_SET; staEhtConfig->SetAttribute("TidToLinkMappingDl", StringValue(m_dlTidLinkMappingStr)); staEhtConfig->SetAttribute("TidToLinkMappingUl", StringValue(m_ulTidLinkMappingStr)); @@ -954,8 +952,7 @@ MultiLinkSetupTest::DoSetup() // are compatible for (auto staMac : m_staMacs) { - staMac->GetVhtConfiguration()->SetAttribute("Support160MHzOperation", - BooleanValue(m_support160MHzOp)); + staMac->GetVhtConfiguration()->m_160MHzSupported = m_support160MHzOp; uint8_t linkId = 0; for (const auto& str : m_staChannels) { diff --git a/src/wifi/test/wifi-phy-mu-mimo-test.cc b/src/wifi/test/wifi-phy-mu-mimo-test.cc index b456aaf71..8ab5fc5ee 100644 --- a/src/wifi/test/wifi-phy-mu-mimo-test.cc +++ b/src/wifi/test/wifi-phy-mu-mimo-test.cc @@ -1536,7 +1536,7 @@ TestUlMuMimoPhyTransmission::SetBssColor(Ptr phy, uint8_t bssColor) { Ptr device = DynamicCast(phy->GetDevice()); Ptr heConfiguration = device->GetHeConfiguration(); - heConfiguration->SetAttribute("BssColor", UintegerValue(bssColor)); + heConfiguration->m_bssColor = bssColor; } void diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index cb7cb53b9..c099f72cf 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -3756,7 +3756,7 @@ TestUlOfdmaPhyTransmission::SetBssColor(Ptr phy, uint8_t bssColor) { Ptr device = DynamicCast(phy->GetDevice()); Ptr heConfiguration = device->GetHeConfiguration(); - heConfiguration->SetAttribute("BssColor", UintegerValue(bssColor)); + heConfiguration->m_bssColor = bssColor; } void @@ -5714,7 +5714,7 @@ TestUlOfdmaPowerControl::DoSetup() TimeValue(MicroSeconds(1024 * 600))); m_apDev = DynamicCast(wifi.Install(spectrumPhy, mac, apNode).Get(0)); NS_ASSERT(m_apDev); - m_apDev->GetHeConfiguration()->SetAttribute("BssColor", UintegerValue(m_bssColor)); + m_apDev->GetHeConfiguration()->m_bssColor = m_bssColor; m_phyAp = DynamicCast(m_apDev->GetPhy()); NS_ASSERT(m_phyAp); // ReceiveOkCallback of AP will be set to corresponding test's method once BA sessions have been