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

(-)a/src/wifi/helper/yans-wifi-helper.cc (-1 lines)
 Lines 240-246    Link Here 
240
  Ptr<ErrorRateModel> error = m_errorRateModel.Create<ErrorRateModel> ();
240
  Ptr<ErrorRateModel> error = m_errorRateModel.Create<ErrorRateModel> ();
241
  phy->SetErrorRateModel (error);
241
  phy->SetErrorRateModel (error);
242
  phy->SetChannel (m_channel);
242
  phy->SetChannel (m_channel);
243
  phy->SetMobility (node);
244
  phy->SetDevice (device);
243
  phy->SetDevice (device);
245
  return phy;
244
  return phy;
246
}
245
}
(-)a/src/wifi/model/yans-wifi-phy.cc (-5 / +13 lines)
 Lines 36-41    Link Here 
36
#include "ns3/net-device.h"
36
#include "ns3/net-device.h"
37
#include "ns3/trace-source-accessor.h"
37
#include "ns3/trace-source-accessor.h"
38
#include "ns3/boolean.h"
38
#include "ns3/boolean.h"
39
#include "ns3/node.h"
39
#include "ampdu-tag.h"
40
#include "ampdu-tag.h"
40
#include <cmath>
41
#include <cmath>
41
42
 Lines 301-312    Link Here 
301
  m_interference.SetErrorRateModel (rate);
302
  m_interference.SetErrorRateModel (rate);
302
}
303
}
303
void
304
void
304
YansWifiPhy::SetDevice (Ptr<Object> device)
305
YansWifiPhy::SetDevice (Ptr<NetDevice> device)
305
{
306
{
306
  m_device = device;
307
  m_device = device;
307
}
308
}
308
void
309
void
309
YansWifiPhy::SetMobility (Ptr<Object> mobility)
310
YansWifiPhy::SetMobility (Ptr<MobilityModel> mobility)
310
{
311
{
311
  m_mobility = mobility;
312
  m_mobility = mobility;
312
}
313
}
 Lines 354-368    Link Here 
354
{
355
{
355
  return m_interference.GetErrorRateModel ();
356
  return m_interference.GetErrorRateModel ();
356
}
357
}
357
Ptr<Object>
358
Ptr<NetDevice>
358
YansWifiPhy::GetDevice (void) const
359
YansWifiPhy::GetDevice (void) const
359
{
360
{
360
  return m_device;
361
  return m_device;
361
}
362
}
362
Ptr<Object>
363
Ptr<MobilityModel>
363
YansWifiPhy::GetMobility (void)
364
YansWifiPhy::GetMobility (void)
364
{
365
{
365
  return m_mobility;
366
  if (m_mobility != 0)
367
    {
368
      return m_mobility;
369
    }
370
  else
371
    {
372
      return m_device->GetNode ()->GetObject<MobilityModel> ();
373
    }
366
}
374
}
367
375
368
double
376
double
(-)a/src/wifi/model/yans-wifi-phy.h (-7 / +17 lines)
 Lines 31-36    Link Here 
31
#include "ns3/nstime.h"
31
#include "ns3/nstime.h"
32
#include "ns3/ptr.h"
32
#include "ns3/ptr.h"
33
#include "ns3/random-variable-stream.h"
33
#include "ns3/random-variable-stream.h"
34
#include "ns3/mobility-model.h"
34
#include "wifi-phy.h"
35
#include "wifi-phy.h"
35
#include "wifi-mode.h"
36
#include "wifi-mode.h"
36
#include "wifi-preamble.h"
37
#include "wifi-preamble.h"
 Lines 195-207    Link Here 
195
   *
196
   *
196
   * \param device the device this PHY is associated with
197
   * \param device the device this PHY is associated with
197
   */
198
   */
198
  void SetDevice (Ptr<Object> device);
199
  void SetDevice (Ptr<NetDevice> device);
199
  /**
200
  /**
200
   * Sets the mobility model.
201
   * \brief assign a mobility model to this device
202
   *
203
   * This method allows a user to specify a mobility model that should be
204
   * associated with this physical layer.  Calling this method is optional
205
   * and only necessary if the user wants to override the mobility model
206
   * that is aggregated to the node.
201
   *
207
   *
202
   * \param mobility the mobility model this PHY is associated with
208
   * \param mobility the mobility model this PHY is associated with
203
   */
209
   */
204
  void SetMobility (Ptr<Object> mobility);
210
  void SetMobility (Ptr<MobilityModel> mobility);
205
  /**
211
  /**
206
   * Return the RX noise figure (dBm).
212
   * Return the RX noise figure (dBm).
207
   *
213
   *
 Lines 243-255    Link Here 
243
   *
249
   *
244
   * \return the device this PHY is associated with
250
   * \return the device this PHY is associated with
245
   */
251
   */
246
  Ptr<Object> GetDevice (void) const;
252
  Ptr<NetDevice> GetDevice (void) const;
247
  /**
253
  /**
248
   * Return the mobility model this PHY is associated with.
254
   * Return the mobility model this PHY is associated with.
255
   * This method will return either the mobility model that has been
256
   * explicitly set by a call to YansWifiPhy::SetMobility(), or else
257
   * will return the mobility model (if any) that has been aggregated
258
   * to the node.
249
   *
259
   *
250
   * \return the mobility model this PHY is associated with
260
   * \return the mobility model this PHY is associated with
251
   */
261
   */
252
  Ptr<Object> GetMobility (void);
262
  Ptr<MobilityModel> GetMobility (void);
253
263
254
  /**
264
  /**
255
   * Return the minimum available transmission power level (dBm).
265
   * Return the minimum available transmission power level (dBm).
 Lines 496-503    Link Here 
496
506
497
  Ptr<YansWifiChannel> m_channel;        //!< YansWifiChannel that this YansWifiPhy is connected to
507
  Ptr<YansWifiChannel> m_channel;        //!< YansWifiChannel that this YansWifiPhy is connected to
498
  uint16_t             m_channelNumber;  //!< Operating channel number
508
  uint16_t             m_channelNumber;  //!< Operating channel number
499
  Ptr<Object>          m_device;         //!< Pointer to the device
509
  Ptr<NetDevice>       m_device;         //!< Pointer to the device
500
  Ptr<Object>          m_mobility;       //!< Pointer to the mobility model
510
  Ptr<MobilityModel>   m_mobility;       //!< Pointer to the mobility model
501
511
502
  uint32_t m_numberOfTransmitters;  //!< Number of transmitters
512
  uint32_t m_numberOfTransmitters;  //!< Number of transmitters
503
  uint32_t m_numberOfReceivers;     //!< Number of receivers
513
  uint32_t m_numberOfReceivers;     //!< Number of receivers
(-)a/src/wifi/test/wifi-test.cc (-3 / +2 lines)
 Lines 118-124    Link Here 
118
  phy->SetErrorRateModel (error);
118
  phy->SetErrorRateModel (error);
119
  phy->SetChannel (channel);
119
  phy->SetChannel (channel);
120
  phy->SetDevice (dev);
120
  phy->SetDevice (dev);
121
  phy->SetMobility (node);
122
  phy->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
121
  phy->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
123
  Ptr<WifiRemoteStationManager> manager = m_manager.Create<WifiRemoteStationManager> ();
122
  Ptr<WifiRemoteStationManager> manager = m_manager.Create<WifiRemoteStationManager> ();
124
123
 Lines 265-271    Link Here 
265
  phy->SetErrorRateModel (error);
264
  phy->SetErrorRateModel (error);
266
  phy->SetChannel (channel);
265
  phy->SetChannel (channel);
267
  phy->SetDevice (dev);
266
  phy->SetDevice (dev);
268
  phy->SetMobility (node);
267
  phy->SetMobility (mobility);
269
  phy->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
268
  phy->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
270
  Ptr<WifiRemoteStationManager> manager = m_manager.Create<WifiRemoteStationManager> ();
269
  Ptr<WifiRemoteStationManager> manager = m_manager.Create<WifiRemoteStationManager> ();
271
270
 Lines 442-448    Link Here 
442
  txPhy->SetErrorRateModel (txError);
441
  txPhy->SetErrorRateModel (txError);
443
  txPhy->SetChannel (channel);
442
  txPhy->SetChannel (channel);
444
  txPhy->SetDevice (txDev);
443
  txPhy->SetDevice (txDev);
445
  txPhy->SetMobility (txNode);
444
  txPhy->SetMobility (txMobility);
446
  txPhy->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
445
  txPhy->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
447
446
448
  txPhy->TraceConnectWithoutContext ("PhyTxBegin", MakeCallback (&Bug555TestCase::NotifyPhyTxBegin, this));
447
  txPhy->TraceConnectWithoutContext ("PhyTxBegin", MakeCallback (&Bug555TestCase::NotifyPhyTxBegin, this));

Return to bug 1249