# HG changeset patch # User Tom Henderson # Date 1496155074 25200 # Tue May 30 07:37:54 2017 -0700 # Node ID 0117c320c44bad9c124fc2ea02c6eb45e1268a35 # Parent 32173758feb37e63087c07809e7398fd7e996b42 add ascii trace option to mesh.cc example diff -r 32173758feb3 -r 0117c320c44b src/mesh/examples/mesh.cc --- a/src/mesh/examples/mesh.cc Tue May 30 07:31:56 2017 -0700 +++ b/src/mesh/examples/mesh.cc Tue May 30 07:37:54 2017 -0700 @@ -85,6 +85,7 @@ uint32_t m_nIfaces; ///< number interfaces bool m_chan; ///< channel bool m_pcap; ///< PCAP + bool m_ascii; ///< ASCII std::string m_stack; ///< stack std::string m_root; ///< root /// List of network nodes @@ -116,6 +117,7 @@ m_nIfaces (1), m_chan (true), m_pcap (false), + m_ascii (false), m_stack ("ns3::Dot11sStack"), m_root ("ff:ff:ff:ff:ff:ff") { @@ -135,12 +137,17 @@ cmd.AddValue ("interfaces", "Number of radio interfaces used by each mesh point", m_nIfaces); cmd.AddValue ("channels", "Use different frequency channels for different interfaces", m_chan); cmd.AddValue ("pcap", "Enable PCAP traces on interfaces", m_pcap); + cmd.AddValue ("ascii", "Enable Ascii traces on interfaces", m_ascii); cmd.AddValue ("stack", "Type of protocol stack. ns3::Dot11sStack by default", m_stack); cmd.AddValue ("root", "Mac address of root mesh point in HWMP", m_root); cmd.Parse (argc, argv); NS_LOG_DEBUG ("Grid:" << m_xSize << "*" << m_ySize); NS_LOG_DEBUG ("Simulation time: " << m_totalTime << " s"); + if (m_ascii) + { + PacketMetadata::Enable (); + } } void MeshTest::CreateNodes () @@ -195,6 +202,11 @@ mobility.Install (nodes); if (m_pcap) wifiPhy.EnablePcapAll (std::string ("mp-")); + if (m_ascii) + { + AsciiTraceHelper ascii; + wifiPhy.EnableAsciiAll (ascii.CreateFileStream ("mesh.tr")); + } } void MeshTest::InstallInternetStack () diff -r 32173758feb3 -r 0117c320c44b src/mesh/test/examples-to-run.py --- a/src/mesh/test/examples-to-run.py Tue May 30 07:31:56 2017 -0700 +++ b/src/mesh/test/examples-to-run.py Tue May 30 07:37:54 2017 -0700 @@ -8,7 +8,7 @@ # # See test.py for more information. cpp_examples = [ - ("mesh", "True", "True"), + ("mesh --ascii", "True", "True"), ] # A list of Python examples to run in order to ensure that they remain