samples/main-adhoc-wifi.cc
changeset 2494 1c69ea12779c
parent 2470 254581fb9e9c
child 2524 db72c0e7743e
--- a/samples/main-adhoc-wifi.cc	Tue Feb 26 23:27:19 2008 +0100
+++ b/samples/main-adhoc-wifi.cc	Wed Feb 27 00:05:23 2008 +0100
@@ -33,6 +33,7 @@
 #include "ns3/socket-factory.h"
 #include "ns3/command-line.h"
 #include "ns3/gnuplot.h"
+#include "ns3/uinteger.h"
 
 
 #include <iostream>
@@ -122,12 +123,15 @@
   destination.SetProtocol (1);
   destination.SetSingleDevice (0);
   destination.SetPhysicalAddress (Mac48Address ("00:00:00:00:00:02"));
-  Ptr<Application> app = CreateObject<OnOffApplication> (a, destination, 
-                                                   "Packet", 
-                                                   ConstantVariable (250),
-                                                   ConstantVariable (0),
-                                                   DataRate (60000000),
-                                                   2000);
+  Ptr<Application> app = 
+    CreateObjectWith<OnOffApplication> ("Node", a, 
+                                        "Remote", Address (destination),
+                                        "Protocol", TypeId::LookupByName ("Packet"),
+                                        "OnTime", ConstantVariable (250),
+                                        "OffTime", ConstantVariable (0),
+                                        "DataRate", DataRate (60000000),
+                                        "PacketSize", Uinteger (2000));
+  a->AddApplication (app);
 
   app->Start (Seconds (0.5));
   app->Stop (Seconds (250.0));