View | Details | Raw Unified | Return to bug 2764
Collapse All | Expand All

(-)a/src/spectrum/model/wifi-spectrum-value-helper.cc (-6 / +14 lines)
 Lines 38-54   struct WifiSpectrumModelId Link Here 
38
   * Constructor
38
   * Constructor
39
   * \param f the frequency in Mhz
39
   * \param f the frequency in Mhz
40
   * \param w the channel width in Mhz
40
   * \param w the channel width in Mhz
41
   * \param b the width of each band (Hz)
41
   */ 
42
   */ 
42
  WifiSpectrumModelId (uint32_t f, uint8_t w);
43
  WifiSpectrumModelId (uint32_t f, uint8_t w, double b);
43
  uint32_t m_centerFrequency;  ///< center frequency
44
  uint32_t m_centerFrequency;  ///< center frequency
44
  uint8_t m_channelWidth; ///< channel width
45
  uint8_t m_channelWidth; ///< channel width
46
  double m_bandBandwidth; ///< width of each band (Hz)
45
};
47
};
46
48
47
WifiSpectrumModelId::WifiSpectrumModelId (uint32_t f, uint8_t w)
49
WifiSpectrumModelId::WifiSpectrumModelId (uint32_t f, uint8_t w, double b)
48
  : m_centerFrequency (f),
50
  : m_centerFrequency (f),
49
    m_channelWidth (w)
51
    m_channelWidth (w),
52
    m_bandBandwidth (b)
50
{
53
{
51
  NS_LOG_FUNCTION (this << f << (uint16_t)w);
54
  NS_LOG_FUNCTION (this << f << (uint16_t)w << b);
52
}
55
}
53
56
54
/**
57
/**
 Lines 60-66   WifiSpectrumModelId::WifiSpectrumModelId (uint32_t f, uint8_t w) Link Here 
60
bool
63
bool
61
operator < (const WifiSpectrumModelId& a, const WifiSpectrumModelId& b)
64
operator < (const WifiSpectrumModelId& a, const WifiSpectrumModelId& b)
62
{
65
{
63
  return ( (a.m_centerFrequency < b.m_centerFrequency) || ( (a.m_centerFrequency == b.m_centerFrequency) && (a.m_channelWidth < b.m_channelWidth)));
66
  return ( (a.m_centerFrequency < b.m_centerFrequency)
67
          || ((a.m_centerFrequency == b.m_centerFrequency) &&
68
              (a.m_channelWidth < b.m_channelWidth))
69
          || ((a.m_centerFrequency == b.m_centerFrequency) && //to cover coexistence of 11ax with legacy case
70
              (a.m_channelWidth == b.m_channelWidth) &&
71
              (a.m_bandBandwidth < b.m_bandBandwidth)));
64
}
72
}
65
73
66
static std::map<WifiSpectrumModelId, Ptr<SpectrumModel> > g_wifiSpectrumModelMap; ///< static initializer for the class
74
static std::map<WifiSpectrumModelId, Ptr<SpectrumModel> > g_wifiSpectrumModelMap; ///< static initializer for the class
 Lines 70-76   WifiSpectrumValueHelper::GetSpectrumModel (uint32_t centerFrequency, uint8_t cha Link Here 
70
{
78
{
71
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << bandBandwidth << (uint16_t)guardBandwidth);
79
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << bandBandwidth << (uint16_t)guardBandwidth);
72
  Ptr<SpectrumModel> ret;
80
  Ptr<SpectrumModel> ret;
73
  WifiSpectrumModelId key (centerFrequency, channelWidth);
81
  WifiSpectrumModelId key (centerFrequency, channelWidth, bandBandwidth);
74
  std::map<WifiSpectrumModelId, Ptr<SpectrumModel> >::iterator it = g_wifiSpectrumModelMap.find (key);
82
  std::map<WifiSpectrumModelId, Ptr<SpectrumModel> >::iterator it = g_wifiSpectrumModelMap.find (key);
75
  if (it != g_wifiSpectrumModelMap.end ())
83
  if (it != g_wifiSpectrumModelMap.end ())
76
    {
84
    {

Return to bug 2764