diff --git a/CHANGES.html b/CHANGES.html
index 491fa858e..c68f32087 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -62,6 +62,7 @@ nodes to be placed outside of buildings defined in the scenario.
The Hash() method has been added to the QueueDiscItem class to compute the
hash of various fields of the packet header (depending on the packet type).
Added a priority queue disc (PrioQueueDisc).
+
Added a new trace source in StaWifiMac for tracing beacon arrivals
Changes to existing API:
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index e301f587e..8c8cff901 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -29,6 +29,7 @@ New user-visible features
The allocator places nodes randomly but in a manner that rejects positions
that are located within buildings defined in the scenario.
- (tcp) Added PRR as recovery algorithm
+- (wifi) Add a new trace source to StaWifiMac to trace beacon arrivals
Bugs fixed
----------
diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc
index dea42fd5d..46dfc3520 100644
--- a/src/wifi/model/sta-wifi-mac.cc
+++ b/src/wifi/model/sta-wifi-mac.cc
@@ -75,6 +75,10 @@ StaWifiMac::GetTypeId (void)
.AddTraceSource ("DeAssoc", "Association with an access point lost.",
MakeTraceSourceAccessor (&StaWifiMac::m_deAssocLogger),
"ns3::Mac48Address::TracedCallback")
+ .AddTraceSource ("BeaconArrival",
+ "Time of beacons arrival from associated AP",
+ MakeTraceSourceAccessor (&StaWifiMac::m_beaconArrival),
+ "ns3::Time::TracedCallback")
;
return tid;
}
@@ -604,6 +608,7 @@ StaWifiMac::Receive (Ptr packet, const WifiMacHeader *hdr)
}
if (goodBeacon && m_state == ASSOCIATED)
{
+ m_beaconArrival (Simulator::Now ());
Time delay = MicroSeconds (beacon.GetBeaconIntervalUs () * m_maxMissedBeacons);
RestartBeaconWatchdog (delay);
UpdateApInfoFromBeacon (beacon, hdr->GetAddr2 (), hdr->GetAddr3 ());
diff --git a/src/wifi/model/sta-wifi-mac.h b/src/wifi/model/sta-wifi-mac.h
index f5181edc6..7ff80d281 100644
--- a/src/wifi/model/sta-wifi-mac.h
+++ b/src/wifi/model/sta-wifi-mac.h
@@ -318,6 +318,7 @@ private:
TracedCallback m_assocLogger; ///< assoc logger
TracedCallback m_deAssocLogger; ///< deassoc logger
+ TracedCallback