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

(-)a/src/devices/wifi/mac-low.cc (-1 / +1 lines)
 Lines 1135-1141    Link Here 
1135
            ", mode=" << txMode <<
1135
            ", mode=" << txMode <<
1136
            ", duration=" << hdr->GetDuration () <<
1136
            ", duration=" << hdr->GetDuration () <<
1137
            ", seq=0x"<< std::hex << m_currentHdr.GetSequenceControl () << std::dec);
1137
            ", seq=0x"<< std::hex << m_currentHdr.GetSequenceControl () << std::dec);
1138
  m_phy->SendPacket (packet, txMode, WIFI_PREAMBLE_LONG, 0);
1138
  m_phy->SendPacket (packet, txMode, WIFI_PREAMBLE_LONG, m_phy->GetTxPowerLevel ());
1139
}
1139
}
1140
1140
1141
void
1141
void
(-)a/src/devices/wifi/wifi-phy.h (+5 lines)
 Lines 167-172    Link Here 
167
  virtual uint32_t GetNTxPower (void) const = 0;
167
  virtual uint32_t GetNTxPower (void) const = 0;
168
168
169
  /**
169
  /**
170
   * \returns the tx power level.
171
   */
172
  virtual uint32_t GetTxPowerLevel (void) const = 0;
173
174
  /**
170
   * \param callback the callback to invoke
175
   * \param callback the callback to invoke
171
   *        upon successful packet reception.
176
   *        upon successful packet reception.
172
   */
177
   */
(-)a/src/devices/wifi/yans-wifi-phy.cc (+18 lines)
 Lines 81-86    Link Here 
81
                   UintegerValue (1),
81
                   UintegerValue (1),
82
                   MakeUintegerAccessor (&YansWifiPhy::m_nTxPower),
82
                   MakeUintegerAccessor (&YansWifiPhy::m_nTxPower),
83
                   MakeUintegerChecker<uint32_t> ())
83
                   MakeUintegerChecker<uint32_t> ())
84
    .AddAttribute ("TxPowerLevel",
85
                   "Transmission power level to be used.",
86
                   UintegerValue (0),
87
                   MakeUintegerAccessor (&YansWifiPhy::SetTxPowerLevel,
88
                                         &YansWifiPhy::GetTxPowerLevel),
89
                   MakeUintegerChecker<uint32_t> ())
84
    .AddAttribute ("TxPowerEnd",
90
    .AddAttribute ("TxPowerEnd",
85
                   "Maximum available transmission level (dbm).",
91
                   "Maximum available transmission level (dbm).",
86
                   DoubleValue (16.0206),
92
                   DoubleValue (16.0206),
 Lines 208-213    Link Here 
208
  NS_LOG_FUNCTION (this << n);
214
  NS_LOG_FUNCTION (this << n);
209
  m_nTxPower = n;
215
  m_nTxPower = n;
210
}
216
}
217
void
218
YansWifiPhy::SetTxPowerLevel (uint32_t n)
219
{
220
  NS_ASSERT (n < GetNTxPower ());
221
  NS_LOG_FUNCTION (this << n);
222
  m_txPowerLevel = n;
223
}
211
void 
224
void 
212
YansWifiPhy::SetTxGain (double gain)
225
YansWifiPhy::SetTxGain (double gain)
213
{
226
{
 Lines 528-533    Link Here 
528
{
541
{
529
  return m_nTxPower;
542
  return m_nTxPower;
530
}
543
}
544
uint32_t
545
YansWifiPhy::GetTxPowerLevel (void) const
546
{
547
  return m_txPowerLevel;
548
}
531
549
532
void
550
void
533
YansWifiPhy::Configure80211a (void)
551
YansWifiPhy::Configure80211a (void)
(-)a/src/devices/wifi/yans-wifi-phy.h (+3 lines)
 Lines 100-105    Link Here 
100
  void SetTxPowerStart (double start);
100
  void SetTxPowerStart (double start);
101
  void SetTxPowerEnd (double end);
101
  void SetTxPowerEnd (double end);
102
  void SetNTxPower (uint32_t n);
102
  void SetNTxPower (uint32_t n);
103
  void SetTxPowerLevel (uint32_t n);
103
  void SetTxGain (double gain);
104
  void SetTxGain (double gain);
104
  void SetRxGain (double gain);
105
  void SetRxGain (double gain);
105
  void SetEdThreshold (double threshold);
106
  void SetEdThreshold (double threshold);
 Lines 122-127    Link Here 
122
  virtual double GetTxPowerStart (void) const;
123
  virtual double GetTxPowerStart (void) const;
123
  virtual double GetTxPowerEnd (void) const;
124
  virtual double GetTxPowerEnd (void) const;
124
  virtual uint32_t GetNTxPower (void) const;
125
  virtual uint32_t GetNTxPower (void) const;
126
  virtual uint32_t GetTxPowerLevel (void) const;
125
  virtual void SetReceiveOkCallback (WifiPhy::RxOkCallback callback);
127
  virtual void SetReceiveOkCallback (WifiPhy::RxOkCallback callback);
126
  virtual void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback);
128
  virtual void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback);
127
  virtual void SendPacket (Ptr<const Packet> packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel);
129
  virtual void SendPacket (Ptr<const Packet> packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel);
 Lines 171-176    Link Here 
171
  double   m_txPowerBaseDbm;
173
  double   m_txPowerBaseDbm;
172
  double   m_txPowerEndDbm;
174
  double   m_txPowerEndDbm;
173
  uint32_t m_nTxPower;
175
  uint32_t m_nTxPower;
176
  uint32_t m_txPowerLevel;
174
177
175
  Ptr<YansWifiChannel> m_channel;
178
  Ptr<YansWifiChannel> m_channel;
176
  uint16_t m_channelNumber;
179
  uint16_t m_channelNumber;

Return to bug 917