--- a/src/wifi/model/sta-wifi-mac.cc Fri Jun 06 12:43:03 2014 -0700
+++ b/src/wifi/model/sta-wifi-mac.cc Wed Jun 11 20:26:02 2014 -0700
@@ -84,7 +84,7 @@
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("ActiveProbing", "If true, we send probe requests. If false, we don't. NOTE: if more than one STA in your simulation is using active probing, you should enable it at a different simulation time for each STA, otherwise all the STAs will start sending probes at the same time resulting in collisions. See bug 1060 for more info.",
BooleanValue (false),
- MakeBooleanAccessor (&StaWifiMac::SetActiveProbing),
+ MakeBooleanAccessor (&StaWifiMac::SetActiveProbing, &StaWifiMac::GetActiveProbing),
MakeBooleanChecker ())
.AddTraceSource ("Assoc", "Associated with an access point.",
MakeTraceSourceAccessor (&StaWifiMac::m_assocLogger))
@@ -152,6 +152,12 @@
{
m_probeRequestEvent.Cancel ();
}
+ m_activeProbing = enable;
+}
+
+bool StaWifiMac::GetActiveProbing (void) const
+{
+ return m_activeProbing;
}
void
@@ -250,8 +256,11 @@
* We try to initiate a probe request now.
*/
m_linkDown ();
- SetState (WAIT_PROBE_RESP);
- SendProbeRequest ();
+ if (m_activeProbing)
+ {
+ SetState (WAIT_PROBE_RESP);
+ SendProbeRequest ();
+ }
break;
case WAIT_ASSOC_RESP:
/* we have sent an assoc request so we do not need to
--- a/src/wifi/model/sta-wifi-mac.h Fri Jun 06 12:43:03 2014 -0700
+++ b/src/wifi/model/sta-wifi-mac.h Wed Jun 11 20:26:02 2014 -0700
@@ -187,6 +187,7 @@
EventId m_beaconWatchdog;
Time m_beaconWatchdogEnd;
uint32_t m_maxMissedBeacons;
+ bool m_activeProbing;
TracedCallback<Mac48Address> m_assocLogger;
TracedCallback<Mac48Address> m_deAssocLogger;