bug 440: fix build of tutorial example third.cc
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 10 Dec 2008 01:54:24 -0800
changeset 4004 b181e89d45f1
parent 4003 49a08376f196
child 4005 7ddad22e007a
bug 440: fix build of tutorial example third.cc
examples/third.cc
--- a/examples/third.cc	Wed Dec 10 01:47:59 2008 -0800
+++ b/examples/third.cc	Wed Dec 10 01:54:24 2008 -0800
@@ -75,20 +75,12 @@
   wifiStaNodes.Create (nWifi);
   NodeContainer wifiApNode = p2pNodes.Get (0);
 
-  Ptr<WifiChannel> channel = CreateObject<WifiChannel> ();
 
-  channel->SetPropagationDelayModel (
-    CreateObject<ConstantSpeedPropagationDelayModel> ());
-
-  Ptr<LogDistancePropagationLossModel> log = 
-    CreateObject<LogDistancePropagationLossModel> ();
-
-  log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
-
-  channel->SetPropagationLossModel (log);
+  YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
+  YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
+  phy.SetChannel (channel.Create ());
 
   WifiHelper wifi;
-  wifi.SetPhy ("ns3::WifiPhy");
   wifi.SetRemoteStationManager ("ns3::ArfWifiManager");
 
   Ssid ssid = Ssid ("ns-3-ssid");
@@ -97,7 +89,7 @@
     "ActiveProbing", BooleanValue (false));
 
   NetDeviceContainer staDevices;
-  staDevices = wifi.Install (wifiStaNodes, channel);
+  staDevices = wifi.Install (phy, wifiStaNodes);
 
   wifi.SetMac ("ns3::NqapWifiMac", 
     "Ssid", SsidValue (ssid),
@@ -105,7 +97,7 @@
     "BeaconInterval", TimeValue (Seconds (2.5)));
 
   NetDeviceContainer apDevices;
-  apDevices = wifi.Install (wifiApNode, channel);
+  apDevices = wifi.Install (phy, wifiApNode);
 
   MobilityHelper mobility;
 
@@ -163,7 +155,7 @@
 
   Simulator::Stop (Seconds (10.0));
 
-  WifiHelper::EnablePcap ("third", 
+  YansWifiPhyHelper::EnablePcap ("third", 
     wifiStaNodes.Get (nWifi - 1)->GetId (), 0);
   CsmaHelper::EnablePcap ("third", 
     csmaNodes.Get (nCsma)->GetId (), 0);