wifi: Cleanup WifiPhy

This commit is contained in:
Sébastien Deronne
2018-04-01 11:01:15 +02:00
parent de42170ff2
commit eaf5bc80e9
2 changed files with 8 additions and 113 deletions

View File

@@ -171,8 +171,7 @@ WifiPhy::GetTypeId (void)
"The energy of a received signal should be higher than "
"this threshold (dbm) to allow the PHY layer to detect the signal.",
DoubleValue (-96.0),
MakeDoubleAccessor (&WifiPhy::SetEdThreshold,
&WifiPhy::GetEdThreshold),
MakeDoubleAccessor (&WifiPhy::SetEdThreshold),
MakeDoubleChecker<double> ())
.AddAttribute ("CcaMode1Threshold",
"The energy of a received signal should be higher than "
@@ -294,9 +293,8 @@ WifiPhy::GetTypeId (void)
MakeBooleanChecker ())
.AddAttribute ("FrameCaptureModel",
"Ptr to an object that implements the frame capture model",
PointerValue (0), //StringValue ("ns3::SimpleFrameCaptureModel"),
MakePointerAccessor (&WifiPhy::GetFrameCaptureModel,
&WifiPhy::SetFrameCaptureModel),
PointerValue (0),
MakePointerAccessor (&WifiPhy::SetFrameCaptureModel),
MakePointerChecker <FrameCaptureModel> ())
.AddTraceSource ("PhyTxBegin",
"Trace source indicating a packet "
@@ -466,16 +464,10 @@ WifiPhy::SetEdThreshold (double threshold)
m_edThresholdW = DbmToW (threshold);
}
double
WifiPhy::GetEdThresholdW (void) const
{
return m_edThresholdW;
}
double
WifiPhy::GetEdThreshold (void) const
{
return WToDbm (m_edThresholdW);
return m_edThresholdW;
}
void
@@ -681,24 +673,12 @@ WifiPhy::SetErrorRateModel (const Ptr<ErrorRateModel> rate)
m_interference.SetNumberOfReceiveAntennas (GetNumberOfAntennas ());
}
Ptr<ErrorRateModel>
WifiPhy::GetErrorRateModel (void) const
{
return m_interference.GetErrorRateModel ();
}
void
WifiPhy::SetFrameCaptureModel (const Ptr<FrameCaptureModel> model)
{
m_frameCaptureModel = model;
}
Ptr<FrameCaptureModel>
WifiPhy::GetFrameCaptureModel (void) const
{
return m_frameCaptureModel;
}
void
WifiPhy::SetWifiRadioEnergyModel (const Ptr<WifiRadioEnergyModel> wifiRadioEnergyModel)
{
@@ -808,10 +788,8 @@ WifiPhy::ConfigureDefaultsForStandard (WifiPhyStandard standard)
NS_ASSERT (GetChannelNumber () == 42);
break;
case WIFI_PHY_STANDARD_UNSPECIFIED:
NS_LOG_WARN ("Configuring unspecified standard; performing no action");
break;
default:
NS_ASSERT (false);
NS_LOG_WARN ("Configuring unspecified standard; performing no action");
break;
}
}
@@ -1180,6 +1158,7 @@ WifiPhy::ConfigureStandard (WifiPhyStandard standard)
case WIFI_PHY_STANDARD_80211ax_5GHZ:
Configure80211ax ();
break;
case WIFI_PHY_STANDARD_UNSPECIFIED:
default:
NS_ASSERT (false);
break;
@@ -1338,56 +1317,6 @@ WifiPhy::GetBssMembershipSelector (uint8_t selector) const
return m_bssMembershipSelectorSet[selector];
}
WifiModeList
WifiPhy::GetMembershipSelectorModes (uint32_t selector)
{
uint32_t id = GetBssMembershipSelector (selector);
WifiModeList supportedmodes;
if (id == HT_PHY || id == VHT_PHY || id == HE_PHY)
{
//mandatory MCS 0 to 7
supportedmodes.push_back (WifiPhy::GetHtMcs0 ());
supportedmodes.push_back (WifiPhy::GetHtMcs1 ());
supportedmodes.push_back (WifiPhy::GetHtMcs2 ());
supportedmodes.push_back (WifiPhy::GetHtMcs3 ());
supportedmodes.push_back (WifiPhy::GetHtMcs4 ());
supportedmodes.push_back (WifiPhy::GetHtMcs5 ());
supportedmodes.push_back (WifiPhy::GetHtMcs6 ());
supportedmodes.push_back (WifiPhy::GetHtMcs7 ());
}
if (id == VHT_PHY || id == HE_PHY)
{
//mandatory MCS 0 to 9
supportedmodes.push_back (WifiPhy::GetVhtMcs0 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs1 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs2 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs3 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs4 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs5 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs6 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs7 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs8 ());
supportedmodes.push_back (WifiPhy::GetVhtMcs9 ());
}
if (id == HE_PHY)
{
//mandatory MCS 0 to 11
supportedmodes.push_back (WifiPhy::GetHeMcs0 ());
supportedmodes.push_back (WifiPhy::GetHeMcs1 ());
supportedmodes.push_back (WifiPhy::GetHeMcs2 ());
supportedmodes.push_back (WifiPhy::GetHeMcs3 ());
supportedmodes.push_back (WifiPhy::GetHeMcs4 ());
supportedmodes.push_back (WifiPhy::GetHeMcs5 ());
supportedmodes.push_back (WifiPhy::GetHeMcs6 ());
supportedmodes.push_back (WifiPhy::GetHeMcs7 ());
supportedmodes.push_back (WifiPhy::GetHeMcs8 ());
supportedmodes.push_back (WifiPhy::GetHeMcs9 ());
supportedmodes.push_back (WifiPhy::GetHeMcs10 ());
supportedmodes.push_back (WifiPhy::GetHeMcs11 ());
}
return supportedmodes;
}
void
WifiPhy::AddSupportedChannelWidth (uint8_t width)
{
@@ -3676,7 +3605,7 @@ void
WifiPhy::StartRx (Ptr<Packet> packet, WifiTxVector txVector, MpduType mpdutype, double rxPowerW, Time rxDuration, Ptr<InterferenceHelper::Event> event)
{
NS_LOG_FUNCTION (this << packet << txVector << +mpdutype << rxPowerW << rxDuration);
if (rxPowerW > GetEdThresholdW ()) //checked here, no need to check in the payload reception (current implementation assumes constant rx power over the packet duration)
if (rxPowerW > GetEdThreshold ()) //checked here, no need to check in the payload reception (current implementation assumes constant rx power over the packet duration)
{
AmpduTag ampduTag;
WifiPreamble preamble = txVector.GetPreambleType ();
@@ -3741,7 +3670,7 @@ WifiPhy::StartRx (Ptr<Packet> packet, WifiTxVector txVector, MpduType mpdutype,
else
{
NS_LOG_DEBUG ("drop packet because signal power too Small (" <<
rxPowerW << "<" << GetEdThresholdW () << ")");
rxPowerW << "<" << GetEdThreshold () << ")");
NotifyRxDrop (packet);
m_plcpSuccess = false;
MaybeCcaBusyDuration ();

View File

@@ -437,20 +437,6 @@ public:
* \return the memebership selector whose index is specified.
*/
uint8_t GetBssMembershipSelector (uint8_t selector) const;
/**
* The WifiPhy::GetMembershipSelectorModes() method is used
* (e.g., by a WifiRemoteStationManager) to determine the set of
* transmission/reception modes that this WifiPhy(-derived class)
* can support - a set of WifiMode objects which we call the
* BssMembershipSelectorSet, and which is stored as WifiPhy::m_bssMembershipSelectorSet.
*
* \param selector index in array of supported memberships
*
* \return a WifiModeList that contains the WifiModes associrated with the selected index.
*
* \sa WifiPhy::GetMembershipSelectorModes()
*/
WifiModeList GetMembershipSelectorModes (uint32_t selector);
/**
* The WifiPhy::GetNMcs() method is used
* (e.g., by a WifiRemoteStationManager) to determine the set of
@@ -1237,12 +1223,6 @@ public:
* \return the energy detection threshold in dBm
*/
double GetEdThreshold (void) const;
/**
* Return the energy detection threshold.
*
* \return the energy detection threshold.
*/
double GetEdThresholdW (void) const;
/**
* Sets the CCA threshold (dBm). The energy of a received signal
* should be higher than this threshold to allow the PHY
@@ -1466,26 +1446,12 @@ public:
* \param rate the error rate model
*/
void SetErrorRateModel (const Ptr<ErrorRateModel> rate);
/**
* Return the error rate model this PHY is using.
*
* \return the error rate model this PHY is using
*/
Ptr<ErrorRateModel> GetErrorRateModel (void) const;
/**
* Sets the frame capture model.
*
* \param frameCaptureModel the frame capture model
*/
void SetFrameCaptureModel (const Ptr<FrameCaptureModel> frameCaptureModel);
/**
* Return the frame capture model this PHY is using.
*
* \return the frame capture model this PHY is using
*/
Ptr<FrameCaptureModel> GetFrameCaptureModel (void) const;
/**
* Sets the wifi radio energy model.
*