Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2008 INRIA | 3 * Copyright (c) 2008 INRIA |
4 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 17 matching lines...) Expand all Loading... | |
28 #include "ns3/log.h" | 28 #include "ns3/log.h" |
29 #include "ns3/pointer.h" | 29 #include "ns3/pointer.h" |
30 #include "ns3/radiotap-header.h" | 30 #include "ns3/radiotap-header.h" |
31 #include "ns3/config.h" | 31 #include "ns3/config.h" |
32 #include "ns3/names.h" | 32 #include "ns3/names.h" |
33 | 33 |
34 namespace ns3 { | 34 namespace ns3 { |
35 | 35 |
36 NS_LOG_COMPONENT_DEFINE ("WifiHelper"); | 36 NS_LOG_COMPONENT_DEFINE ("WifiHelper"); |
37 | 37 |
38 /** | |
39 * ASCII trace Phy transmit sink with context | |
40 * \param stream the output stream | |
41 * \param context the context name | |
42 * \param p the packet | |
43 * \param mode the wifi mode | |
44 * \param preamble the wifi preamble | |
45 * \param txLevel the transmit level | |
S. Deronne
2017/02/11 09:07:18
the transmit power level
| |
46 */ | |
38 static void | 47 static void |
39 AsciiPhyTransmitSinkWithContext ( | 48 AsciiPhyTransmitSinkWithContext ( |
40 Ptr<OutputStreamWrapper> stream, | 49 Ptr<OutputStreamWrapper> stream, |
41 std::string context, | 50 std::string context, |
42 Ptr<const Packet> p, | 51 Ptr<const Packet> p, |
43 WifiMode mode, | 52 WifiMode mode, |
44 WifiPreamble preamble, | 53 WifiPreamble preamble, |
45 uint8_t txLevel) | 54 uint8_t txLevel) |
46 { | 55 { |
47 NS_LOG_FUNCTION (stream << context << p << mode << preamble << txLevel); | 56 NS_LOG_FUNCTION (stream << context << p << mode << preamble << txLevel); |
48 *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << con text << " " << *p << std::endl; | 57 *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << con text << " " << *p << std::endl; |
49 } | 58 } |
50 | 59 |
60 /** | |
61 * ASCII trace Phy transmit sink without context | |
62 * \param stream the output stream | |
63 * \param p the packet | |
64 * \param mode the wifi mode | |
65 * \param preamble the wifi preamble | |
66 * \param txLevel the transmit level | |
S. Deronne
2017/02/11 09:07:17
the transmit power level
| |
67 */ | |
51 static void | 68 static void |
52 AsciiPhyTransmitSinkWithoutContext ( | 69 AsciiPhyTransmitSinkWithoutContext ( |
53 Ptr<OutputStreamWrapper> stream, | 70 Ptr<OutputStreamWrapper> stream, |
54 Ptr<const Packet> p, | 71 Ptr<const Packet> p, |
55 WifiMode mode, | 72 WifiMode mode, |
56 WifiPreamble preamble, | 73 WifiPreamble preamble, |
57 uint8_t txLevel) | 74 uint8_t txLevel) |
58 { | 75 { |
59 NS_LOG_FUNCTION (stream << p << mode << preamble << txLevel); | 76 NS_LOG_FUNCTION (stream << p << mode << preamble << txLevel); |
60 *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << *p << std::endl; | 77 *stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << *p << std::endl; |
61 } | 78 } |
62 | 79 |
80 /** | |
81 * ASCII trace Phy receive sink with context | |
82 * \param stream the output stream | |
83 * \param context the context name | |
84 * \param p the packet | |
85 * \param snr the SNR | |
86 * \param mode the wifi mode | |
87 * \param preamble the wifi preamble | |
88 */ | |
63 static void | 89 static void |
64 AsciiPhyReceiveSinkWithContext ( | 90 AsciiPhyReceiveSinkWithContext ( |
65 Ptr<OutputStreamWrapper> stream, | 91 Ptr<OutputStreamWrapper> stream, |
66 std::string context, | 92 std::string context, |
67 Ptr<const Packet> p, | 93 Ptr<const Packet> p, |
68 double snr, | 94 double snr, |
69 WifiMode mode, | 95 WifiMode mode, |
70 enum WifiPreamble preamble) | 96 enum WifiPreamble preamble) |
71 { | 97 { |
72 NS_LOG_FUNCTION (stream << context << p << snr << mode << preamble); | 98 NS_LOG_FUNCTION (stream << context << p << snr << mode << preamble); |
73 *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << con text << " " << *p << std::endl; | 99 *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << con text << " " << *p << std::endl; |
74 } | 100 } |
75 | 101 |
102 /** | |
103 * ASCII trace Phy receive sink without context | |
104 * \param stream the output stream | |
105 * \param p the packet | |
106 * \param snr the SNR | |
107 * \param mode the wifi mode | |
108 * \param preamble the wifi preamble | |
109 */ | |
76 static void | 110 static void |
77 AsciiPhyReceiveSinkWithoutContext ( | 111 AsciiPhyReceiveSinkWithoutContext ( |
78 Ptr<OutputStreamWrapper> stream, | 112 Ptr<OutputStreamWrapper> stream, |
79 Ptr<const Packet> p, | 113 Ptr<const Packet> p, |
80 double snr, | 114 double snr, |
81 WifiMode mode, | 115 WifiMode mode, |
82 enum WifiPreamble preamble) | 116 enum WifiPreamble preamble) |
83 { | 117 { |
84 NS_LOG_FUNCTION (stream << p << snr << mode << preamble); | 118 NS_LOG_FUNCTION (stream << p << snr << mode << preamble); |
85 *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << *p << std::endl; | 119 *stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << *p << std::endl; |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
856 { | 890 { |
857 currentStream += apmac->AssignStreams (currentStream); | 891 currentStream += apmac->AssignStreams (currentStream); |
858 } | 892 } |
859 } | 893 } |
860 } | 894 } |
861 } | 895 } |
862 return (currentStream - stream); | 896 return (currentStream - stream); |
863 } | 897 } |
864 | 898 |
865 } //namespace ns3 | 899 } //namespace ns3 |
OLD | NEW |