31#include "ns3/mobility-model.h" 
   32#include "ns3/net-device.h" 
   34#include "ns3/object.h" 
   35#include "ns3/packet.h" 
   36#include "ns3/pointer.h" 
   37#include "ns3/simulator.h" 
   38#include "ns3/string.h" 
   54                            .AddAttribute(
"PropagationModel",
 
   55                                          "A pointer to the propagation model.",
 
   58                                          MakePointerChecker<UanPropModel>())
 
   59                            .AddAttribute(
"NoiseModel",
 
   60                                          "A pointer to the model of the channel ambient noise.",
 
   63                                          MakePointerChecker<UanNoiseModel>());
 
  155        if (src == i->second)
 
  157            senderMobility = i->first->GetNode()->GetObject<
MobilityModel>();
 
  166        if (src != i->second)
 
  168            NS_LOG_DEBUG(
"Scheduling " << i->first->GetMac()->GetAddress());
 
  170            Time delay = 
m_prop->GetDelay(senderMobility, rcvrMobility, txMode);
 
  171            UanPdp pdp = 
m_prop->GetPdp(senderMobility, rcvrMobility, txMode);
 
  173                txPowerDb - 
m_prop->GetPathLossDb(senderMobility, rcvrMobility, txMode);
 
  176                         << txPowerDb << 
"dB, rxPowerDb=" << rxPowerDb << 
"dB, distance=" 
  177                         << senderMobility->GetDistanceFrom(rcvrMobility) << 
"m, delay=" << delay);
 
  179            uint32_t dstNodeId = i->first->GetNode()->GetId();
 
  206    m_devList[i].second->Receive(packet, rxPowerDb, txMode, pdp);
 
  213    double noise = 
m_noise->GetNoiseDbHz(fKhz);
 
Abstract Channel Base Class.
Keep track of the current position and velocity of an object.
virtual void DoDispose()
Destructor implementation.
Smart pointer class similar to boost::intrusive_ptr.
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Channel class used by UAN devices.
void SetNoiseModel(Ptr< UanNoiseModel > noise)
Set the noise model this channel will use to determine ambient channel noise.
double GetNoiseDbHz(double fKhz)
Get the noise level on the channel.
void AddDevice(Ptr< UanNetDevice > dev, Ptr< UanTransducer > trans)
Adds device to receiver list for this channel.
Ptr< UanPropModel > m_prop
The propagation model.
static TypeId GetTypeId()
Register this type.
Ptr< UanNoiseModel > m_noise
The noise model.
~UanChannel() override
Dummy destructor, see DoDispose.
void DoDispose() override
Destructor implementation.
virtual void TxPacket(Ptr< UanTransducer > src, Ptr< Packet > packet, double txPowerDb, UanTxMode txmode)
Send a packet out on the channel.
std::size_t GetNDevices() const override
bool m_cleared
Has Clear ever been called on the channel.
Ptr< NetDevice > GetDevice(std::size_t i) const override
UanDeviceList m_devList
The list of devices on this channel.
void SendUp(uint32_t i, Ptr< Packet > packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
Send a packet up to the receiving UanTransducer.
void Clear()
Clear all pointer references.
void SetPropagationModel(Ptr< UanPropModel > prop)
Set the propagation model this channel will use for path loss/propagation delay.
The power delay profile returned by propagation models.
Abstraction of packet modulation information.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
#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_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.