improve log output
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 21 Nov 2007 11:11:27 +0100
changeset 2156 754a843db672
parent 2155 194dd8bdcf56
child 2157 2e94b55900ab
improve log output
src/devices/wifi/mac-high-nqap.cc
src/devices/wifi/mac-high-nqsta.cc
--- a/src/devices/wifi/mac-high-nqap.cc	Wed Nov 21 11:11:05 2007 +0100
+++ b/src/devices/wifi/mac-high-nqap.cc	Wed Nov 21 11:11:27 2007 +0100
@@ -28,11 +28,13 @@
 #include "ns3/assert.h"
 #include "ns3/log.h"
 #include "ns3/simulator.h"
+#include "ns3/node.h"
 
 NS_LOG_COMPONENT_DEFINE ("MacHighNqap");
 
 #define TRACE(x) \
-NS_LOG_DEBUG(Simulator::Now () << " " << x);
+  NS_LOG_DEBUG(Simulator::Now () << " " << m_phy->GetDevice ()->GetNode ()->GetId () << ":" << \
+               m_phy->GetDevice ()->GetIfIndex () << " " << x);
 
 namespace ns3 {
 
--- a/src/devices/wifi/mac-high-nqsta.cc	Wed Nov 21 11:11:05 2007 +0100
+++ b/src/devices/wifi/mac-high-nqsta.cc	Wed Nov 21 11:11:27 2007 +0100
@@ -22,6 +22,7 @@
 #include "ns3/simulator.h"
 #include "ns3/assert.h"
 #include "ns3/log.h"
+#include "ns3/node.h"
 
 #include "mac-high-nqsta.h"
 #include "wifi-mac-header.h"
@@ -34,7 +35,8 @@
 NS_LOG_COMPONENT_DEFINE ("MacHighNqsta");
 
 #define TRACE(x) \
-NS_LOG_DEBUG (Simulator::Now () << " " << x);
+  NS_LOG_DEBUG (Simulator::Now () << " " << m_phy->GetDevice ()->GetNode ()->GetId () << ":" << \
+                m_phy->GetDevice ()->GetIfIndex () << " " << x);
 
 /*
  * The state machine for this NQSTA is:
@@ -255,7 +257,9 @@
                                               &MacHighNqsta::MissedBeacons, this);
       return;
     }
+  TRACE ("beacon missed");
   m_state = BEACON_MISSED;
+  TryToEnsureAssociated ();
 }
 void 
 MacHighNqsta::RestartBeaconWatchdog (Time delay)