log channel behavior
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 17 Oct 2007 15:51:37 +0200
changeset 1987 474a32b1894a
parent 1986 541d684c440d
child 1988 210701141b08
log channel behavior
src/devices/wifi/wifi-channel.cc
--- a/src/devices/wifi/wifi-channel.cc	Wed Oct 17 15:51:20 2007 +0200
+++ b/src/devices/wifi/wifi-channel.cc	Wed Oct 17 15:51:37 2007 +0200
@@ -22,10 +22,12 @@
 #include "ns3/mobility-model.h"
 #include "ns3/net-device.h"
 #include "ns3/node.h"
+#include "ns3/log.h"
 #include "wifi-channel.h"
 #include "propagation-loss-model.h"
 #include "propagation-delay-model.h"
 
+NS_LOG_COMPONENT_DEFINE ("WifiChannel");
 
 namespace ns3 {
 
@@ -66,6 +68,8 @@
           double distance = senderMobility->GetDistanceFrom (receiverMobility);
           Time delay = m_delay->GetDelay (distance);
           double rxPowerDbm = m_loss->GetRxPower (txPowerDbm, distance);
+          NS_LOG_DEBUG ("propagation: txPower="<<txPowerDbm<<"dbm, rxPower="<<rxPowerDbm<<"dbm, "<<
+                        "distance="<<distance<<"m, delay="<<delay);
           Simulator::Schedule (delay, &WifiChannel::Receive, this, 
                                j, packet, rxPowerDbm, wifiMode, preamble);
         }