22 #include "ns3/simulator.h"
23 #include "ns3/uan-prop-model.h"
27 #include "ns3/pointer.h"
40 m_endTxTime (Seconds (0)),
63 UanPhyList::iterator it =
m_phyList.begin ();
75 ait->GetPacket () = 0;
93 .AddConstructor<UanTransducerHd> ()
143 UanPhyList::const_iterator it =
m_phyList.begin ();
147 (*it)->StartRxPacket (packet, rxPowerDb, txMode, pdp);
161 src->NotifyTxDrop(packet);
166 src->NotifyTxBegin(packet);
172 << delay <<
" seconds for packet size "
173 << packet->
GetSize () <<
" bytes and rate = "
175 UanPhyList::const_iterator it =
m_phyList.begin ();
180 (*it)->NotifyTransStartTx (packet, txPowerDb, txMode);
232 if (it->GetPacket () == arrival.
GetPacket ())
238 UanPhyList::const_iterator ait =
m_phyList.begin ();
241 (*ait)->NotifyIntChange ();
static TypeId GetTypeId(void)
Register this type.
keep track of time values and allow control of global simulation resolution
EventId m_endTxEvent
Event scheduled for end of transmission.
void EndTx(void)
Handle end of transmission event.
std::list< Ptr< UanPhy > > UanPhyList
List of UanPhy objects.
virtual const UanPhyList & GetPhyList(void) const
Get the list of physical layer above this transducer.
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
uint32_t GetSize(void) const
virtual bool IsTx(void) const
Is the state transmitting?
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
ArrivalList m_arrivalList
List of arriving packets which overlap in time.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
Ptr< UanChannel > m_channel
The attached channel.
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.
bool m_cleared
Flab when we've been cleared.
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Ptr< Packet > GetPacket(void) const
Get the arriving packet.
virtual Ptr< UanChannel > GetChannel(void) const
Get the attached channel.
virtual ~UanTransducerHd()
Dummy destructor, see DoDispose.
uint32_t GetDataRateBps(void) const
Get the data rate of the transmit mode.
The power delay profile returned by propagation models.
Abstraction of packet modulation information.
Virtual base for Transducer objects.
std::list< UanPacketArrival > ArrivalList
List of arriving packets overlapping in time.
virtual const ArrivalList & GetArrivalList(void) const
Get the list of overlapped (in time) packets at this transducer.
UanTransducerHd()
Constructor.
static void Remove(const EventId &id)
Remove an event from the event list.
void RemoveArrival(UanPacketArrival arrival)
Remove an entry from the arrival list.
Time m_endTxTime
Time at which transmission will be completed.
static Time Now(void)
Return the "current simulation time".
virtual void SetChannel(Ptr< UanChannel > chan)
Attach this transducer to a channel.
virtual void AddPhy(Ptr< UanPhy >)
Attach a physical network layer above this transducer.
NS_LOG_COMPONENT_DEFINE("UanTransducerHd")
virtual void Clear(void)
Clears all pointer references.
#define NS_LOG_DEBUG(msg)
virtual State GetState(void) const
Get the transducer state.
UanPhyList m_phyList
List of physical layers attached above this tranducer.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::cancel method.
a base class which provides memory management and object aggregation
virtual void Transmit(Ptr< UanPhy > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
Transmit a packet from this transducer.
virtual bool IsRx(void) const
Is the state receiving (or available for reception)?
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void NotifyTxEnd(Ptr< const Packet > packet)
Called when the transducer finishes transmitting a packet.
State m_state
Transducer state.
Class consisting of packet arrival information (Time, RxPower, mode, PDP).