--- a/src/wifi/model/infrastructure-wifi-mac.cc Fri May 18 19:40:00 2018 +0200
+++ b/src/wifi/model/infrastructure-wifi-mac.cc Fri May 18 19:42:53 2018 +0200
@@ -56,9 +56,17 @@
}
void
+InfrastructureWifiMac::SetQosSupported (bool enable)
+{
+ NS_ASSERT_MSG (!(GetPcfSupported () && enable), "QoS cannot be enabled when PCF support is activated (not supported)");
+ RegularWifiMac::SetQosSupported (enable);
+}
+
+void
InfrastructureWifiMac::SetPcfSupported (bool enable)
{
NS_LOG_FUNCTION (this << enable);
+ NS_ASSERT_MSG (!(GetQosSupported () && enable), "PCF cannot be enabled when QoS support is activated (not supported)");
m_pcfSupported = enable;
if (m_stationManager != 0)
{
--- a/src/wifi/model/infrastructure-wifi-mac.h Fri May 18 19:40:00 2018 +0200
+++ b/src/wifi/model/infrastructure-wifi-mac.h Fri May 18 19:42:53 2018 +0200
@@ -51,6 +51,12 @@
* access is granted to this MAC.
*/
virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to) = 0;
+ /**
+ * Enable or disable QoS support for the device.
+ *
+ * \param enable whether QoS is supported
+ */
+ void SetQosSupported (bool enable);
/**
* Enable or disable PCF support for the device.
--- a/src/wifi/model/regular-wifi-mac.cc Fri May 18 19:40:00 2018 +0200
+++ b/src/wifi/model/regular-wifi-mac.cc Fri May 18 19:42:53 2018 +0200
@@ -39,7 +39,8 @@
NS_OBJECT_ENSURE_REGISTERED (RegularWifiMac);
RegularWifiMac::RegularWifiMac ()
- : m_htSupported (0),
+ : m_qosSupported (0),
+ m_htSupported (0),
m_vhtSupported (0),
m_erpSupported (0),
m_dsssSupported (0),
@@ -1218,14 +1219,14 @@
.AddAttribute ("ShortSlotTimeSupported",
"Whether or not short slot time is supported (only used by ERP APs or STAs).",
BooleanValue (true),
- MakeBooleanAccessor (&RegularWifiMac::GetShortSlotTimeSupported,
- &RegularWifiMac::SetShortSlotTimeSupported),
+ MakeBooleanAccessor (&RegularWifiMac::SetShortSlotTimeSupported,
+ &RegularWifiMac::GetShortSlotTimeSupported),
MakeBooleanChecker ())
.AddAttribute ("RifsSupported",
"Whether or not RIFS is supported (only used by HT APs or STAs).",
BooleanValue (false),
- MakeBooleanAccessor (&RegularWifiMac::GetRifsSupported,
- &RegularWifiMac::SetRifsSupported),
+ MakeBooleanAccessor (&RegularWifiMac::SetRifsSupported,
+ &RegularWifiMac::GetRifsSupported),
MakeBooleanChecker ())
.AddAttribute ("Txop",
"The Txop object.",
--- a/src/wifi/model/regular-wifi-mac.h Fri May 18 19:40:00 2018 +0200
+++ b/src/wifi/model/regular-wifi-mac.h Fri May 18 19:42:53 2018 +0200
@@ -441,7 +441,7 @@
*
* \param enable whether QoS is supported
*/
- void SetQosSupported (bool enable);
+ virtual void SetQosSupported (bool enable);
/**
* Return whether the device supports QoS.
*