29 #include <ns3/callback.h>
30 #include <ns3/config.h>
32 #include <ns3/names.h>
33 #include <ns3/satellite-phy-rx-carrier-packet-probe.h>
34 #include <ns3/simulator.h>
35 #include <ns3/traced-value.h>
37 NS_LOG_COMPONENT_DEFINE(
"SatPhyRxCarrierPacketProbe");
42 NS_OBJECT_ENSURE_REGISTERED(SatPhyRxCarrierPacketProbe);
48 TypeId(
"ns3::SatPhyRxCarrierPacketProbe")
50 .AddConstructor<SatPhyRxCarrierPacketProbe>()
51 .AddTraceSource(
"Output",
52 "The number of packets in the packet burst, its "
53 "associated socket address, and a status flag, that "
54 "serve as the output for this probe",
56 "ns3::SatPhyRxCarrierPacketProbe::RxStatusCallback")
57 .AddTraceSource(
"OutputUinteger",
58 "The number of packets",
60 "ns3::TracedValue::UintCallback")
61 .AddTraceSource(
"OutputBool",
64 "ns3::TracedValue::BoolCallback");
70 NS_LOG_FUNCTION(
this);
75 NS_LOG_FUNCTION(
this);
81 NS_LOG_FUNCTION(
this << nPackets << address << statusFlag);
82 m_output(nPackets, address, statusFlag);
93 const Address& address,
96 NS_LOG_FUNCTION(path << nPackets << address << statusFlag);
97 Ptr<SatPhyRxCarrierPacketProbe> probe = Names::Find<SatPhyRxCarrierPacketProbe>(path);
98 NS_ASSERT_MSG(probe,
"Error: Can't find probe for path " << path);
99 probe->SetValue(nPackets, address, statusFlag);
105 NS_LOG_FUNCTION(
this << traceSource << obj);
106 NS_LOG_DEBUG(
"Name of probe (if any) in names database: " << Names::FindPath(obj));
107 bool connected = obj->TraceConnectWithoutContext(
116 NS_LOG_FUNCTION(
this << path);
117 NS_LOG_DEBUG(
"Name of probe to search for in config database: " << path);
118 Config::ConnectWithoutContext(path,
125 NS_LOG_FUNCTION(
this << nPackets << address << statusFlag);
128 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.