Half duplex implementation of transducer object. More...
#include <uan-transducer-hd.h>
Public Member Functions | |
UanTransducerHd () | |
virtual | ~UanTransducerHd () |
virtual void | AddPhy (Ptr< UanPhy >) |
virtual void | Clear (void) |
virtual const ArrivalList & | GetArrivalList (void) const |
virtual Ptr< UanChannel > | GetChannel (void) const |
virtual const UanPhyList & | GetPhyList (void) const |
virtual State | GetState (void) const |
virtual bool | IsRx (void) const |
virtual bool | IsTx (void) const |
virtual void | Receive (Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp) |
Receive Notify this object that a new packet has arrived at this nodes location. | |
virtual void | SetChannel (Ptr< UanChannel > chan) |
virtual void | Transmit (Ptr< UanPhy > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txMode) |
Transmit a packet from this transducer. |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Protected Member Functions | |
virtual void | DoDispose () |
Private Member Functions | |
void | EndTx (void) |
void | RemoveArrival (UanPacketArrival arrival) |
Private Attributes | |
ArrivalList | m_arrivalList |
Ptr< UanChannel > | m_channel |
bool | m_cleared |
EventId | m_endTxEvent |
Time | m_endTxTime |
UanPhyList | m_phyList |
State | m_state |
Additional Inherited Members | |
![]() | |
typedef std::list < UanPacketArrival > | ArrivalList |
Arrival list is a standard template library list of UanPacketArrivals objects. | |
enum | State { TX, RX } |
Transducer state (receiving or transmitting) More... | |
typedef std::list< Ptr< UanPhy > > | UanPhyList |
UanPhyList is a standard template library list of UanPhy objects. |
Half duplex implementation of transducer object.
This type is not accessible from the Config system.
No Attributes are defined for this type.
No TraceSources are defined for this type.
This class will only allow attached Phy's to receive packets if not in TX mode
Definition at line 34 of file uan-transducer-hd.h.
ns3::UanTransducerHd::UanTransducerHd | ( | ) |
Definition at line 35 of file uan-transducer-hd.cc.
|
virtual |
Definition at line 43 of file uan-transducer-hd.cc.
phy | Add phy above this transducer (may connect > 1 Phy to a transducer) |
Implements ns3::UanTransducer.
Definition at line 213 of file uan-transducer-hd.cc.
References m_phyList.
|
virtual |
Clears all pointer references
Implements ns3::UanTransducer.
Definition at line 48 of file uan-transducer-hd.cc.
References ns3::EventId::Cancel(), ns3::UanChannel::Clear(), m_arrivalList, m_channel, m_cleared, m_endTxEvent, and m_phyList.
Referenced by DoDispose().
|
protectedvirtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
It is safe to call GetObject from within this method.
Reimplemented from ns3::Object.
Definition at line 81 of file uan-transducer-hd.cc.
References Clear().
|
private |
Definition at line 194 of file uan-transducer-hd.cc.
References m_endTxTime, m_state, NS_ASSERT, ns3::UanTransducer::RX, ns3::Seconds(), and ns3::UanTransducer::TX.
Referenced by Transmit().
|
virtual |
Implements ns3::UanTransducer.
Definition at line 117 of file uan-transducer-hd.cc.
References m_arrivalList.
|
virtual |
Implements ns3::UanTransducer.
Definition at line 208 of file uan-transducer-hd.cc.
References m_channel.
|
virtual |
Implements ns3::UanTransducer.
Definition at line 219 of file uan-transducer-hd.cc.
References m_phyList.
|
virtual |
Implements ns3::UanTransducer.
Definition at line 97 of file uan-transducer-hd.cc.
References m_state.
|
static |
Reimplemented from ns3::UanTransducer.
Definition at line 87 of file uan-transducer-hd.cc.
References ns3::TypeId::SetParent().
|
virtual |
Implements ns3::UanTransducer.
Definition at line 104 of file uan-transducer-hd.cc.
References m_state, and ns3::UanTransducer::RX.
|
virtual |
Implements ns3::UanTransducer.
Definition at line 110 of file uan-transducer-hd.cc.
References m_state, and ns3::UanTransducer::TX.
|
virtual |
Receive Notify this object that a new packet has arrived at this nodes location.
packet | Packet arriving |
rxPowerDb | Signal power in dB of arriving packet |
txMode | Mode arriving packet is using |
pdp | PDP of arriving signal |
Implements ns3::UanTransducer.
Definition at line 123 of file uan-transducer-hd.cc.
References ns3::UanTxMode::GetDataRateBps(), ns3::Packet::GetSize(), m_arrivalList, m_phyList, m_state, ns3::Simulator::Now(), NS_LOG_DEBUG, RemoveArrival(), ns3::UanTransducer::RX, ns3::Simulator::Schedule(), and ns3::Seconds().
|
private |
Definition at line 225 of file uan-transducer-hd.cc.
References ns3::UanPacketArrival::GetPacket(), m_arrivalList, and m_phyList.
Referenced by Receive().
|
virtual |
chan | Channel this transducer is attached to |
Implements ns3::UanTransducer.
Definition at line 201 of file uan-transducer-hd.cc.
References m_channel, and NS_LOG_DEBUG.
|
virtual |
Transmit a packet from this transducer.
src | Source PHY |
packet | Packet to transmit |
txPowerDb | Outgoing Tx power of packet |
txMode | Mode to transmit packet with. |
Implements ns3::UanTransducer.
Definition at line 151 of file uan-transducer-hd.cc.
References EndTx(), ns3::UanTxMode::GetDataRateBps(), ns3::Packet::GetSize(), m_channel, m_endTxEvent, m_endTxTime, m_phyList, m_state, ns3::UanPhy::NotifyTxBegin(), ns3::UanPhy::NotifyTxDrop(), ns3::UanPhy::NotifyTxEnd(), ns3::Now(), ns3::Simulator::Now(), NS_LOG_DEBUG, ns3::Simulator::Remove(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::UanTransducer::TX, and ns3::UanChannel::TxPacket().
|
private |
Definition at line 57 of file uan-transducer-hd.h.
Referenced by Clear(), GetArrivalList(), Receive(), and RemoveArrival().
|
private |
Definition at line 59 of file uan-transducer-hd.h.
Referenced by Clear(), GetChannel(), SetChannel(), and Transmit().
|
private |
Definition at line 62 of file uan-transducer-hd.h.
Referenced by Clear().
|
private |
Definition at line 60 of file uan-transducer-hd.h.
Referenced by Clear(), and Transmit().
|
private |
Definition at line 61 of file uan-transducer-hd.h.
Referenced by EndTx(), and Transmit().
|
private |
Definition at line 58 of file uan-transducer-hd.h.
Referenced by AddPhy(), Clear(), GetPhyList(), Receive(), RemoveArrival(), and Transmit().
|
private |
Definition at line 56 of file uan-transducer-hd.h.
Referenced by EndTx(), GetState(), IsRx(), IsTx(), Receive(), and Transmit().