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