examples/mixed-wireless.cc
changeset 3912 4d1a61f80745
parent 3906 01acc159ffb1
child 4035 749cf964666a
--- a/examples/mixed-wireless.cc	Tue Nov 04 14:06:26 2008 +0100
+++ b/examples/mixed-wireless.cc	Tue Nov 04 14:06:34 2008 +0100
@@ -132,9 +132,12 @@
   // Create the backbone wifi net devices and install them into the nodes in 
   // our container
   //
+  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
+  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
+  wifiPhy.SetChannel (wifiChannel.Create ());
   WifiHelper wifi;
   wifi.SetMac ("ns3::AdhocWifiMac");
-  NetDeviceContainer backboneDevices = wifi.Install (backbone);
+  NetDeviceContainer backboneDevices = wifi.Install (wifiPhy, backbone);
   //
   // Add the IPv4 protocol stack to the nodes in our container
   //
@@ -243,7 +246,8 @@
       //
       WifiHelper wifiInfra;
       wifiInfra.SetMac ("ns3::AdhocWifiMac");
-      NetDeviceContainer infraDevices = wifiInfra.Install (infra);
+      wifiPhy.SetChannel (wifiChannel.Create ());
+      NetDeviceContainer infraDevices = wifiInfra.Install (wifiPhy, infra);
 
       // Add the IPv4 protocol stack to the nodes in our container
       //
@@ -330,14 +334,14 @@
   //
   std::ofstream ascii;
   ascii.open ("mixed-wireless.tr");
-  WifiHelper::EnableAsciiAll (ascii);
+  YansWifiPhyHelper::EnableAsciiAll (ascii);
   CsmaHelper::EnableAsciiAll (ascii);
   // Look at nodes 11, 13 only
   //WifiHelper::EnableAscii (ascii, 11, 0); 
   //WifiHelper::EnableAscii (ascii, 13, 0); 
 
   // Let's do a pcap trace on the backbone devices
-  WifiHelper::EnablePcap ("mixed-wireless", backboneDevices); 
+  YansWifiPhyHelper::EnablePcap ("mixed-wireless", backboneDevices); 
   // Let's additionally trace the application Sink, ifIndex 0
   CsmaHelper::EnablePcap ("mixed-wireless", appSink->GetId (), 0);