18#include "ns3/mobility-model.h" 
   20#include "ns3/pointer.h" 
   21#include "ns3/propagation-delay-model.h" 
   22#include "ns3/propagation-loss-model.h" 
   23#include "ns3/simulator.h" 
   36        TypeId(
"ns3::YansWifiChannel")
 
   40            .AddAttribute(
"PropagationLossModel",
 
   41                          "A pointer to the propagation loss model attached to this channel.",
 
   45            .AddAttribute(
"PropagationDelayModel",
 
   46                          "A pointer to the propagation delay model attached to this channel.",
 
 
   89            if ((*i)->GetChannelNumber() != sender->GetChannelNumber())
 
   94            auto receiverMobility = (*i)->GetMobility()->GetObject<
MobilityModel>();
 
   95            const auto delay = 
m_delay->GetDelay(senderMobility, receiverMobility);
 
   96            const dBm_u rxPower{
m_loss->CalcRxPower(txPower, senderMobility, receiverMobility)};
 
   98                         << txPower << 
"dBm, rxPower=" << rxPower << 
"dBm, " 
   99                         << 
"distance=" << senderMobility->GetDistanceFrom(receiverMobility)
 
  100                         << 
"m, delay=" << delay);
 
  101            auto dstNetDevice = (*i)->GetDevice();
 
  105                dstNode = 0xffffffff;
 
  109                dstNode = dstNetDevice->GetNode()->GetId();
 
 
  126    const auto totalRxPower = rxPower + phy->GetRxGain();
 
  127    phy->TraceSignalArrival(ppdu, totalRxPower, ppdu->GetTxDuration());
 
  131    const auto txWidth = ppdu->GetTxChannelWidth();
 
  132    if (totalRxPower < phy->GetRxSensitivity() + 
RatioToDb(txWidth / 
MHz_u{20}))
 
  134        NS_LOG_INFO(
"Received signal too weak to process: " << rxPower << 
" dBm");
 
  141    phy->StartReceivePreamble(ppdu, rxPowerW, ppdu->GetTxDuration());
 
 
  167    int64_t currentStream = stream;
 
  168    currentStream += 
m_loss->AssignStreams(stream);
 
  169    return (currentStream - stream);
 
 
Abstract Channel Base Class.
Keep track of the current position and velocity of an object.
AttributeValue implementation for Pointer.
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.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
a channel to interconnect ns3::YansWifiPhy objects.
void SetPropagationLossModel(const Ptr< PropagationLossModel > loss)
Ptr< PropagationDelayModel > m_delay
Propagation delay model.
static void Receive(Ptr< YansWifiPhy > receiver, Ptr< const WifiPpdu > ppdu, dBm_u txPower)
This method is scheduled by Send for each associated YansWifiPhy.
~YansWifiChannel() override
static TypeId GetTypeId()
Get the type ID.
Ptr< NetDevice > GetDevice(std::size_t i) const override
PhyList m_phyList
List of YansWifiPhys connected to this YansWifiChannel.
Ptr< PropagationLossModel > m_loss
Propagation loss model.
std::size_t GetNDevices() const override
void Send(Ptr< YansWifiPhy > sender, Ptr< const WifiPpdu > ppdu, dBm_u txPower) const
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void SetPropagationDelayModel(const Ptr< PropagationDelayModel > delay)
void Add(Ptr< YansWifiPhy > phy)
Adds the given YansWifiPhy to the PHY list.
#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)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
#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_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#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.
dB_u RatioToDb(double ratio)
Convert from ratio to dB.
std::map< WifiSpectrumBandInfo, Watt_u > RxPowerWattPerChannelBand
A map of the received power for each band.
Watt_u DbmToW(dBm_u val)
Convert from dBm to Watts.
Declaration of ns3::WifiPpdu class and ns3::WifiConstPsduMap.