don't forget to setup propagation delay and loss models on channel.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sat, 15 Mar 2008 19:51:40 +0100
changeset 2616 0a4a35d30272
parent 2615 09e459167dc3
child 2617 0ecb3a9422e4
don't forget to setup propagation delay and loss models on channel.
samples/main-ap-wifi.cc
--- a/samples/main-ap-wifi.cc	Sat Mar 15 19:38:00 2008 +0100
+++ b/samples/main-ap-wifi.cc	Sat Mar 15 19:51:40 2008 +0100
@@ -38,6 +38,8 @@
 #include "ns3/string.h"
 #include "ns3/wifi-channel.h"
 #include "ns3/boolean.h"
+#include "ns3/propagation-loss-model.h"
+#include "ns3/propagation-delay-model.h"
 
 
 #include <iostream>
@@ -120,6 +122,11 @@
   ap.Create (1);
 
   Ptr<WifiChannel> channel = CreateObject<WifiChannel> ();
+  channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
+  Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
+  log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
+  channel->SetPropagationLossModel (log);
+
   Ssid ssid = Ssid ("wifi-default");
   wifi.SetPhy ("ns3::WifiPhy");
   wifi.SetRemoteStationManager ("ns3::ArfWifiManager");