Fix a couple of Python examples

This commit is contained in:
Gustavo J. A. M. Carneiro
2010-04-16 15:06:54 +01:00
parent 52e078aecd
commit 4bae5d0289
2 changed files with 5 additions and 9 deletions

View File

@@ -92,13 +92,13 @@ def main(argv):
apps.Stop(ns3.Seconds(20.0));
print "Tracing"
ascii = ns3.ofstream("simple-routing-ping6.tr");
ns3.CsmaHelper.EnableAsciiAll(ascii);
ns3.CsmaHelper.EnablePcapAll("simple-routing-ping6", True);
ascii = ns3.AsciiTraceHelper()
csma.EnableAsciiAll(ascii.CreateFileStream("simple-routing-ping6.tr"))
csma.EnablePcapAll("simple-routing-ping6", True)
# Run Simulation
ns3.Simulator.Run();
ns3.Simulator.Destroy();
ns3.Simulator.Run()
ns3.Simulator.Destroy()
if __name__ == '__main__':
import sys

View File

@@ -156,13 +156,9 @@ def main(argv):
# Config::Connect("/NodeList/*/DeviceList/*/Phy/Tx", MakeCallback(&PhyTxTrace));
# Config::Connect("/NodeList/*/DeviceList/*/Phy/State", MakeCallback(&PhyStateTrace));
ascii = ns3.ofstream("wifi-ap.tr")
ns3.YansWifiPhyHelper.EnableAsciiAll(ascii)
ns3.Simulator.Run()
ns3.Simulator.Destroy()
ascii.close()
return 0