INET Framework for OMNeT++/OMNEST
inet::physicallayer::IRadio Class Referenceabstract

This interface represents a physical device that is capable of transmitting and receiving radio signals. More...

#include <IRadio.h>

Inheritance diagram for inet::physicallayer::IRadio:
inet::IPhysicalLayer inet::IPrintableObject inet::physicallayer::NoiseSource inet::physicallayer::Radio inet::physicallayer::ShortcutRadio inet::physicallayer::NarrowbandRadioBase inet::physicallayer::UnitDiskRadio inet::physicallayer::FlatRadioBase inet::physicallayer::ApskRadio inet::physicallayer::Ieee80211OfdmRadio inet::physicallayer::Ieee80211Radio

Public Types

enum  RadioMode {
  RADIO_MODE_OFF, RADIO_MODE_SLEEP, RADIO_MODE_RECEIVER, RADIO_MODE_TRANSMITTER,
  RADIO_MODE_TRANSCEIVER, RADIO_MODE_SWITCHING
}
 This enumeration specifies the requested operational mode of the radio. More...
 
enum  ReceptionState { RECEPTION_STATE_UNDEFINED, RECEPTION_STATE_IDLE, RECEPTION_STATE_BUSY, RECEPTION_STATE_RECEIVING }
 This enumeration specifies the reception state of the radio. More...
 
enum  TransmissionState { TRANSMISSION_STATE_UNDEFINED, TRANSMISSION_STATE_IDLE, TRANSMISSION_STATE_TRANSMITTING }
 This enumeration specifies the transmission state of the radio. More...
 
- 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) }
 

Public Member Functions

virtual const cGate * getRadioGate () const =0
 Returns the gate of the radio that receives incoming signals. More...
 
virtual RadioMode getRadioMode () const =0
 Returns the current radio mode, This is the same mode as the one emitted with the last radioModeChangedSignal. More...
 
virtual void setRadioMode (RadioMode radioMode)=0
 Changes the current radio mode. More...
 
virtual ReceptionState getReceptionState () const =0
 Returns the current radio reception state. More...
 
virtual TransmissionState getTransmissionState () const =0
 Returns the current radio transmission state. More...
 
virtual int getId () const =0
 Returns an identifier for this radio which is globally unique for the whole lifetime of the simulation among all radios. More...
 
virtual const IAntennagetAntenna () const =0
 Returns the antenna used by the transceiver of this radio. More...
 
virtual const ITransmittergetTransmitter () const =0
 Returns the transmitter part of this radio. More...
 
virtual const IReceivergetReceiver () const =0
 Returns the receiver part of this radio. More...
 
virtual const IRadioMediumgetMedium () const =0
 Returns the radio medium where this radio is transmitting and receiving radio signals. More...
 
virtual const ITransmissiongetTransmissionInProgress () const =0
 Returns the ongoing transmission that the transmitter is currently transmitting or nullptr. More...
 
virtual const ITransmissiongetReceptionInProgress () const =0
 Returns the ongoing reception that the receiver is currently receiving or nullptr. More...
 
virtual IRadioSignal::SignalPart getTransmittedSignalPart () const =0
 Returns the signal part of the ongoing transmission that the transmitter is currently transmitting or -1 if no transmission is in progress. More...
 
virtual IRadioSignal::SignalPart getReceivedSignalPart () const =0
 Returns the signal part of the ongoing reception that the receiver is currently receiving or -1 if no reception is in progress. More...
 
- Public Member Functions inherited from inet::IPhysicalLayer
virtual ~IPhysicalLayer ()
 
- Public Member Functions inherited from inet::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const
 Prints this object to the provided output stream. More...
 
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
 

Static Public Member Functions

static const char * getRadioModeName (RadioMode radioMode)
 Returns the name of the provided radio mode. More...
 
static const char * getRadioReceptionStateName (ReceptionState receptionState)
 Returns the name of the provided radio reception state. More...
 
static const char * getRadioTransmissionStateName (TransmissionState transmissionState)
 Returns the name of the provided radio transmission state. More...
 

Static Public Attributes

static simsignal_t radioModeChangedSignal = cComponent::registerSignal("radioModeChanged")
 This signal is emitted when the radio mode of the radio is changed. More...
 
static simsignal_t listeningChangedSignal = cComponent::registerSignal("listeningChanged")
 This signal is emitted when the radio listening of the radio is changed. More...
 
static simsignal_t receptionStateChangedSignal = cComponent::registerSignal("receptionStateChanged")
 This signal is emitted when the radio reception state of the radio is changed. More...
 
static simsignal_t transmissionStateChangedSignal = cComponent::registerSignal("transmissionStateChanged")
 This signal is emitted when the radio transmission state of the radio is changed. More...
 
static simsignal_t receivedSignalPartChangedSignal = cComponent::registerSignal("receivedSignalPartChanged")
 This signal is emitted when the received part is changed by the radio. More...
 
static simsignal_t transmittedSignalPartChangedSignal = cComponent::registerSignal("transmittedSignalPartChanged")
 This signal is emitted when the transmitted part is changed by the radio. More...
 

Static Protected Attributes

static int nextId = 0
 
static cEnum * radioModeEnum = nullptr
 The enumeration registered for radio mode. More...
 
static cEnum * receptionStateEnum = nullptr
 The enumeration registered for radio reception state. More...
 
static cEnum * transmissionStateEnum = nullptr
 The enumeration registered for radio transmission state. More...
 

Detailed Description

This interface represents a physical device that is capable of transmitting and receiving radio signals.

Simultaneous reception and transmission is also supported. The radio has an operation mode and it provides the state of the radio medium at its position.

Member Enumeration Documentation

◆ RadioMode

This enumeration specifies the requested operational mode of the radio.

NOTE: Some parts of the code base may be sensitive to the order of the enum items because they may be used as an array index.

Enumerator
RADIO_MODE_OFF 

The radio is turned off, frame reception or transmission is not possible, power consumption is zero, radio mode switching is slow.

RADIO_MODE_SLEEP 

The radio is sleeping, frame reception or transmission is not possible, power consumption is minimal, radio mode switching is fast.

RADIO_MODE_RECEIVER 

The radio is prepared for frame reception, frame transmission is not possible, power consumption is low when receiver is idle and medium when receiving.

RADIO_MODE_TRANSMITTER 

The radio is prepared for frame transmission, frame reception is not possible, power consumption is low when transmitter is idle and high when transmitting.

RADIO_MODE_TRANSCEIVER 

The radio is prepared for simultaneous frame reception and transmission, power consumption is low when transceiver is idle, medium when receiving and high when transmitting.

RADIO_MODE_SWITCHING 

The radio is switching from one mode to another, frame reception or transmission is not possible, power consumption is minimal.

79  {
85 
91 
98 
105 
112 
117  RADIO_MODE_SWITCHING // this radio mode must be the very last
118  };

◆ ReceptionState

This enumeration specifies the reception state of the radio.

This also determines the state of the radio medium.

Enumerator
RECEPTION_STATE_UNDEFINED 

The radio medium state is unknown, reception state is meaningless, signal detection is not possible.

(e.g. the radio mode is off, sleep or transmitter)

RECEPTION_STATE_IDLE 

The radio medium is free, no signal is detected.

(e.g. the RSSI is below the energy detection threshold)

RECEPTION_STATE_BUSY 

The radio medium is busy, a signal is detected but it is not strong enough to receive.

(e.g. the RSSI is above the energy detection threshold but below the reception threshold)

RECEPTION_STATE_RECEIVING 

The radio medium is busy, a signal strong enough to receive is detected.

(e.g. the SNIR was above the reception threshold)

124  {
131 
137 
144 
150  };

◆ TransmissionState

This enumeration specifies the transmission state of the radio.

Enumerator
TRANSMISSION_STATE_UNDEFINED 

The transmission state is undefined or meaningless.

(e.g. the radio mode is off, sleep or receiver)

TRANSMISSION_STATE_IDLE 

The radio is not transmitting a signal on the radio medium.

(e.g. the last transmission has been completed)

TRANSMISSION_STATE_TRANSMITTING 

The radio medium is busy, the radio is currently transmitting a signal.

Member Function Documentation

◆ getAntenna()

virtual const IAntenna* inet::physicallayer::IRadio::getAntenna ( ) const
pure virtual

Returns the antenna used by the transceiver of this radio.

This function never returns nullptr.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

Referenced by inet::physicallayer::GridNeighborCache::addRadio(), inet::physicallayer::QuadTreeNeighborCache::addRadio(), inet::physicallayer::RadioMedium::addRadio(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::ScalarAnalogModelBase::computeReceptionPower(), inet::L3NetworkConfiguratorBase::computeWirelessLinkWeight(), inet::visualizer::RadioCanvasVisualizer::createRadioVisualization(), inet::physicallayer::ApskScalarTransmitter::createTransmission(), inet::physicallayer::Ieee802154NarrowbandScalarTransmitter::createTransmission(), inet::physicallayer::Ieee80211ScalarTransmitter::createTransmission(), inet::physicallayer::Ieee802154NarrowbandDimensionalTransmitter::createTransmission(), inet::physicallayer::ApskDimensionalTransmitter::createTransmission(), inet::physicallayer::Ieee80211DimensionalTransmitter::createTransmission(), inet::physicallayer::NoiseDimensionalTransmitter::createTransmission(), inet::physicallayer::Ieee80211UnitDiskTransmitter::createTransmission(), inet::physicallayer::UnitDiskTransmitter::createTransmission(), inet::physicallayer::Ieee802154UwbIrTransmitter::createTransmission(), inet::physicallayer::ApskLayeredTransmitter::createTransmission(), inet::physicallayer::Ieee80211LayeredOfdmTransmitter::createTransmission(), inet::physicallayer::GridNeighborCache::fillCubeVector(), inet::physicallayer::QuadTreeNeighborCache::sendToNeighbors(), inet::physicallayer::GridNeighborCache::sendToNeighbors(), and inet::physicallayer::NeighborListNeighborCache::updateNeighborList().

◆ getId()

virtual int inet::physicallayer::IRadio::getId ( ) const
pure virtual

Returns an identifier for this radio which is globally unique for the whole lifetime of the simulation among all radios.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

Referenced by inet::physicallayer::ReferenceCommunicationCache::addRadio(), inet::physicallayer::VectorCommunicationCache::addRadio(), inet::physicallayer::ReferenceCommunicationCache::computeInterferingTransmissions(), inet::physicallayer::ReferenceCommunicationCache::getRadioCacheEntry(), inet::physicallayer::MapCommunicationCache::getRadioCacheEntry(), inet::physicallayer::VectorCommunicationCache::getRadioCacheEntry(), inet::physicallayer::ReferenceCommunicationCache::getReceptionCacheEntry(), inet::physicallayer::MapCommunicationCache::getReceptionCacheEntry(), inet::physicallayer::VectorCommunicationCache::getReceptionCacheEntry(), inet::physicallayer::RadioMedium::isInterferingTransmission(), inet::physicallayer::NeighborListNeighborCache::RadioEntry::operator==(), inet::physicallayer::ListeningBase::printToStream(), inet::physicallayer::ReceptionBase::printToStream(), inet::physicallayer::MapCommunicationCache::removeRadio(), inet::physicallayer::GridNeighborCache::removeRadio(), inet::physicallayer::QuadTreeNeighborCache::removeRadio(), inet::physicallayer::RadioMedium::sendToAffectedRadios(), inet::physicallayer::NeighborListNeighborCache::sendToNeighbors(), inet::physicallayer::NeighborListNeighborCache::updateNeighborList(), inet::physicallayer::GridNeighborCache::GridNeighborCacheVisitor::visit(), inet::physicallayer::QuadTreeNeighborCache::QuadTreeNeighborCacheVisitor::visit(), and inet::physicallayer::CommunicationLog::writeReception().

◆ getMedium()

◆ getRadioGate()

virtual const cGate* inet::physicallayer::IRadio::getRadioGate ( ) const
pure virtual

◆ getRadioMode()

virtual RadioMode inet::physicallayer::IRadio::getRadioMode ( ) const
pure virtual

Returns the current radio mode, This is the same mode as the one emitted with the last radioModeChangedSignal.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

◆ getRadioModeName()

const char * inet::physicallayer::IRadio::getRadioModeName ( RadioMode  radioMode)
static

Returns the name of the provided radio mode.

47 {
48  if (!radioModeEnum)
49  radioModeEnum = cEnum::get(opp_typename(typeid(IRadio::RadioMode)));
50  return radioModeEnum->getStringFor(radioMode) + 11;
51 }

Referenced by inet::physicallayer::Radio::completeRadioModeSwitch(), and inet::physicallayer::Radio::startRadioModeSwitch().

◆ getRadioReceptionStateName()

const char * inet::physicallayer::IRadio::getRadioReceptionStateName ( ReceptionState  receptionState)
static

Returns the name of the provided radio reception state.

54 {
55  if (!receptionStateEnum)
56  receptionStateEnum = cEnum::get(opp_typename(typeid(IRadio::ReceptionState)));
57  return receptionStateEnum->getStringFor(receptionState) + 16;
58 }

Referenced by inet::physicallayer::Radio::updateTransceiverState().

◆ getRadioTransmissionStateName()

const char * inet::physicallayer::IRadio::getRadioTransmissionStateName ( TransmissionState  transmissionState)
static

Returns the name of the provided radio transmission state.

61 {
63  transmissionStateEnum = cEnum::get(opp_typename(typeid(IRadio::TransmissionState)));
64  return transmissionStateEnum->getStringFor(transmissionState) + 19;
65 }

Referenced by inet::physicallayer::Radio::updateTransceiverState().

◆ getReceivedSignalPart()

virtual IRadioSignal::SignalPart inet::physicallayer::IRadio::getReceivedSignalPart ( ) const
pure virtual

Returns the signal part of the ongoing reception that the receiver is currently receiving or -1 if no reception is in progress.

This is the same part as the one emitted with the last receivedPartChangedSignal.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

◆ getReceiver()

◆ getReceptionInProgress()

virtual const ITransmission* inet::physicallayer::IRadio::getReceptionInProgress ( ) const
pure virtual

Returns the ongoing reception that the receiver is currently receiving or nullptr.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

Referenced by inet::physicallayer::ReceiverBase::computeIsReceptionAttempted().

◆ getReceptionState()

virtual ReceptionState inet::physicallayer::IRadio::getReceptionState ( ) const
pure virtual

Returns the current radio reception state.

This is the same state as the one emitted with the last receptionStateChangedSignal.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

◆ getTransmissionInProgress()

virtual const ITransmission* inet::physicallayer::IRadio::getTransmissionInProgress ( ) const
pure virtual

Returns the ongoing transmission that the transmitter is currently transmitting or nullptr.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

◆ getTransmissionState()

virtual TransmissionState inet::physicallayer::IRadio::getTransmissionState ( ) const
pure virtual

Returns the current radio transmission state.

This is the same state as the one emitted with the last transmissionStateChangedSignal.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

◆ getTransmittedSignalPart()

virtual IRadioSignal::SignalPart inet::physicallayer::IRadio::getTransmittedSignalPart ( ) const
pure virtual

Returns the signal part of the ongoing transmission that the transmitter is currently transmitting or -1 if no transmission is in progress.

This is the same part as the one emitted with the last transmittedPartChangedSignal.

Implemented in inet::physicallayer::Radio, inet::physicallayer::NoiseSource, and inet::physicallayer::ShortcutRadio.

◆ getTransmitter()

◆ setRadioMode()

virtual void inet::physicallayer::IRadio::setRadioMode ( RadioMode  radioMode)
pure virtual

Changes the current radio mode.

The actual change may take zero or more time. The new radio mode will be emitted with a radioModeChangedSignal.

Implemented in inet::physicallayer::NoiseSource, and inet::physicallayer::Radio.

Member Data Documentation

◆ listeningChangedSignal

simsignal_t inet::physicallayer::IRadio::listeningChangedSignal = cComponent::registerSignal("listeningChanged")
static

◆ nextId

int inet::physicallayer::IRadio::nextId = 0
staticprotected

◆ radioModeChangedSignal

◆ radioModeEnum

cEnum * inet::physicallayer::IRadio::radioModeEnum = nullptr
staticprotected

The enumeration registered for radio mode.

Referenced by getRadioModeName().

◆ receivedSignalPartChangedSignal

simsignal_t inet::physicallayer::IRadio::receivedSignalPartChangedSignal = cComponent::registerSignal("receivedSignalPartChanged")
static

◆ receptionStateChangedSignal

◆ receptionStateEnum

cEnum * inet::physicallayer::IRadio::receptionStateEnum = nullptr
staticprotected

The enumeration registered for radio reception state.

Referenced by getRadioReceptionStateName().

◆ transmissionStateChangedSignal

◆ transmissionStateEnum

cEnum * inet::physicallayer::IRadio::transmissionStateEnum = nullptr
staticprotected

The enumeration registered for radio transmission state.

Referenced by getRadioTransmissionStateName().

◆ transmittedSignalPartChangedSignal

simsignal_t inet::physicallayer::IRadio::transmittedSignalPartChangedSignal = cComponent::registerSignal("transmittedSignalPartChanged")
static

The documentation for this class was generated from the following files:
inet::physicallayer::IRadio::RECEPTION_STATE_IDLE
@ RECEPTION_STATE_IDLE
The radio medium is free, no signal is detected.
Definition: IRadio.h:136
inet::physicallayer::IRadio::RADIO_MODE_TRANSCEIVER
@ RADIO_MODE_TRANSCEIVER
The radio is prepared for simultaneous frame reception and transmission, power consumption is low whe...
Definition: IRadio.h:111
inet::physicallayer::IRadio::RADIO_MODE_OFF
@ RADIO_MODE_OFF
The radio is turned off, frame reception or transmission is not possible, power consumption is zero,...
Definition: IRadio.h:84
inet::physicallayer::IRadio::RADIO_MODE_SWITCHING
@ RADIO_MODE_SWITCHING
The radio is switching from one mode to another, frame reception or transmission is not possible,...
Definition: IRadio.h:117
inet::physicallayer::IRadio::RADIO_MODE_SLEEP
@ RADIO_MODE_SLEEP
The radio is sleeping, frame reception or transmission is not possible, power consumption is minimal,...
Definition: IRadio.h:90
inet::physicallayer::IRadio::RECEPTION_STATE_RECEIVING
@ RECEPTION_STATE_RECEIVING
The radio medium is busy, a signal strong enough to receive is detected.
Definition: IRadio.h:149
inet::physicallayer::IRadio::RECEPTION_STATE_UNDEFINED
@ RECEPTION_STATE_UNDEFINED
The radio medium state is unknown, reception state is meaningless, signal detection is not possible.
Definition: IRadio.h:130
inet::physicallayer::IRadio::transmissionStateEnum
static cEnum * transmissionStateEnum
The enumeration registered for radio transmission state.
Definition: IRadio.h:188
inet::physicallayer::IRadio::RADIO_MODE_TRANSMITTER
@ RADIO_MODE_TRANSMITTER
The radio is prepared for frame transmission, frame reception is not possible, power consumption is l...
Definition: IRadio.h:104
inet::physicallayer::IRadio::ReceptionState
ReceptionState
This enumeration specifies the reception state of the radio.
Definition: IRadio.h:124
inet::physicallayer::IRadio::RADIO_MODE_RECEIVER
@ RADIO_MODE_RECEIVER
The radio is prepared for frame reception, frame transmission is not possible, power consumption is l...
Definition: IRadio.h:97
inet::physicallayer::IRadio::TRANSMISSION_STATE_TRANSMITTING
@ TRANSMISSION_STATE_TRANSMITTING
The radio medium is busy, the radio is currently transmitting a signal.
Definition: IRadio.h:171
inet::physicallayer::IRadio::RECEPTION_STATE_BUSY
@ RECEPTION_STATE_BUSY
The radio medium is busy, a signal is detected but it is not strong enough to receive.
Definition: IRadio.h:143
inet::physicallayer::IRadio::receptionStateEnum
static cEnum * receptionStateEnum
The enumeration registered for radio reception state.
Definition: IRadio.h:183
inet::physicallayer::IRadio::TransmissionState
TransmissionState
This enumeration specifies the transmission state of the radio.
Definition: IRadio.h:155
inet::physicallayer::IRadio::RadioMode
RadioMode
This enumeration specifies the requested operational mode of the radio.
Definition: IRadio.h:79
inet::physicallayer::IRadio::TRANSMISSION_STATE_UNDEFINED
@ TRANSMISSION_STATE_UNDEFINED
The transmission state is undefined or meaningless.
Definition: IRadio.h:160
inet::physicallayer::IRadio::radioModeEnum
static cEnum * radioModeEnum
The enumeration registered for radio mode.
Definition: IRadio.h:178
inet::physicallayer::IRadio::TRANSMISSION_STATE_IDLE
@ TRANSMISSION_STATE_IDLE
The radio is not transmitting a signal on the radio medium.
Definition: IRadio.h:166