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(
"SatPhyRxCarrierPacketProbe");
45 NS_OBJECT_ENSURE_REGISTERED(SatPhyRxCarrierPacketProbe);
51 TypeId(
"ns3::SatPhyRxCarrierPacketProbe")
53 .AddConstructor<SatPhyRxCarrierPacketProbe>()
54 .AddTraceSource(
"Output",
55 "The number of packets in the packet burst, its "
56 "associated socket address, and a status flag, that "
57 "serve as the output for this probe",
59 "ns3::SatPhyRxCarrierPacketProbe::RxStatusCallback")
60 .AddTraceSource(
"OutputUinteger",
61 "The number of packets",
63 "ns3::TracedValue::UintCallback")
64 .AddTraceSource(
"OutputBool",
67 "ns3::TracedValue::BoolCallback");
73 NS_LOG_FUNCTION(
this);
78 NS_LOG_FUNCTION(
this);
84 NS_LOG_FUNCTION(
this << nPackets << address << statusFlag);
85 m_output(nPackets, address, statusFlag);
96 const Address& address,
99 NS_LOG_FUNCTION(path << nPackets << address << statusFlag);
100 Ptr<SatPhyRxCarrierPacketProbe> probe = Names::Find<SatPhyRxCarrierPacketProbe>(path);
101 NS_ASSERT_MSG(probe,
"Error: Can't find probe for path " << path);
102 probe->SetValue(nPackets, address, statusFlag);
108 NS_LOG_FUNCTION(
this << traceSource << obj);
109 NS_LOG_DEBUG(
"Name of probe (if any) in names database: " << Names::FindPath(obj));
110 bool connected = obj->TraceConnectWithoutContext(
119 NS_LOG_FUNCTION(
this << path);
120 NS_LOG_DEBUG(
"Name of probe to search for in config database: " << path);
121 Config::ConnectWithoutContext(path,
128 NS_LOG_FUNCTION(
this << nPackets << address << statusFlag);
131 m_output(nPackets, address, statusFlag);
SatPhyRxCarrierPacketProbe()
Default constructor.
bool m_statusFlag
The traced packet burst status flag.
uint32_t m_nPackets
The traced number of packets in the packet burst.
TracedCallback< uint32_t, const Address &, bool > m_output
Output trace, the number of packets, source address, and status flag.
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)
connect to a trace source attribute provided by a given object
void SetValue(uint32_t nPackets, const Address &address, bool statusFlag)
Set a probe value.
TracedCallback< uint32_t, uint32_t > m_outputUinteger
Output trace, previous and current number of packets.
static TypeId GetTypeId()
Get the type ID.
virtual ~SatPhyRxCarrierPacketProbe()
Destructor for SatPhyRxCarrierPacketProbe.
static void SetValueByPath(std::string path, uint32_t nPackets, const Address &address, bool statusFlag)
Set a probe value by its name in the Config system.
Address m_address
The socket address for the traced packet burst.
void TraceSink(uint32_t nPackets, const Address &address, bool statusFlag)
Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&.
TracedCallback< bool, bool > m_outputBool
Output trace, previous and current status flag.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.