use Time for the beacon interval.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 31 Oct 2007 16:26:18 +0100
changeset 2058 1444e6708451
parent 2057 73723aad7527
child 2059 d8b7b2de044e
use Time for the beacon interval.
src/devices/wifi/mac-high-nqap.cc
src/devices/wifi/mac-high-nqap.h
--- a/src/devices/wifi/mac-high-nqap.cc	Wed Oct 31 13:17:45 2007 +0100
+++ b/src/devices/wifi/mac-high-nqap.cc	Wed Oct 31 16:26:18 2007 +0100
@@ -22,6 +22,7 @@
 #include "dca-txop.h"
 #include "wifi-net-device.h"
 #include "wifi-mac-header.h"
+#include "wifi-default-parameters.h"
 #include "mgt-headers.h"
 #include "wifi-phy.h"
 #include "ns3/assert.h"
@@ -36,7 +37,7 @@
 namespace ns3 {
 
 MacHighNqap::MacHighNqap ()
-  : m_beaconIntervalUs (500000)
+  : m_beaconInterval (WifiDefaultParameters::GetApBeaconInterval ())
 {}
 MacHighNqap::~MacHighNqap ()
 {
@@ -71,9 +72,9 @@
   m_forwardUp = callback;
 }
 void 
-MacHighNqap::SetBeaconIntervalUs (uint64_t us)
+MacHighNqap::SetBeaconInterval (Time interval)
 {
-  m_beaconIntervalUs = us;
+  m_beaconInterval = interval;
 }
 void 
 MacHighNqap::ForwardDown (Packet packet, Mac48Address from, Mac48Address to)
@@ -126,7 +127,7 @@
   MgtProbeResponseHeader probe;
   probe.SetSsid (m_device->GetSsid ());
   probe.SetSupportedRates (GetSupportedRates ());
-  probe.SetBeaconIntervalUs (m_beaconIntervalUs);
+  probe.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
   packet.AddHeader (probe);
 
   m_dca->Queue (packet, hdr);
--- a/src/devices/wifi/mac-high-nqap.h	Wed Oct 31 13:17:45 2007 +0100
+++ b/src/devices/wifi/mac-high-nqap.h	Wed Oct 31 16:26:18 2007 +0100
@@ -24,6 +24,7 @@
 #include "ns3/mac48-address.h"
 #include "ns3/callback.h"
 #include "ns3/packet.h"
+#include "ns3/nstime.h"
 #include "supported-rates.h"
 
 namespace ns3 {
@@ -46,7 +47,7 @@
   void SetStations (MacStations *stations);
   void SetPhy (Ptr<WifiPhy> phy);
   void SetForwardCallback (ForwardCallback callback);
-  void SetBeaconIntervalUs (uint64_t us);
+  void SetBeaconInterval (Time interval);
 
   void Queue (Packet packet, Mac48Address to);
 
@@ -64,7 +65,7 @@
   MacStations *m_stations;
   Ptr<WifiPhy> m_phy;
   ForwardCallback m_forwardUp;
-  uint64_t m_beaconIntervalUs;
+  Time m_beaconInterval;
 };
 
 } // namespace ns3