26 #include "ns3/double.h"
28 #include "ns3/pointer.h"
29 #include "ns3/simulator.h"
77 ait->GetPacket() =
nullptr;
98 .AddAttribute(
"RxGainDb",
99 "Gain in Db added to incoming signal at receiver.",
102 MakeDoubleChecker<double>());
147 NS_LOG_DEBUG(
"Rx power after RX gain = " << rxPowerDb <<
" db re uPa");
171 (*it)->StartRxPacket(packet, rxPowerDb, txMode, pdp);
182 src->NotifyTxDrop(packet);
187 src->NotifyTxBegin(packet);
192 << delay <<
" seconds for packet size " << packet->
GetSize()
199 (*it)->NotifyTransStartTx(packet, txPowerDb, txMode);
251 if (it->GetPacket() == arrival.
GetPacket())
260 (*ait)->NotifyIntChange();
This class can be used to hold variables of floating point type such as 'double' or 'float'.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
virtual void DoDispose()
Destructor implementation.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now()
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Class consisting of packet arrival information (Time, RxPower, mode, PDP).
Ptr< Packet > GetPacket() const
Get the arriving packet.
The power delay profile returned by propagation models.
void NotifyTxEnd(Ptr< const Packet > packet)
Called when the transducer finishes transmitting a packet.
Half duplex implementation of transducer object.
void EndTx()
Handle end of transmission event.
State GetState() const override
Get the transducer state.
void SetChannel(Ptr< UanChannel > chan) override
Attach this transducer to a channel.
void Clear() override
Clears all pointer references.
bool IsTx() const override
Is the state transmitting?
Ptr< UanChannel > GetChannel() const override
Get the attached channel.
State m_state
Transducer state.
bool m_cleared
Flab when we've been cleared.
static TypeId GetTypeId()
Register this type.
void Transmit(Ptr< UanPhy > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txMode) override
Transmit a packet from this transducer.
double m_rxGainDb
Receive gain in dB.
Ptr< UanChannel > m_channel
The attached channel.
const UanPhyList & GetPhyList() const override
Get the list of physical layer above this transducer.
ArrivalList m_arrivalList
List of arriving packets which overlap in time.
~UanTransducerHd() override
Dummy destructor, see DoDispose.
void RemoveArrival(UanPacketArrival arrival)
Remove an entry from the arrival list.
void SetRxGainDb(double gainDb) override
Set the receiver gain.
bool IsRx() const override
Is the state receiving (or available for reception)?
EventId m_endTxEvent
Event scheduled for end of transmission.
void AddPhy(Ptr< UanPhy >) override
Attach a physical network layer above this transducer.
double GetRxGainDb() override
Get the receiver gain added to signal at receiver in dB.
double ApplyRxGainDb(double rxPowerDb, UanTxMode mode) override
Apply receiver gain in dB to the received power.
UanTransducerHd()
Constructor.
void Receive(Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp) override
Notify this object that a new packet has arrived at this nodes location.
Time m_endTxTime
Time at which transmission will be completed.
void DoDispose() override
Destructor implementation.
const ArrivalList & GetArrivalList() const override
Get the list of overlapped (in time) packets at this transducer.
UanPhyList m_phyList
List of physical layers attached above this tranducer.
Virtual base for Transducer objects.
std::list< Ptr< UanPhy > > UanPhyList
List of UanPhy objects.
std::list< UanPacketArrival > ArrivalList
List of arriving packets overlapping in time.
Abstraction of packet modulation information.
uint32_t GetDataRateBps() const
Get the data rate of the transmit mode.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Now()
create an ns3::Time instance which contains the current simulation time.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
@ RX
The PHY layer is receiving a packet.