bug 1923: Patch for disabling active probe requests

This commit is contained in:
Unknown
2014-06-11 20:26:02 -07:00
parent ba584e1ac1
commit b9b6bacc5f
2 changed files with 13 additions and 3 deletions

View File

@@ -84,7 +84,7 @@ StaWifiMac::GetTypeId (void)
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 @@ StaWifiMac::SetActiveProbing (bool enable)
{
m_probeRequestEvent.Cancel ();
}
m_activeProbing = enable;
}
bool StaWifiMac::GetActiveProbing (void) const
{
return m_activeProbing;
}
void
@@ -250,8 +256,11 @@ StaWifiMac::TryToEnsureAssociated (void)
* 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

View File

@@ -187,6 +187,7 @@ private:
EventId m_beaconWatchdog;
Time m_beaconWatchdogEnd;
uint32_t m_maxMissedBeacons;
bool m_activeProbing;
TracedCallback<Mac48Address> m_assocLogger;
TracedCallback<Mac48Address> m_deAssocLogger;