31 #include <ns3/callback.h>
32 #include <ns3/config.h>
34 #include <ns3/names.h>
35 #include <ns3/simulator.h>
36 #include <ns3/traced-value.h>
40 NS_LOG_COMPONENT_DEFINE(
"SatSinrProbe");
45 NS_OBJECT_ENSURE_REGISTERED(SatSinrProbe);
51 TypeId(
"ns3::SatSinrProbe")
53 .AddConstructor<SatSinrProbe>()
56 "The SINR plus its socket address that serve as the output for this probe",
58 "ns3::SatSinrProbe::SinrCallback")
59 .AddTraceSource(
"OutputSinr",
62 "ns3::TracedValue::DoubleCallback");
68 NS_LOG_FUNCTION(
this);
73 NS_LOG_FUNCTION(
this);
79 NS_LOG_FUNCTION(
this << sinrDb << address);
89 NS_LOG_FUNCTION(path << sinrDb << address);
90 Ptr<SatSinrProbe> probe = Names::Find<SatSinrProbe>(path);
91 NS_ASSERT_MSG(probe,
"Error: Can't find probe for path " << path);
92 probe->SetValue(sinrDb, address);
98 NS_LOG_FUNCTION(
this << traceSource << obj);
99 NS_LOG_DEBUG(
"Name of probe (if any) in names database: " << Names::FindPath(obj));
101 obj->TraceConnectWithoutContext(traceSource,
109 NS_LOG_FUNCTION(
this << path);
110 NS_LOG_DEBUG(
"Name of probe to search for in config database: " << path);
117 NS_LOG_FUNCTION(
this << sinrDb << address);
Address m_address
The socket address for the traced packet.
void TraceSink(double sinrDb, const Address &address)
Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&.
TracedCallback< double, double > m_outputSinr
Output trace, previous SINR and current SINR.
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)
connect to a trace source attribute provided by a given object
virtual ~SatSinrProbe()
Destructor for SatSinrProbe.
SatSinrProbe()
Default constructor.
static void SetValueByPath(std::string path, double sinrDb, const Address &address)
Set a probe value by its name in the Config system.
TracedCallback< double, const Address & > m_output
Output trace, the SINR and source address.
void SetValue(double sinrDb, const Address &address)
Set a probe value.
static TypeId GetTypeId()
Get the type ID.
double m_sinr
The traced SINR.
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.