INET Framework for OMNeT++/OMNEST
inet::physicallayer::Ieee80211ReceiverBase Class Reference

#include <Ieee80211ReceiverBase.h>

Inheritance diagram for inet::physicallayer::Ieee80211ReceiverBase:
inet::physicallayer::FlatReceiverBase inet::physicallayer::NarrowbandReceiverBase inet::physicallayer::SnirReceiverBase inet::physicallayer::ReceiverBase inet::physicallayer::IReceiver inet::IPrintableObject inet::physicallayer::Ieee80211DimensionalReceiver inet::physicallayer::Ieee80211ScalarReceiver

Public Member Functions

 Ieee80211ReceiverBase ()
 
virtual ~Ieee80211ReceiverBase ()
 
virtual const IReceptionResultcomputeReceptionResult (const IListening *listening, const IReception *reception, const IInterference *interference, const ISnir *snir, const std::vector< const IReceptionDecision * > *decisions) const override
 Returns the complete result of the reception process for the provided reception. More...
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const override
 Prints this object to the provided output stream. More...
 
virtual void setModeSet (const Ieee80211ModeSet *modeSet)
 
virtual void setBand (const IIeee80211Band *band)
 
virtual void setChannel (const Ieee80211Channel *channel)
 
virtual void setChannelNumber (int channelNumber)
 
- Public Member Functions inherited from inet::physicallayer::FlatReceiverBase
 FlatReceiverBase ()
 
virtual W getMinReceptionPower () const override
 Returns the minimum reception power below which successful reception is definitely not possible. More...
 
virtual const IListeningDecisioncomputeListeningDecision (const IListening *listening, const IInterference *interference) const override
 Returns the result of the listening process specifying the reception state of the receiver. More...
 
virtual const IErrorModelgetErrorModel () const
 
virtual W getEnergyDetection () const
 
virtual void setEnergyDetection (W energyDetection)
 
virtual W getSensitivity () const
 
virtual void setSensitivity (W sensitivity)
 
- Public Member Functions inherited from inet::physicallayer::NarrowbandReceiverBase
 NarrowbandReceiverBase ()
 
virtual const IListeningcreateListening (const IRadio *radio, const simtime_t startTime, const simtime_t endTime, const Coord &startPosition, const Coord &endPosition) const override
 Returns a description of how the receiver is listening on the medium. More...
 
virtual bool computeIsReceptionPossible (const IListening *listening, const ITransmission *transmission) const override
 Returns whether the reception of the provided transmission is possible or not independently of the reception conditions. More...
 
virtual const IReceptionDecisioncomputeReceptionDecision (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part, const IInterference *interference, const ISnir *snir) const override
 Returns the reception decision for the transmission part that specifies whether the reception is possible, attempted, and successful. More...
 
virtual const IModulationgetModulation () const
 
virtual void setModulation (const IModulation *modulation)
 
virtual Hz getCenterFrequency () const
 
virtual void setCenterFrequency (Hz centerFrequency)
 
virtual Hz getBandwidth () const
 
virtual void setBandwidth (Hz bandwidth)
 
- Public Member Functions inherited from inet::physicallayer::SnirReceiverBase
virtual double getSNIRThreshold () const
 
- Public Member Functions inherited from inet::physicallayer::ReceiverBase
 ReceiverBase ()
 
virtual W getMinInterferencePower () const override
 Returns the minimum interference power below which receptions are to be ignored while computing the interference. More...
 
virtual bool computeIsReceptionAttempted (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part, const IInterference *interference) const override
 Returns whether the reception of the provided part is actually attempted or ignored by the receiver. More...
 
- Public Member Functions inherited from inet::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string printToString () const
 
virtual std::string printToString (int level, int evFlags=0) const
 
virtual std::string getInfoStringRepresentation (int evFlags=0) const
 
virtual std::string getDetailStringRepresentation (int evFlags=0) const
 
virtual std::string getDebugStringRepresentation (int evFlags=0) const
 
virtual std::string getTraceStringRepresentation (int evFlags=0) const
 
virtual std::string getCompleteStringRepresentation (int evFlags=0) const
 

Protected Member Functions

virtual void initialize (int stage) override
 
- Protected Member Functions inherited from inet::physicallayer::FlatReceiverBase
virtual bool computeIsReceptionPossible (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part) const override
 Returns whether the reception of the provided part is possible or not. More...
 
virtual bool computeIsReceptionSuccessful (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part, const IInterference *interference, const ISnir *snir) const override
 Returns whether the reception of the provided part is actually successful or failed by the receiver. More...
 
virtual PacketcomputeReceivedPacket (const ISnir *snir, bool isReceptionSuccessful) const override
 
virtual bool computeIsReceptionPossible (const IListening *listening, const ITransmission *transmission) const override
 
virtual bool computeIsReceptionPossible (const IListening *listening, const IReception *reception, IRadioSignal::SignalPart part) const override
 
- Protected Member Functions inherited from inet::physicallayer::ReceiverBase
virtual int numInitStages () const override
 
virtual W computeSignalPower (const IListening *listening, const ISnir *snir, const IInterference *interference) const
 

Protected Attributes

const Ieee80211ModeSetmodeSet
 
const IIeee80211Bandband
 
const Ieee80211Channelchannel
 
- Protected Attributes inherited from inet::physicallayer::FlatReceiverBase
const IErrorModelerrorModel
 
W energyDetection
 
W sensitivity
 
- Protected Attributes inherited from inet::physicallayer::NarrowbandReceiverBase
const IModulationmodulation
 
Hz centerFrequency
 
Hz bandwidth
 
- Protected Attributes inherited from inet::physicallayer::SnirReceiverBase
double snirThreshold = NaN
 
SnirThresholdMode snirThresholdMode = SnirThresholdMode::STM_UNDEFINED
 

Additional Inherited Members

- Public Types inherited from inet::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
enum  PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0), PRINT_FLAG_MULTILINE = (1 << 1) }
 
- Protected Types inherited from inet::physicallayer::SnirReceiverBase
enum  SnirThresholdMode { SnirThresholdMode::STM_UNDEFINED = -1, SnirThresholdMode::STM_MIN, SnirThresholdMode::STM_MEAN }
 

Constructor & Destructor Documentation

◆ Ieee80211ReceiverBase()

inet::physicallayer::Ieee80211ReceiverBase::Ieee80211ReceiverBase ( )
19  :
20  modeSet(nullptr),
21  band(nullptr),
22  channel(nullptr)
23 {
24 }

◆ ~Ieee80211ReceiverBase()

inet::physicallayer::Ieee80211ReceiverBase::~Ieee80211ReceiverBase ( )
virtual
27 {
28  delete channel;
29 }

Member Function Documentation

◆ computeReceptionResult()

const IReceptionResult * inet::physicallayer::Ieee80211ReceiverBase::computeReceptionResult ( const IListening listening,
const IReception reception,
const IInterference interference,
const ISnir snir,
const std::vector< const IReceptionDecision * > *  decisions 
) const
overridevirtual

Returns the complete result of the reception process for the provided reception.

This function may be called before the reception actually starts at the receiver, thus it must be purely functional and support optimistic parallel computation.

Reimplemented from inet::physicallayer::FlatReceiverBase.

85 {
86  auto transmission = check_and_cast<const Ieee80211TransmissionBase *>(reception->getTransmission());
87  auto receptionResult = FlatReceiverBase::computeReceptionResult(listening, reception, interference, snir, decisions);
88  auto packet = const_cast<Packet *>(receptionResult->getPacket());
89  packet->addTagIfAbsent<Ieee80211ModeInd>()->setMode(transmission->getMode());
90  packet->addTagIfAbsent<Ieee80211ChannelInd>()->setChannel(transmission->getChannel());
91  return receptionResult;
92 }

◆ initialize()

void inet::physicallayer::Ieee80211ReceiverBase::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::physicallayer::FlatReceiverBase.

32 {
34  if (stage == INITSTAGE_LOCAL) {
35  const char *opMode = par("opMode");
36  setModeSet(*opMode ? Ieee80211ModeSet::getModeSet(opMode) : nullptr);
37  const char *bandName = par("bandName");
38  setBand(*bandName != '\0' ? Ieee80211CompliantBands::getBand(bandName) : nullptr);
39  int channelNumber = par("channelNumber");
40  if (channelNumber != -1)
41  setChannelNumber(channelNumber);
42  }
43 }

◆ printToStream()

std::ostream & inet::physicallayer::Ieee80211ReceiverBase::printToStream ( std::ostream &  stream,
int  level,
int  evFlags = 0 
) const
overridevirtual

◆ setBand()

void inet::physicallayer::Ieee80211ReceiverBase::setBand ( const IIeee80211Band band)
virtual
61 {
62  if (this->band != band) {
63  this->band = band;
64  if (channel != nullptr)
65  setChannel(new Ieee80211Channel(band, channel->getChannelNumber()));
66  }
67 }

Referenced by initialize(), and inet::physicallayer::Ieee80211Radio::setBand().

◆ setChannel()

void inet::physicallayer::Ieee80211ReceiverBase::setChannel ( const Ieee80211Channel channel)
virtual

◆ setChannelNumber()

void inet::physicallayer::Ieee80211ReceiverBase::setChannelNumber ( int  channelNumber)
virtual
79 {
80  if (channel == nullptr || channelNumber != channel->getChannelNumber())
81  setChannel(new Ieee80211Channel(band, channelNumber));
82 }

Referenced by initialize(), and inet::physicallayer::Ieee80211Radio::setChannelNumber().

◆ setModeSet()

void inet::physicallayer::Ieee80211ReceiverBase::setModeSet ( const Ieee80211ModeSet modeSet)
virtual
56 {
57  this->modeSet = modeSet;
58 }

Referenced by initialize(), and inet::physicallayer::Ieee80211Radio::setModeSet().

Member Data Documentation

◆ band

const IIeee80211Band* inet::physicallayer::Ieee80211ReceiverBase::band
protected

◆ channel

const Ieee80211Channel* inet::physicallayer::Ieee80211ReceiverBase::channel
protected

◆ modeSet


The documentation for this class was generated from the following files:
inet::physicallayer::Ieee80211ReceiverBase::setChannelNumber
virtual void setChannelNumber(int channelNumber)
Definition: Ieee80211ReceiverBase.cc:78
inet::physicallayer::Ieee80211ReceiverBase::setBand
virtual void setBand(const IIeee80211Band *band)
Definition: Ieee80211ReceiverBase.cc:60
inet::physicallayer::NarrowbandReceiverBase::setCenterFrequency
virtual void setCenterFrequency(Hz centerFrequency)
Definition: NarrowbandReceiverBase.h:45
inet::IPrintableObject::PRINT_LEVEL_INFO
@ PRINT_LEVEL_INFO
Definition: IPrintableObject.h:25
inet::physicallayer::Ieee80211ReceiverBase::band
const IIeee80211Band * band
Definition: Ieee80211ReceiverBase.h:23
inet::physicallayer::Ieee80211ReceiverBase::setModeSet
virtual void setModeSet(const Ieee80211ModeSet *modeSet)
Definition: Ieee80211ReceiverBase.cc:55
inet::physicallayer::Ieee80211CompliantBands::getBand
static const IIeee80211Band * getBand(const char *name)
Definition: Ieee80211Band.cc:87
inet::printFieldToString
std::string printFieldToString(const IPrintableObject *object, int level, int evFlags=0)
Definition: IPrintableObject.h:98
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::physicallayer::Ieee80211ReceiverBase::setChannel
virtual void setChannel(const Ieee80211Channel *channel)
Definition: Ieee80211ReceiverBase.cc:69
inet::physicallayer::Ieee80211Channel::getChannelNumber
virtual int getChannelNumber() const
Definition: Ieee80211Channel.h:29
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::physicallayer::FlatReceiverBase::initialize
virtual void initialize(int stage) override
Definition: FlatReceiverBase.cc:30
inet::IPrintableObject::PRINT_LEVEL_TRACE
@ PRINT_LEVEL_TRACE
Definition: IPrintableObject.h:22
inet::physicallayer::Ieee80211ReceiverBase::channel
const Ieee80211Channel * channel
Definition: Ieee80211ReceiverBase.h:24
inet::physicallayer::FlatReceiverBase::computeReceptionResult
virtual const IReceptionResult * computeReceptionResult(const IListening *listening, const IReception *reception, const IInterference *interference, const ISnir *snir, const std::vector< const IReceptionDecision * > *decisions) const override
Returns the complete result of the reception process for the provided reception.
Definition: FlatReceiverBase.cc:98
inet::evFlags
int evFlags
Definition: INETDefs.cc:12
inet::physicallayer::Ieee80211Channel::getCenterFrequency
virtual Hz getCenterFrequency() const
Definition: Ieee80211Channel.h:30
inet::physicallayer::Ieee80211ModeSet::getModeSet
static const Ieee80211ModeSet * getModeSet(const char *mode)
Definition: Ieee80211ModeSet.cc:611
inet::physicallayer::FlatReceiverBase::printToStream
virtual std::ostream & printToStream(std::ostream &stream, int level, int evFlags=0) const override
Prints this object to the provided output stream.
Definition: FlatReceiverBase.cc:40
inet::physicallayer::Ieee80211ReceiverBase::modeSet
const Ieee80211ModeSet * modeSet
Definition: Ieee80211ReceiverBase.h:22