diff -r b7903dd92942 src/devices/wifi/yans-wifi-phy.cc --- a/src/devices/wifi/yans-wifi-phy.cc Mon Oct 25 17:44:09 2010 +0100 +++ b/src/devices/wifi/yans-wifi-phy.cc Mon Oct 25 10:29:26 2010 -0700 @@ -155,6 +155,7 @@ YansWifiPhy::ConfigureStandard (enum WifiPhyStandard standard) { NS_LOG_FUNCTION (this << standard); + m_standard = standard; switch (standard) { case WIFI_PHY_STANDARD_80211a: Configure80211a (); @@ -380,7 +381,26 @@ double YansWifiPhy::GetChannelFrequencyMhz() const { - return m_channelStartingFrequency + 5 * (GetChannelNumber() - 1); + double channelFreq; + switch (m_standard) { + case WIFI_PHY_STANDARD_80211b: + case WIFI_PHY_STANDARD_80211g: + channelFreq = m_channelStartingFrequency + 5 * (GetChannelNumber() - 1); + break; + case WIFI_PHY_STANDARD_80211a: + case WIFI_PHY_STANDARD_80211_10Mhz: + case WIFI_PHY_STANDARD_80211_5Mhz: + case WIFI_PHY_STANDARD_holland: + case WIFI_PHY_STANDARD_80211p_CCH: + case WIFI_PHY_STANDARD_80211p_SCH: + channelFreq = m_channelStartingFrequency + 5 * GetChannelNumber(); + break; + default: + NS_ASSERT (false); + break; + } + + return channelFreq; } void diff -r b7903dd92942 src/devices/wifi/yans-wifi-phy.h --- a/src/devices/wifi/yans-wifi-phy.h Mon Oct 25 17:44:09 2010 +0100 +++ b/src/devices/wifi/yans-wifi-phy.h Mon Oct 25 10:29:26 2010 -0700 @@ -217,6 +217,7 @@ UniformVariable m_random; /// Standard-dependent center frequency of 0-th channel, MHz double m_channelStartingFrequency; + enum WifiPhyStandard m_standard; Ptr m_state; InterferenceHelper m_interference; Time m_channelSwitchDelay;