diff --git a/src/wifi/model/dca-txop.cc b/src/wifi/model/dca-txop.cc index ffc78e9e0..4bc442ece 100644 --- a/src/wifi/model/dca-txop.cc +++ b/src/wifi/model/dca-txop.cc @@ -24,6 +24,7 @@ #include "ns3/simulator.h" #include "ns3/node.h" #include "ns3/uinteger.h" +#include "ns3/pointer.h" #include "dca-txop.h" #include "dcf-manager.h" @@ -102,6 +103,10 @@ DcaTxop::GetTypeId (void) static TypeId tid = TypeId ("ns3::DcaTxop") .SetParent (ns3::Dcf::GetTypeId ()) .AddConstructor () + .AddAttribute ("Queue", "The WifiMacQueue object", + PointerValue (), + MakePointerAccessor (&DcaTxop::GetQueue), + MakePointerChecker ()) ; return tid; } @@ -171,18 +176,13 @@ DcaTxop::SetTxFailedCallback (TxFailed callback) m_txFailedCallback = callback; } -void -DcaTxop::SetMaxQueueSize (uint32_t size) +Ptr +DcaTxop::GetQueue () const { - NS_LOG_FUNCTION (this << size); - m_queue->SetMaxSize (size); -} -void -DcaTxop::SetMaxQueueDelay (Time delay) -{ - NS_LOG_FUNCTION (this << delay); - m_queue->SetMaxDelay (delay); + NS_LOG_FUNCTION (this); + return m_queue; } + void DcaTxop::SetMinCw (uint32_t minCw) { diff --git a/src/wifi/model/dca-txop.h b/src/wifi/model/dca-txop.h index c4d8d5463..97739c596 100644 --- a/src/wifi/model/dca-txop.h +++ b/src/wifi/model/dca-txop.h @@ -89,8 +89,7 @@ public: */ void SetTxFailedCallback (TxFailed callback); - void SetMaxQueueSize (uint32_t size); - void SetMaxQueueDelay (Time delay); + Ptr GetQueue () const; virtual void SetMinCw (uint32_t minCw); virtual void SetMaxCw (uint32_t maxCw); virtual void SetAifsn (uint32_t aifsn); diff --git a/src/wifi/model/edca-txop-n.cc b/src/wifi/model/edca-txop-n.cc index 2a6e38d22..d57d67a34 100644 --- a/src/wifi/model/edca-txop-n.cc +++ b/src/wifi/model/edca-txop-n.cc @@ -21,6 +21,7 @@ */ #include "ns3/log.h" #include "ns3/assert.h" +#include "ns3/pointer.h" #include "edca-txop-n.h" #include "mac-low.h" @@ -138,6 +139,10 @@ EdcaTxopN::GetTypeId (void) UintegerValue(0), MakeUintegerAccessor (&EdcaTxopN::SetBlockAckInactivityTimeout), MakeUintegerChecker ()) + .AddAttribute ("Queue", "The WifiMacQueue object", + PointerValue (), + MakePointerAccessor (&EdcaTxopN::GetQueue), + MakePointerChecker ()) ; return tid; } @@ -230,18 +235,11 @@ EdcaTxopN::GetTypeOfStation (void) const return m_typeOfStation; } -void -EdcaTxopN::SetMaxQueueSize (uint32_t size) +Ptr +EdcaTxopN::GetQueue () const { - NS_LOG_FUNCTION (this << size); - m_queue->SetMaxSize (size); -} - -void -EdcaTxopN::SetMaxQueueDelay (Time delay) -{ - NS_LOG_FUNCTION (this << delay); - m_queue->SetMaxDelay (delay); + NS_LOG_FUNCTION (this); + return m_queue; } void diff --git a/src/wifi/model/edca-txop-n.h b/src/wifi/model/edca-txop-n.h index b0a92d62b..c269a4b54 100644 --- a/src/wifi/model/edca-txop-n.h +++ b/src/wifi/model/edca-txop-n.h @@ -93,8 +93,7 @@ public: void SetTypeOfStation (enum TypeOfStation type); enum TypeOfStation GetTypeOfStation (void) const; - void SetMaxQueueSize (uint32_t size); - void SetMaxQueueDelay (Time delay); + Ptr GetQueue () const; virtual void SetMinCw (uint32_t minCw); virtual void SetMaxCw (uint32_t maxCw); virtual void SetAifsn (uint32_t aifsn);