wifi: Make use of HeConfiguration::GetBssColor rather than passing through attribute system
Suggestion from Stefano. Faster and more straightforward method.
This commit is contained in:
@@ -648,9 +648,7 @@ ApWifiMac::GetHeOperation (void) const
|
||||
{
|
||||
operation.SetMaxHeMcsPerNss (nss, 11); //TBD: hardcode to 11 for now since we assume all MCS values are supported
|
||||
}
|
||||
UintegerValue bssColor;
|
||||
GetHeConfiguration ()->GetAttribute ("BssColor", bssColor);
|
||||
operation.SetBssColor (bssColor.Get ());
|
||||
operation.SetBssColor (GetHeConfiguration ()->GetBssColor ());
|
||||
}
|
||||
return operation;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "ns3/node.h"
|
||||
#include "ns3/config.h"
|
||||
#include "ns3/double.h"
|
||||
#include "ns3/uinteger.h"
|
||||
#include "constant-obss-pd-algorithm.h"
|
||||
#include "ns3/sta-wifi-mac.h"
|
||||
#include "ns3/wifi-utils.h"
|
||||
@@ -77,9 +76,7 @@ ConstantObssPdAlgorithm::ReceiveHeSigA (HeSigAParameters params)
|
||||
|
||||
Ptr<HeConfiguration> heConfiguration = m_device->GetHeConfiguration ();
|
||||
NS_ASSERT (heConfiguration);
|
||||
UintegerValue bssColorAttribute;
|
||||
heConfiguration->GetAttribute ("BssColor", bssColorAttribute);
|
||||
uint8_t bssColor = bssColorAttribute.Get ();
|
||||
uint8_t bssColor = heConfiguration->GetBssColor ();
|
||||
|
||||
if (bssColor == 0)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "ns3/sta-wifi-mac.h"
|
||||
#include "ns3/ap-wifi-mac.h"
|
||||
#include "ns3/wifi-utils.h"
|
||||
#include "ns3/uinteger.h"
|
||||
#include "ns3/simulator.h"
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/assert.h"
|
||||
@@ -477,9 +476,7 @@ HePhy::GetBssColor (void) const
|
||||
Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
|
||||
if (heConfiguration)
|
||||
{
|
||||
UintegerValue bssColorAttribute;
|
||||
heConfiguration->GetAttribute ("BssColor", bssColorAttribute);
|
||||
bssColor = bssColorAttribute.Get ();
|
||||
bssColor = heConfiguration->GetBssColor ();
|
||||
}
|
||||
}
|
||||
return bssColor;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/double.h"
|
||||
#include "ns3/uinteger.h"
|
||||
#include "obss-pd-algorithm.h"
|
||||
#include "ns3/wifi-net-device.h"
|
||||
#include "ns3/wifi-phy.h"
|
||||
@@ -93,9 +92,7 @@ ObssPdAlgorithm::ResetPhy (HeSigAParameters params)
|
||||
// Fetch my BSS color
|
||||
Ptr<HeConfiguration> heConfiguration = m_device->GetHeConfiguration ();
|
||||
NS_ASSERT (heConfiguration);
|
||||
UintegerValue bssColorAttribute;
|
||||
heConfiguration->GetAttribute ("BssColor", bssColorAttribute);
|
||||
uint8_t bssColor = bssColorAttribute.Get ();
|
||||
uint8_t bssColor = heConfiguration->GetBssColor ();
|
||||
NS_LOG_DEBUG ("My BSS color " << (uint16_t) bssColor << " received frame " << (uint16_t) params.bssColor);
|
||||
|
||||
Ptr<WifiPhy> phy = m_device->GetPhy ();
|
||||
|
||||
@@ -547,9 +547,7 @@ WifiRemoteStationManager::GetDataTxVector (const WifiMacHeader &header)
|
||||
Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
|
||||
if (heConfiguration)
|
||||
{
|
||||
UintegerValue bssColor;
|
||||
heConfiguration->GetAttribute ("BssColor", bssColor);
|
||||
txVector.SetBssColor (bssColor.Get ());
|
||||
txVector.SetBssColor (heConfiguration->GetBssColor ());
|
||||
}
|
||||
return txVector;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user