diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py index deaa6436e..1d5cd0e9a 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -442,6 +442,16 @@ def register_Ns3GlobalValue_methods(root_module, cls): '__gnu_cxx::__normal_iterator< ns3::GlobalValue * const *, std::vector< ns3::GlobalValue * > >', [], is_static=True) + ## global-value.h: static bool ns3::GlobalValue::GetValueByNameFailSafe(std::string name, ns3::AttributeValue & value) [member function] + cls.add_method('GetValueByNameFailSafe', + 'bool', + [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], + is_static=True) + ## global-value.h: static void ns3::GlobalValue::GetValueByName(std::string name, ns3::AttributeValue & value) [member function] + cls.add_method('GetValueByName', + 'void', + [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], + is_static=True) return def register_Ns3IntToType__0_methods(root_module, cls): diff --git a/bindings/python/ns3_module_csma.py b/bindings/python/ns3_module_csma.py index 4dcae39f4..9f464f0d7 100644 --- a/bindings/python/ns3_module_csma.py +++ b/bindings/python/ns3_module_csma.py @@ -205,13 +205,11 @@ def register_Ns3CsmaChannel_methods(root_module, cls): ## csma-channel.h: ns3::DataRate ns3::CsmaChannel::GetDataRate() [member function] cls.add_method('GetDataRate', 'ns3::DataRate', - [], - is_virtual=True) + []) ## csma-channel.h: ns3::Time ns3::CsmaChannel::GetDelay() [member function] cls.add_method('GetDelay', 'ns3::Time', - [], - is_virtual=True) + []) return def register_Ns3CsmaNetDevice_methods(root_module, cls): diff --git a/bindings/python/ns3_module_global_routing.py b/bindings/python/ns3_module_global_routing.py index a76df6b3d..9f3bda083 100644 --- a/bindings/python/ns3_module_global_routing.py +++ b/bindings/python/ns3_module_global_routing.py @@ -83,17 +83,32 @@ def register_Ns3GlobalRouteManager_methods(root_module, cls): cls.add_method('PopulateRoutingTables', 'void', [], - is_static=True) + is_static=True, deprecated=True) ## global-route-manager.h: static void ns3::GlobalRouteManager::RecomputeRoutingTables() [member function] cls.add_method('RecomputeRoutingTables', 'void', [], - is_static=True) + is_static=True, deprecated=True) ## global-route-manager.h: static uint32_t ns3::GlobalRouteManager::AllocateRouterId() [member function] cls.add_method('AllocateRouterId', 'uint32_t', [], is_static=True) + ## global-route-manager.h: static void ns3::GlobalRouteManager::DeleteGlobalRoutes() [member function] + cls.add_method('DeleteGlobalRoutes', + 'void', + [], + is_static=True) + ## global-route-manager.h: static void ns3::GlobalRouteManager::BuildGlobalRoutingDatabase() [member function] + cls.add_method('BuildGlobalRoutingDatabase', + 'void', + [], + is_static=True) + ## global-route-manager.h: static void ns3::GlobalRouteManager::InitializeRoutes() [member function] + cls.add_method('InitializeRoutes', + 'void', + [], + is_static=True) return def register_Ns3GlobalRoutingLSA_methods(root_module, cls): @@ -160,6 +175,11 @@ def register_Ns3GlobalRoutingLSA_methods(root_module, cls): 'ns3::Ipv4Mask', [], is_const=True) + ## global-router-interface.h: ns3::Ptr ns3::GlobalRoutingLSA::GetNode() const [member function] + cls.add_method('GetNode', + 'ns3::Ptr< ns3::Node >', + [], + is_const=True) ## global-router-interface.h: ns3::GlobalRoutingLSA::SPFStatus ns3::GlobalRoutingLSA::GetStatus() const [member function] cls.add_method('GetStatus', 'ns3::GlobalRoutingLSA::SPFStatus', @@ -191,6 +211,10 @@ def register_Ns3GlobalRoutingLSA_methods(root_module, cls): cls.add_method('SetNetworkLSANetworkMask', 'void', [param('ns3::Ipv4Mask', 'mask')]) + ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetNode(ns3::Ptr node) [member function] + cls.add_method('SetNode', + 'void', + [param('ns3::Ptr< ns3::Node >', 'node')]) ## global-router-interface.h: void ns3::GlobalRoutingLSA::SetStatus(ns3::GlobalRoutingLSA::SPFStatus status) [member function] cls.add_method('SetStatus', 'void', diff --git a/bindings/python/ns3_module_wifi.py b/bindings/python/ns3_module_wifi.py index 1555f2e7d..06db78743 100644 --- a/bindings/python/ns3_module_wifi.py +++ b/bindings/python/ns3_module_wifi.py @@ -8,7 +8,7 @@ def register_types(module): ## wifi-preamble.h: ns3::WifiPreamble [enumeration] module.add_enum('WifiPreamble', ['WIFI_PREAMBLE_LONG', 'WIFI_PREAMBLE_SHORT']) ## wifi-phy-standard.h: ns3::WifiPhyStandard [enumeration] - module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_holland']) + module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_80211_10Mhz', 'WIFI_PHY_STANDARD_80211_5Mhz', 'WIFI_PHY_STANDARD_holland']) ## qos-utils.h: ns3::AccessClass [enumeration] module.add_enum('AccessClass', ['AC_VO', 'AC_VI', 'AC_BE', 'AC_BK', 'AC_UNDEF']) ## edca-txop-n.h: ns3::TypeOfStation [enumeration] @@ -264,19 +264,11 @@ def register_Ns3InterferenceHelper_methods(root_module, cls): cls.add_method('CalculateSnrPer', 'ns3::InterferenceHelper::SnrPer', [param('ns3::Ptr< ns3::InterferenceHelper::Event >', 'event')]) - ## interference-helper.h: ns3::Time ns3::InterferenceHelper::CalculateTxDuration(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) const [member function] + ## interference-helper.h: static ns3::Time ns3::InterferenceHelper::CalculateTxDuration(uint32_t size, ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function] cls.add_method('CalculateTxDuration', 'ns3::Time', [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], - is_const=True) - ## interference-helper.h: void ns3::InterferenceHelper::Configure80211aParameters() [member function] - cls.add_method('Configure80211aParameters', - 'void', - []) - ## interference-helper.h: void ns3::InterferenceHelper::Configure80211bParameters() [member function] - cls.add_method('Configure80211bParameters', - 'void', - []) + is_static=True) ## interference-helper.h: ns3::Time ns3::InterferenceHelper::GetEnergyDuration(double energyW) [member function] cls.add_method('GetEnergyDuration', 'ns3::Time', @@ -291,6 +283,26 @@ def register_Ns3InterferenceHelper_methods(root_module, cls): 'double', [], is_const=True) + ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPayloadDurationMicroSeconds(uint32_t size, ns3::WifiMode payloadMode) [member function] + cls.add_method('GetPayloadDurationMicroSeconds', + 'uint32_t', + [param('uint32_t', 'size'), param('ns3::WifiMode', 'payloadMode')], + is_static=True) + ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPlcpHeaderDurationMicroSeconds(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function] + cls.add_method('GetPlcpHeaderDurationMicroSeconds', + 'uint32_t', + [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], + is_static=True) + ## interference-helper.h: static ns3::WifiMode ns3::InterferenceHelper::GetPlcpHeaderMode(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function] + cls.add_method('GetPlcpHeaderMode', + 'ns3::WifiMode', + [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], + is_static=True) + ## interference-helper.h: static uint32_t ns3::InterferenceHelper::GetPlcpPreambleDurationMicroSeconds(ns3::WifiMode mode, ns3::WifiPreamble preamble) [member function] + cls.add_method('GetPlcpPreambleDurationMicroSeconds', + 'uint32_t', + [param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble')], + is_static=True) ## interference-helper.h: void ns3::InterferenceHelper::SetErrorRateModel(ns3::Ptr rate) [member function] cls.add_method('SetErrorRateModel', 'void', @@ -457,6 +469,11 @@ def register_Ns3WifiMode_methods(root_module, cls): 'uint32_t', [], is_const=True) + ## wifi-mode.h: ns3::WifiPhyStandard ns3::WifiMode::GetStandard() const [member function] + cls.add_method('GetStandard', + 'ns3::WifiPhyStandard', + [], + is_const=True) ## wifi-mode.h: uint32_t ns3::WifiMode::GetUid() const [member function] cls.add_method('GetUid', 'uint32_t', @@ -487,25 +504,25 @@ def register_Ns3WifiMode_methods(root_module, cls): def register_Ns3WifiModeFactory_methods(root_module, cls): ## wifi-mode.h: ns3::WifiModeFactory::WifiModeFactory(ns3::WifiModeFactory const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiModeFactory const &', 'arg0')]) - ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateBpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function] + ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateBpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function] cls.add_method('CreateBpsk', 'ns3::WifiMode', - [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], + [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], is_static=True) - ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateQam(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, uint8_t constellationSize) [member function] + ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateQam(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, uint8_t constellationSize, ns3::WifiPhyStandard standard) [member function] cls.add_method('CreateQam', 'ns3::WifiMode', - [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('uint8_t', 'constellationSize')], + [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('uint8_t', 'constellationSize'), param('ns3::WifiPhyStandard', 'standard')], is_static=True) - ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDbpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function] + ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDbpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function] cls.add_method('CreateDbpsk', 'ns3::WifiMode', - [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], + [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], is_static=True) - ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDqpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function] + ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateDqpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate, ns3::WifiPhyStandard standard) [member function] cls.add_method('CreateDqpsk', 'ns3::WifiMode', - [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate')], + [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('ns3::WifiPhyStandard', 'standard')], is_static=True) return @@ -1470,6 +1487,10 @@ def register_Ns3WifiMac_methods(root_module, cls): cls.add_method('NotifyRxDrop', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + ## wifi-mac.h: void ns3::WifiMac::SetStandard(ns3::WifiPhyStandard standard) [member function] + cls.add_method('SetStandard', + 'void', + [param('ns3::WifiPhyStandard', 'standard')]) return def register_Ns3WifiMacHeader_methods(root_module, cls): @@ -2053,6 +2074,86 @@ def register_Ns3WifiPhy_methods(root_module, cls): 'ns3::WifiMode', [], is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get3mb10Mhz() [member function] + cls.add_method('Get3mb10Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get4_5mb10Mhz() [member function] + cls.add_method('Get4_5mb10Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get6mb10Mhz() [member function] + cls.add_method('Get6mb10Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get9mb10Mhz() [member function] + cls.add_method('Get9mb10Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get12mb10Mhz() [member function] + cls.add_method('Get12mb10Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get18mb10Mhz() [member function] + cls.add_method('Get18mb10Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get24mb10Mhz() [member function] + cls.add_method('Get24mb10Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get27mb10Mhz() [member function] + cls.add_method('Get27mb10Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get1_5mb5Mhz() [member function] + cls.add_method('Get1_5mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get2_25mb5Mhz() [member function] + cls.add_method('Get2_25mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get3mb5Mhz() [member function] + cls.add_method('Get3mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get4_5mb5Mhz() [member function] + cls.add_method('Get4_5mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get6mb5Mhz() [member function] + cls.add_method('Get6mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get9mb5Mhz() [member function] + cls.add_method('Get9mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get12mb5Mhz() [member function] + cls.add_method('Get12mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) + ## wifi-phy.h: static ns3::WifiMode ns3::WifiPhy::Get13_5mb5Mhz() [member function] + cls.add_method('Get13_5mb5Mhz', + 'ns3::WifiMode', + [], + is_static=True) ## wifi-phy.h: void ns3::WifiPhy::NotifyTxBegin(ns3::Ptr packet) [member function] cls.add_method('NotifyTxBegin', 'void', @@ -3128,6 +3229,16 @@ def register_Ns3JakesPropagationLossModel_methods(root_module, cls): cls.add_method('SetNOscillators', 'void', [param('uint8_t', 'nOscillators')]) + ## jakes-propagation-loss-model.h: uint8_t ns3::JakesPropagationLossModel::GetNRays() const [member function] + cls.add_method('GetNRays', + 'uint8_t', + [], + is_const=True) + ## jakes-propagation-loss-model.h: uint8_t ns3::JakesPropagationLossModel::GetNOscillators() const [member function] + cls.add_method('GetNOscillators', + 'uint8_t', + [], + is_const=True) ## jakes-propagation-loss-model.h: double ns3::JakesPropagationLossModel::DoCalcRxPower(double txPowerDbm, ns3::Ptr a, ns3::Ptr b) const [member function] cls.add_method('DoCalcRxPower', 'double', diff --git a/src/devices/wifi/dcf-manager-test.cc b/src/devices/wifi/dcf-manager-test.cc index 968bbea5f..b94f0ed3f 100644 --- a/src/devices/wifi/dcf-manager-test.cc +++ b/src/devices/wifi/dcf-manager-test.cc @@ -379,6 +379,21 @@ DcfManagerTest::RunTests (void) AddAccessRequest (30, 2, 70, 0); ExpectCollision (30, 0, 0); // backoff: 0 slots EndTest (); + // Test shows when two frames are received without interval between + // them: + // 20 60 100 106 110 112 + // | rx | rx |sifs | aifsn | tx | + // | + // 30 request access. backoff slots: 0 + + StartTest (4, 6 , 10); + AddDcfState (1); + AddRxOkEvt (20, 40); + AddRxOkEvt (60, 40); + AddAccessRequest (30, 2, 110, 0); + ExpectCollision (30, 0, 0); // backoff: 0 slots + EndTest (); + // The test below is subject to some discussion because I am // not sure I understand the intent of the spec here. diff --git a/src/devices/wifi/dcf-manager.cc b/src/devices/wifi/dcf-manager.cc index ec2b0e1fc..320bf0621 100644 --- a/src/devices/wifi/dcf-manager.cc +++ b/src/devices/wifi/dcf-manager.cc @@ -433,7 +433,7 @@ Time DcfManager::GetAccessGrantStart (void) const { Time rxAccessStart; - if (m_lastRxEnd >= m_lastRxStart) + if (!m_rxing) { rxAccessStart = m_lastRxEnd; if (!m_lastRxReceivedOk) diff --git a/src/devices/wifi/interference-helper.cc b/src/devices/wifi/interference-helper.cc index 930aadb3d..c375d095e 100644 --- a/src/devices/wifi/interference-helper.cc +++ b/src/devices/wifi/interference-helper.cc @@ -372,8 +372,11 @@ InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payl case WIFI_PHY_STANDARD_80211b: NS_FATAL_ERROR("can't happen here"); symbolDurationUs = 0; // quiet compiler + break; default: NS_FATAL_ERROR("unknown standard"); + symbolDurationUs = 0; // quiet compiler + break; } // IEEE Std 802.11-2007, section 17.3.2.2, table 17-3 @@ -381,7 +384,7 @@ InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payl double numDataBitsPerSymbol = payloadMode.GetDataRate () * symbolDurationUs / 1e6; // IEEE Std 802.11-2007, section 17.3.5.3, equation (17-11) - uint32_t numSymbols = ceil ((16 + size * 8.0 + 6.0)/numDataBitsPerSymbol); + uint32_t numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0)/numDataBitsPerSymbol)); return numSymbols*symbolDurationUs; } @@ -390,7 +393,7 @@ InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payl NS_LOG_LOGIC(" size=" << size << " mode=" << payloadMode << " rate=" << payloadMode.GetDataRate () ); - return ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6)); + return lrint(ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6))); default: NS_FATAL_ERROR("unknown standard"); diff --git a/src/devices/wifi/nqap-wifi-mac.cc b/src/devices/wifi/nqap-wifi-mac.cc index f72b865b5..4b9c8ce0b 100644 --- a/src/devices/wifi/nqap-wifi-mac.cc +++ b/src/devices/wifi/nqap-wifi-mac.cc @@ -97,6 +97,7 @@ NqapWifiMac::DoDispose (void) NS_LOG_FUNCTION (this); delete m_rxMiddle; delete m_dcfManager; + m_low->Dispose (); m_rxMiddle = 0; m_low = 0; m_dcfManager = 0; diff --git a/src/devices/wifi/nqsta-wifi-mac.cc b/src/devices/wifi/nqsta-wifi-mac.cc index 4a979500b..e7bceba8f 100644 --- a/src/devices/wifi/nqsta-wifi-mac.cc +++ b/src/devices/wifi/nqsta-wifi-mac.cc @@ -128,6 +128,7 @@ NqstaWifiMac::DoDispose (void) NS_LOG_FUNCTION (this); delete m_rxMiddle; delete m_dcfManager; + m_low->Dispose (); m_rxMiddle = 0; m_low = 0; m_dcfManager = 0; diff --git a/src/devices/wifi/qap-wifi-mac.cc b/src/devices/wifi/qap-wifi-mac.cc index 066bf0187..af9bb6938 100644 --- a/src/devices/wifi/qap-wifi-mac.cc +++ b/src/devices/wifi/qap-wifi-mac.cc @@ -119,10 +119,11 @@ void QapWifiMac::DoDispose () { delete m_rxMiddle; - m_rxMiddle = 0; delete m_txMiddle; - m_txMiddle = 0; delete m_dcfManager; + m_low->Dispose (); + m_rxMiddle = 0; + m_txMiddle = 0; m_dcfManager = 0; m_low = 0; m_phy = 0; diff --git a/src/devices/wifi/qsta-wifi-mac.cc b/src/devices/wifi/qsta-wifi-mac.cc index cdb12ba27..e3c3fed5a 100644 --- a/src/devices/wifi/qsta-wifi-mac.cc +++ b/src/devices/wifi/qsta-wifi-mac.cc @@ -125,6 +125,7 @@ QstaWifiMac::DoDispose () delete m_rxMiddle; delete m_txMiddle; delete m_dcfManager; + m_low->Dispose (); m_rxMiddle = 0; m_txMiddle = 0; m_low = 0; diff --git a/src/devices/wifi/yans-wifi-phy.cc b/src/devices/wifi/yans-wifi-phy.cc index 9e29497d4..f807d655c 100644 --- a/src/devices/wifi/yans-wifi-phy.cc +++ b/src/devices/wifi/yans-wifi-phy.cc @@ -112,14 +112,14 @@ YansWifiPhy::GetTypeId (void) MakeEnumChecker (WIFI_PHY_STANDARD_80211a, "802.11a", WIFI_PHY_STANDARD_80211b, "802.11b", WIFI_PHY_STANDARD_80211_10Mhz,"802.11_10Mhz", - WIFI_PHY_STANDARD_80211_5Mhz,"802-11_5Mhz", + WIFI_PHY_STANDARD_80211_5Mhz,"802.11_5Mhz", WIFI_PHY_STANDARD_holland, "holland")) .AddAttribute ("State", "The state of the PHY layer", PointerValue (), MakePointerAccessor (&YansWifiPhy::m_state), MakePointerChecker ()) .AddAttribute ("ChannelSwitchDelay", - "Delay between two short frames transmitted on different frequencies", + "Delay between two short frames transmitted on different frequencies. NOTE: Unused now.", TimeValue (MicroSeconds (250)), MakeTimeAccessor (&YansWifiPhy::m_channelSwitchDelay), MakeTimeChecker ()) @@ -167,7 +167,7 @@ YansWifiPhy::SetStandard (enum WifiPhyStandard standard) break; case WIFI_PHY_STANDARD_80211_5Mhz: Configure80211_5Mhz (); - break; + break; case WIFI_PHY_STANDARD_holland: ConfigureHolland (); break; @@ -318,7 +318,8 @@ YansWifiPhy::SetChannel (Ptr channel) void YansWifiPhy::SetChannelNumber (uint16_t nch) { - Simulator::Schedule (m_channelSwitchDelay, &YansWifiPhy::DoSetChannelNumber, this, nch); + // TODO implement channel switching state machine here + DoSetChannelNumber (nch); } void @@ -476,6 +477,7 @@ void YansWifiPhy::Configure80211a (void) { NS_LOG_FUNCTION (this); + m_channelStartingFrequency = 5e3; // 5.000 GHz m_modes.push_back (WifiPhy::Get6mba ()); m_modes.push_back (WifiPhy::Get9mba ()); m_modes.push_back (WifiPhy::Get12mba ()); @@ -491,6 +493,7 @@ void YansWifiPhy::Configure80211b (void) { NS_LOG_FUNCTION (this); + m_channelStartingFrequency = 2412; // 2.412 GHz m_modes.push_back (WifiPhy::Get1mbb ()); m_modes.push_back (WifiPhy::Get2mbb ()); m_modes.push_back (WifiPhy::Get5_5mbb ()); @@ -501,6 +504,7 @@ void YansWifiPhy::Configure80211_10Mhz (void) { NS_LOG_FUNCTION (this); + m_channelStartingFrequency = 5e3; // 5.000 GHz, suppose 802.11a m_modes.push_back (WifiPhy::Get3mb10Mhz ()); m_modes.push_back (WifiPhy::Get4_5mb10Mhz ()); m_modes.push_back (WifiPhy::Get6mb10Mhz ()); @@ -515,6 +519,7 @@ void YansWifiPhy::Configure80211_5Mhz (void) { NS_LOG_FUNCTION (this); + m_channelStartingFrequency = 5e3; // 5.000 GHz, suppose 802.11a m_modes.push_back (WifiPhy::Get1_5mb5Mhz ()); m_modes.push_back (WifiPhy::Get2_25mb5Mhz ()); m_modes.push_back (WifiPhy::Get3mb5Mhz ()); @@ -529,6 +534,7 @@ void YansWifiPhy::ConfigureHolland (void) { NS_LOG_FUNCTION (this); + m_channelStartingFrequency = 5e3; // 5.000 GHz m_modes.push_back (WifiPhy::Get6mba ()); m_modes.push_back (WifiPhy::Get12mba ()); m_modes.push_back (WifiPhy::Get18mba ());