src/devices/wifi/yans-wifi-phy.cc
changeset 3912 4d1a61f80745
parent 3906 01acc159ffb1
child 4039 50a070c2750c
--- a/src/devices/wifi/yans-wifi-phy.cc	Tue Nov 04 14:06:26 2008 +0100
+++ b/src/devices/wifi/yans-wifi-phy.cc	Tue Nov 04 14:06:34 2008 +0100
@@ -33,6 +33,7 @@
 #include "ns3/uinteger.h"
 #include "ns3/enum.h"
 #include "ns3/pointer.h"
+#include "ns3/net-device.h"
 #include <math.h>
 
 NS_LOG_COMPONENT_DEFINE ("YansWifiPhy");
@@ -130,6 +131,7 @@
   NS_LOG_FUNCTION (this);
   m_channel = 0;
   m_modes.clear ();
+  m_device = 0;
 }
 
 void
@@ -204,6 +206,17 @@
 {
   m_interference.SetErrorRateModel (rate);
 }
+void 
+YansWifiPhy::SetDevice (Ptr<Object> device)
+{
+  m_device = device;
+}
+void 
+YansWifiPhy::SetMobility (Ptr<Object> mobility)
+{
+  m_mobility = mobility;
+}
+
 double 
 YansWifiPhy::GetRxNoise (void) const
 {
@@ -247,6 +260,16 @@
 {
   return m_interference.GetErrorRateModel ();
 }
+Ptr<Object> 
+YansWifiPhy::GetDevice (void) const
+{
+  return m_device;
+}
+Ptr<Object> 
+YansWifiPhy::GetMobility (void)
+{
+  return m_mobility;
+}
 
 double 
 YansWifiPhy::CalculateSnr (WifiMode txMode, double ber) const
@@ -259,11 +282,11 @@
 {
   return m_channel;
 }
-
 void 
 YansWifiPhy::SetChannel (Ptr<YansWifiChannel> channel)
 {
   m_channel = channel;
+  m_channel->Add (this);
 }
 
 void