src/wifi/examples/test-interference-helper.cc
changeset 11460 fb2b8e22f5f4
parent 11455 978c1c341d74
child 11479 a3dcf66928f3
--- a/src/wifi/examples/test-interference-helper.cc	Tue Jun 23 14:40:12 2015 +0200
+++ b/src/wifi/examples/test-interference-helper.cc	Wed Jun 24 18:54:29 2015 +0200
@@ -123,7 +123,8 @@
 {
 }
 InterferenceExperiment::Input::Input ()
-  : xA (-5),
+  : interval (MicroSeconds (0)),
+    xA (-5),
     xB (5),
     txModeA ("OfdmRate54Mbps"),
     txModeB ("OfdmRate54Mbps"),
@@ -176,7 +177,7 @@
   rx->ConfigureStandard (input.standard);
 
   Simulator::Schedule (Seconds (0), &InterferenceExperiment::SendA, this);
-  Simulator::Schedule (Seconds (0) + MicroSeconds (input.interval), &InterferenceExperiment::SendB, this);
+  Simulator::Schedule (Seconds (0) + input.interval, &InterferenceExperiment::SendB, this);
 
   Simulator::Run ();
   Simulator::Destroy ();
@@ -188,9 +189,10 @@
   InterferenceExperiment::Input input;
   std::string str_standard = "WIFI_PHY_STANDARD_80211a";
   std::string str_preamble = "WIFI_PREAMBLE_LONG";
+  double delay = 0; //microseconds
 
   CommandLine cmd;
-  cmd.AddValue ("delay", "Delay in microseconds between frame transmission from sender A and frame transmission from sender B", input.interval);
+  cmd.AddValue ("delay", "Delay in microseconds between frame transmission from sender A and frame transmission from sender B", delay);
   cmd.AddValue ("xA", "The position of transmitter A (< 0)", input.xA);
   cmd.AddValue ("xB", "The position of transmitter B (> 0)", input.xB);
   cmd.AddValue ("packetSizeA", "Packet size in bytes of transmitter A", input.packetSizeA);
@@ -206,6 +208,8 @@
   LogComponentEnable ("YansWifiPhy", LOG_LEVEL_ALL);
   LogComponentEnable ("InterferenceHelper", LOG_LEVEL_ALL);
 
+  input.interval = MicroSeconds (delay);
+
   if (input.xA >= 0 || input.xB <= 0)
     {
       std::cout << "Value of xA must be smaller than 0 and value of xB must be bigger than 0!" << std::endl;