diff --git a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/ap-wifi-mac.cc b/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/ap-wifi-mac.cc index 061b0e7..48f7ecf 100644 --- a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/ap-wifi-mac.cc +++ b/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/ap-wifi-mac.cc @@ -74,6 +74,7 @@ ApWifiMac::ApWifiMac () m_beaconDca->SetMaxCw (0); m_beaconDca->SetLow (m_low); m_beaconDca->SetManager (m_dcfManager); + m_beaconDca->SetTxMiddle(m_txMiddle); // Let the lower layers know that we are acting as an AP. SetTypeOfStation (AP); diff --git a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dca-txop.cc b/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dca-txop.cc index e38af9f..6bd2698 100644 --- a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dca-txop.cc +++ b/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dca-txop.cc @@ -137,7 +137,6 @@ DcaTxop::DcaTxop () m_dcf = new DcaTxop::Dcf (this); m_queue = CreateObject (); m_rng = new RealRandomStream (); - m_txMiddle = new MacTxMiddle (); } DcaTxop::~DcaTxop () @@ -155,11 +154,9 @@ DcaTxop::DoDispose (void) delete m_transmissionListener; delete m_dcf; delete m_rng; - delete m_txMiddle; m_transmissionListener = 0; m_dcf = 0; m_rng = 0; - m_txMiddle = 0; } void @@ -169,6 +166,10 @@ DcaTxop::SetManager (DcfManager *manager) m_manager = manager; m_manager->Add (m_dcf); } + +void DcaTxop::SetTxMiddle (MacTxMiddle *txMiddle){ + m_txMiddle = txMiddle; +} void DcaTxop::SetLow (Ptr low) diff --git a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dca-txop.h b/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dca-txop.h index fea76c6..e7ca715 100644 --- a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dca-txop.h +++ b/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/dca-txop.h @@ -80,6 +80,7 @@ public: void SetLow (Ptr low); void SetManager (DcfManager *manager); void SetWifiRemoteStationManager (Ptr remoteManager); + void SetTxMiddle (MacTxMiddle *txMiddle); /** * \param callback the callback to invoke when a diff --git a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/regular-wifi-mac.cc b/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/regular-wifi-mac.cc index 092dca1..b3593e7 100644 --- a/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/regular-wifi-mac.cc +++ b/ns3/ns-allinone-3.14.1/ns-3.14.1/src/wifi/model/regular-wifi-mac.cc @@ -61,6 +61,7 @@ NS_OBJECT_ENSURE_REGISTERED (RegularWifiMac); m_dca = CreateObject (); m_dca->SetLow (m_low); m_dca->SetManager (m_dcfManager); + m_dca->SetTxMiddle(m_txMiddle); m_dca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this)); m_dca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));