|
INET Framework for OMNeT++/OMNEST
|
This class is the default implementation of the IRadio interface.
More...
#include <Radio.h>
|
| 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...
|
| |
| 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)
} |
| |
| virtual | ~OperationalMixin () |
| | }@ More...
|
| |
| virtual | ~ILifecycle () |
| |
| virtual | ~IPhysicalLayer () |
| |
| 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 |
| |
| 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 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...
|
| |
| enum | State |
| |
| virtual void | handleLowerMessage (cMessage *message) override |
| |
| virtual void | sendUp (cMessage *message) |
| |
| virtual bool | isUpperMessage (cMessage *message) const override |
| |
| virtual bool | isLowerMessage (cMessage *message) const override |
| |
| virtual bool | isInitializeStage (int stage) const override |
| |
| virtual bool | isModuleStartStage (int stage) const override |
| |
| virtual bool | isModuleStopStage (int stage) const override |
| |
| virtual void | handleMessageWhenUp (cMessage *message) override |
| |
| virtual void | handleUpperMessage (cMessage *message) |
| |
| virtual void | handleLowerPacket (Packet *packet) |
| |
| virtual int | numInitStages () const override |
| |
| virtual void | refreshDisplay () const override |
| |
| virtual void | handleMessage (cMessage *msg) override |
| |
| virtual bool | handleOperationStage (LifecycleOperation *operation, IDoneCallback *doneCallback) override |
| | Perform one stage of a lifecycle operation. More...
|
| |
| virtual State | getInitialOperationalState () const |
| | Returns initial operational state: OPERATING or NOT_OPERATING. More...
|
| |
| virtual void | handleActiveOperationTimeout (cMessage *message) |
| |
| virtual bool | isUp () const |
| | utility functions More...
|
| |
| virtual bool | isDown () const |
| |
| virtual void | setOperationalState (State newState) |
| |
| virtual void | scheduleOperationTimeout (simtime_t timeout) |
| |
| virtual void | setupActiveOperation (LifecycleOperation *operation, IDoneCallback *doneCallback, State) |
| |
| virtual void | delayActiveOperationFinish (simtime_t timeout) |
| |
| virtual void | startActiveOperationExtraTime (simtime_t delay=SIMTIME_ZERO) |
| |
| virtual void | startActiveOperationExtraTimeOrFinish (simtime_t extraTime) |
| |
| virtual void | finishActiveOperation () |
| |
| 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...
|
| |
This class is the default implementation of the IRadio interface.
The transmission process starts when the radio module receives a packet from the higher layer. The radio must be in transmitter or transceiver mode before receiving a packet, otherwise it throws an exception. The radio changes its transmitter state to transmitting, and emits a transmitter state changed signal. Finally, it schedules a timer to the end of the transmission.
The transmission process ends when the above timer expires. The radio changes its transmitter state back to idle, and emits a transmitter state changed signal.
The reception process starts when the radio module receives a packet. The radio must be in receiver or transceiver mode before the packet arrives, otherwise it just ignores the packet. The radio changes its receiver state to the appropriate value, and emits a receiver state changed signal. Finally, it schedules a timer to the end of the reception.
The reception process ends when one of the above timer expires. If the timer corresponds to an attempted reception, then the radio determines the reception decision. Independently of whether the reception is successful or not, the encapsulated packet is sent up to the higher layer. Finally, the radio changes its receiver state to the appropriate value, and emits a receiver state changed signal.
◆ Radio()
| inet::physicallayer::Radio::Radio |
( |
| ) |
|
|
inline |
◆ ~Radio()
| inet::physicallayer::Radio::~Radio |
( |
| ) |
|
|
virtual |
31 check_and_cast<IRadioMedium *>(
medium)->removeRadio(
this);
◆ abortReception()
| void inet::physicallayer::Radio::abortReception |
( |
cMessage * |
timer | ) |
|
|
protectedvirtual |
491 auto signal =
static_cast<WirelessSignal *
>(timer->getControlInfo());
493 auto reception = signal->getReception();
494 EV_INFO <<
"Reception \x1b[1maborted\x1b[0m: for " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(part) <<
" as " << reception << endl;
Referenced by completeRadioModeSwitch().
◆ abortTransmission()
| void inet::physicallayer::Radio::abortTransmission |
( |
| ) |
|
|
protectedvirtual |
◆ captureReception()
| void inet::physicallayer::Radio::captureReception |
( |
cMessage * |
timer | ) |
|
|
protectedvirtual |
504 throw cRuntimeError(
"Not yet implemented");
◆ completeRadioModeSwitch()
| void inet::physicallayer::Radio::completeRadioModeSwitch |
( |
RadioMode |
newRadioMode | ) |
|
|
private |
◆ continueReception()
| void inet::physicallayer::Radio::continueReception |
( |
cMessage * |
timer | ) |
|
|
protectedvirtual |
435 auto signal =
static_cast<WirelessSignal *
>(timer->getControlInfo());
436 auto arrival = signal->getArrival();
437 auto reception = signal->getReception();
439 auto transmission = signal->getTransmission();
440 bool isReceptionSuccessful =
medium->isReceptionSuccessful(
this, transmission, previousPart);
441 EV_INFO <<
"Reception ended: " << (isReceptionSuccessful ?
"\x1b[1msuccessfully\x1b[0m" :
"\x1b[1munsuccessfully\x1b[0m") <<
" for " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(previousPart) <<
" as " << reception << endl;
442 if (!isReceptionSuccessful)
444 auto isReceptionAttempted =
medium->isReceptionAttempted(
this, transmission, nextPart);
445 EV_INFO <<
"Reception started: " << (isReceptionAttempted ?
"\x1b[1mattempting\x1b[0m" :
"\x1b[1mnot attempting\x1b[0m") <<
" " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(nextPart) <<
" as " << reception << endl;
446 if (!isReceptionAttempted)
451 EV_INFO <<
"Reception ended: \x1b[1mignoring\x1b[0m " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(previousPart) <<
" as " << reception << endl;
452 EV_INFO <<
"Reception started: \x1b[1mignoring\x1b[0m " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(nextPart) <<
" as " << reception << endl;
454 timer->setKind(nextPart);
455 scheduleAt(arrival->getEndTime(nextPart), timer);
Referenced by handleReceptionTimer().
◆ continueTransmission()
| void inet::physicallayer::Radio::continueTransmission |
( |
| ) |
|
|
protectedvirtual |
◆ createReceptionTimer()
| cMessage * inet::physicallayer::Radio::createReceptionTimer |
( |
WirelessSignal * |
signal | ) |
const |
|
protectedvirtual |
516 cMessage *timer =
new cMessage(
"receptionTimer");
517 timer->setControlInfo(signal);
Referenced by handleSignal().
◆ createSignal()
397 auto bytes = packet->peekDataAsBytes();
399 packet->insertAtFront(bytes);
401 WirelessSignal *signal = check_and_cast<WirelessSignal *>(
medium->transmitPacket(
this, packet));
402 ASSERT(signal->getDuration() != 0);
Referenced by startTransmission().
◆ decapsulate()
| virtual void inet::physicallayer::Radio::decapsulate |
( |
Packet * |
packet | ) |
const |
|
inlinevirtual |
◆ encapsulate()
| virtual void inet::physicallayer::Radio::encapsulate |
( |
Packet * |
packet | ) |
const |
|
inlinevirtual |
◆ endReception()
| void inet::physicallayer::Radio::endReception |
( |
cMessage * |
timer | ) |
|
|
protectedvirtual |
463 auto signal =
static_cast<WirelessSignal *
>(timer->getControlInfo());
464 auto arrival = signal->getArrival();
465 auto reception = signal->getReception();
467 auto transmission = signal->getTransmission();
469 auto isReceptionSuccessful =
medium->getReceptionDecision(
this, signal->getListening(), transmission, part)->isReceptionSuccessful();
470 EV_INFO <<
"Reception ended: " << (isReceptionSuccessful ?
"\x1b[1msuccessfully\x1b[0m" :
"\x1b[1munsuccessfully\x1b[0m") <<
" for " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(part) <<
" as " << reception << endl;
471 auto macFrame =
medium->receivePacket(
this, signal);
479 EV_INFO <<
"Reception ended: \x1b[1mignoring\x1b[0m " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(part) <<
" as " << reception << endl;
Referenced by handleReceptionTimer().
◆ endTransmission()
| void inet::physicallayer::Radio::endTransmission |
( |
| ) |
|
|
protectedvirtual |
◆ getAntenna()
| virtual const IAntenna* inet::physicallayer::Radio::getAntenna |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the antenna used by the transceiver of this radio.
This function never returns nullptr.
Implements inet::physicallayer::IRadio.
◆ getId()
| virtual int inet::physicallayer::Radio::getId |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getMedium()
| virtual const IRadioMedium* inet::physicallayer::Radio::getMedium |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the radio medium where this radio is transmitting and receiving radio signals.
This function never returns nullptr.
Implements inet::physicallayer::IRadio.
◆ getRadioGate()
| virtual const cGate* inet::physicallayer::Radio::getRadioGate |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getRadioMode()
| virtual RadioMode inet::physicallayer::Radio::getRadioMode |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getReceivedSignalPart()
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.
Implements inet::physicallayer::IRadio.
◆ getReceiver()
| virtual const IReceiver* inet::physicallayer::Radio::getReceiver |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getReceptionInProgress()
| const ITransmission * inet::physicallayer::Radio::getReceptionInProgress |
( |
| ) |
const |
|
overridevirtual |
Returns the ongoing reception that the receiver is currently receiving or nullptr.
Implements inet::physicallayer::IRadio.
183 return static_cast<WirelessSignal *
>(
receptionTimer->getControlInfo())->getTransmission();
◆ getReceptionState()
| virtual ReceptionState inet::physicallayer::Radio::getReceptionState |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the current radio reception state.
This is the same state as the one emitted with the last receptionStateChangedSignal.
Implements inet::physicallayer::IRadio.
◆ getTransmissionInProgress()
| const ITransmission * inet::physicallayer::Radio::getTransmissionInProgress |
( |
| ) |
const |
|
overridevirtual |
Returns the ongoing transmission that the transmitter is currently transmitting or nullptr.
Implements inet::physicallayer::IRadio.
175 return static_cast<WirelessSignal *
>(
transmissionTimer->getContextPointer())->getTransmission();
◆ getTransmissionState()
Returns the current radio transmission state.
This is the same state as the one emitted with the last transmissionStateChangedSignal.
Implements inet::physicallayer::IRadio.
◆ getTransmittedSignalPart()
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.
Implements inet::physicallayer::IRadio.
◆ getTransmitter()
| virtual const ITransmitter* inet::physicallayer::Radio::getTransmitter |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ handleCrashOperation()
◆ handleLowerCommand()
| void inet::physicallayer::Radio::handleLowerCommand |
( |
cMessage * |
command | ) |
|
|
overrideprotectedvirtual |
◆ handleMessageWhenDown()
| void inet::physicallayer::Radio::handleMessageWhenDown |
( |
cMessage * |
message | ) |
|
|
overrideprotectedvirtual |
◆ handleReceptionTimer()
| void inet::physicallayer::Radio::handleReceptionTimer |
( |
cMessage * |
message | ) |
|
|
protectedvirtual |
◆ handleSelfMessage()
| void inet::physicallayer::Radio::handleSelfMessage |
( |
cMessage * |
message | ) |
|
|
overrideprotectedvirtual |
◆ handleSignal()
| void inet::physicallayer::Radio::handleSignal |
( |
WirelessSignal * |
signal | ) |
|
|
overrideprotectedvirtual |
◆ handleStartOperation()
◆ handleStopOperation()
◆ handleSwitchTimer()
| void inet::physicallayer::Radio::handleSwitchTimer |
( |
cMessage * |
message | ) |
|
|
protectedvirtual |
◆ handleTransmissionTimer()
| void inet::physicallayer::Radio::handleTransmissionTimer |
( |
cMessage * |
message | ) |
|
|
protectedvirtual |
◆ handleUpperCommand()
| void inet::physicallayer::Radio::handleUpperCommand |
( |
cMessage * |
command | ) |
|
|
overrideprotectedvirtual |
◆ handleUpperPacket()
| void inet::physicallayer::Radio::handleUpperPacket |
( |
Packet * |
packet | ) |
|
|
overrideprotectedvirtual |
◆ initialize()
| void inet::physicallayer::Radio::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ initializeRadioMode()
| void inet::physicallayer::Radio::initializeRadioMode |
( |
| ) |
|
|
protectedvirtual |
73 const char *initialRadioMode = par(
"initialRadioMode");
74 if (!strcmp(initialRadioMode,
"off"))
76 else if (!strcmp(initialRadioMode,
"sleep"))
78 else if (!strcmp(initialRadioMode,
"receiver"))
80 else if (!strcmp(initialRadioMode,
"transmitter"))
82 else if (!strcmp(initialRadioMode,
"transceiver"))
85 throw cRuntimeError(
"Unknown initialRadioMode");
Referenced by handleStartOperation(), and initialize().
◆ isListeningPossible()
| bool inet::physicallayer::Radio::isListeningPossible |
( |
| ) |
const |
|
protectedvirtual |
538 const simtime_t now = simTime();
542 const IListeningDecision *listeningDecision =
medium->listenOnMedium(
this, listening);
545 delete listeningDecision;
Referenced by initialize(), and updateTransceiverState().
◆ isReceiverMode()
◆ isReceptionTimer()
| bool inet::physicallayer::Radio::isReceptionTimer |
( |
const cMessage * |
message | ) |
const |
|
protectedvirtual |
◆ isTransmitterMode()
| bool inet::physicallayer::Radio::isTransmitterMode |
( |
IRadio::RadioMode |
radioMode | ) |
const |
|
protectedvirtual |
◆ parseRadioModeSwitchingTimes()
| void inet::physicallayer::Radio::parseRadioModeSwitchingTimes |
( |
| ) |
|
|
private |
118 const char *times = par(
"switchingTimes");
121 unsigned int count = sscanf(times,
"%s", prefix);
124 throw cRuntimeError(
"Metric prefix should be no more than two characters long");
128 if (strcmp(
"s", prefix) == 0)
130 else if (strcmp(
"ms", prefix) == 0)
132 else if (strcmp(
"ns", prefix) == 0)
133 metric = 0.000000001;
135 throw cRuntimeError(
"Undefined or missed metric prefix for switchingTimes parameter");
137 cStringTokenizer tok(times +
count + 1);
138 unsigned int idx = 0;
139 while (tok.hasMoreTokens()) {
144 throw cRuntimeError(
"Check your switchingTimes parameter! Some parameters may be missed");
Referenced by initialize().
◆ printToStream()
| std::ostream & inet::physicallayer::Radio::printToStream |
( |
std::ostream & |
stream, |
|
|
int |
level, |
|
|
int |
evFlags = 0 |
|
) |
| const |
|
overridevirtual |
Prints this object to the provided output stream.
Reimplemented from inet::IPrintableObject.
90 stream << static_cast<const cSimpleModule *>(
this);
◆ sendUp()
| void inet::physicallayer::Radio::sendUp |
( |
Packet * |
macFrame | ) |
|
|
protectedvirtual |
◆ setRadioMode()
| void inet::physicallayer::Radio::setRadioMode |
( |
RadioMode |
radioMode | ) |
|
|
overridevirtual |
Changes the current radio mode.
The actual change may take zero or more time. The new radio mode will be emitted with a radioModeChangedSignal.
Implements inet::physicallayer::IRadio.
102 throw cRuntimeError(
"Unknown radio mode: %d", newRadioMode);
104 throw cRuntimeError(
"Cannot switch manually to RADIO_MODE_SWITCHING");
106 throw cRuntimeError(
"Cannot switch to a new radio mode while another switch is in progress");
109 if (switchingTime != 0)
Referenced by handleUpperCommand().
◆ startRadioModeSwitch()
| void inet::physicallayer::Radio::startRadioModeSwitch |
( |
RadioMode |
newRadioMode, |
|
|
simtime_t |
switchingTime |
|
) |
| |
|
private |
◆ startReception()
408 auto signal =
static_cast<WirelessSignal *
>(timer->getControlInfo());
409 auto arrival = signal->getArrival();
410 auto reception = signal->getReception();
413 auto transmission = signal->getTransmission();
414 auto isReceptionAttempted =
medium->isReceptionAttempted(
this, transmission, part);
415 EV_INFO <<
"Reception started: " << (isReceptionAttempted ?
"\x1b[1mattempting\x1b[0m" :
"\x1b[1mnot attempting\x1b[0m") <<
" " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(part) <<
" as " << reception << endl;
416 if (isReceptionAttempted) {
422 EV_INFO <<
"Reception started: \x1b[1mignoring\x1b[0m " << (IWirelessSignal *)signal <<
" " <<
IRadioSignal::getSignalPartName(part) <<
" as " << reception << endl;
423 timer->setKind(part);
424 scheduleAt(arrival->getEndTime(part), timer);
Referenced by handleSignal().
◆ startTransmission()
318 auto transmission = signal->getTransmission();
322 #ifdef NS3_VALIDATION
324 const char *ac =
"NA";
326 switch (df->getTid()) {
327 case 1:
case 2: ac =
"AC_BK";
break;
328 case 0:
case 3: ac =
"AC_BE";
break;
329 case 4:
case 5: ac =
"AC_VI";
break;
330 case 6:
case 7: ac =
"AC_VO";
break;
331 default: ac =
"???";
break;
334 const char *lastSeq = strchr(macFrame->getName(),
'-');
335 if (lastSeq ==
nullptr)
339 std::cout <<
"TX: node = " <<
getId() <<
", ac = " << ac <<
", seq = " << lastSeq <<
", start = " << simTime().inUnit(SIMTIME_PS) <<
", duration = " << signal->getDuration().inUnit(SIMTIME_PS) << std::endl;
Referenced by handleUpperPacket().
◆ updateTransceiverPart()
| void inet::physicallayer::Radio::updateTransceiverPart |
( |
| ) |
|
|
protectedvirtual |
◆ updateTransceiverState()
| void inet::physicallayer::Radio::updateTransceiverState |
( |
| ) |
|
|
protectedvirtual |
◆ antenna
| const IAntenna* inet::physicallayer::Radio::antenna = nullptr |
|
protected |
◆ id
| const int inet::physicallayer::Radio::id = nextId++ |
|
protected |
An identifier which is globally unique for the whole lifetime of the simulation among all radios.
◆ medium
◆ mediumModuleId
| int inet::physicallayer::Radio::mediumModuleId = -1 |
|
protected |
◆ nextRadioMode
◆ previousRadioMode
◆ radioIn
| cGate* inet::physicallayer::Radio::radioIn = nullptr |
|
protected |
◆ radioMode
State.
The current radio mode.
Referenced by completeRadioModeSwitch(), continueReception(), endReception(), handleUpperPacket(), initialize(), isReceiverMode(), isTransmitterMode(), setRadioMode(), startRadioModeSwitch(), startReception(), and updateTransceiverState().
◆ receivedSignalPart
◆ receiver
| const IReceiver* inet::physicallayer::Radio::receiver = nullptr |
|
protected |
The receiver model is never nullptr.
Referenced by inet::physicallayer::Ieee80211OfdmRadio::decapsulate(), initialize(), isListeningPossible(), printToStream(), inet::physicallayer::Ieee80211Radio::setBand(), inet::physicallayer::NarrowbandRadioBase::setBandwidth(), inet::physicallayer::NarrowbandRadioBase::setCenterFrequency(), inet::physicallayer::Ieee80211Radio::setChannel(), inet::physicallayer::Ieee80211Radio::setChannelNumber(), inet::physicallayer::Ieee80211Radio::setModeSet(), and inet::physicallayer::NarrowbandRadioBase::setModulation().
◆ receptionState
◆ receptionTimer
| cMessage* inet::physicallayer::Radio::receptionTimer = nullptr |
|
protected |
The timer that is scheduled to the end of the current reception.
If this timer is nullptr then no attempted reception is in progress but there still may be incoming receptions which are not attempted.
Referenced by abortReception(), completeRadioModeSwitch(), continueReception(), endReception(), getReceptionInProgress(), handleSignal(), inet::physicallayer::Ieee80211Radio::setBand(), inet::physicallayer::NarrowbandRadioBase::setBandwidth(), inet::physicallayer::FlatRadioBase::setBitrate(), inet::physicallayer::Ieee80211Radio::setChannel(), inet::physicallayer::Ieee80211Radio::setChannelNumber(), inet::physicallayer::Ieee80211Radio::setMode(), inet::physicallayer::Ieee80211Radio::setModeSet(), startReception(), updateTransceiverPart(), and updateTransceiverState().
◆ sendRawBytes
| bool inet::physicallayer::Radio::sendRawBytes = false |
|
protected |
◆ separateReceptionParts
| bool inet::physicallayer::Radio::separateReceptionParts = false |
|
protected |
Determines whether the reception of the preamble, header and data part are simulated separately or not.
Referenced by handleSignal(), and initialize().
◆ separateTransmissionParts
| bool inet::physicallayer::Radio::separateTransmissionParts = false |
|
protected |
Determines whether the transmission of the preamble, header and data part are simulated separately or not.
Referenced by handleUpperPacket(), and initialize().
◆ switchingTimes
◆ switchTimer
| cMessage* inet::physicallayer::Radio::switchTimer = nullptr |
|
protected |
◆ transmissionState
◆ transmissionTimer
| cMessage* inet::physicallayer::Radio::transmissionTimer = nullptr |
|
protected |
The timer that is scheduled to the end of the current transmission.
If this timer is not scheduled then no transmission is in progress.
Referenced by abortTransmission(), completeRadioModeSwitch(), continueTransmission(), endTransmission(), getTransmissionInProgress(), handleCrashOperation(), handleSelfMessage(), handleStopOperation(), handleUpperPacket(), initialize(), startTransmission(), updateTransceiverPart(), updateTransceiverState(), and ~Radio().
◆ transmittedSignalPart
◆ transmitter
| const ITransmitter* inet::physicallayer::Radio::transmitter = nullptr |
|
protected |
The transmitter model is never nullptr.
Referenced by inet::physicallayer::ApskRadio::decapsulate(), inet::physicallayer::UnitDiskRadio::encapsulate(), inet::physicallayer::Ieee80211OfdmRadio::encapsulate(), inet::physicallayer::ApskRadio::encapsulate(), inet::physicallayer::Ieee80211Radio::encapsulate(), inet::physicallayer::ApskRadio::getModulation(), initialize(), printToStream(), inet::physicallayer::Ieee80211Radio::setBand(), inet::physicallayer::NarrowbandRadioBase::setBandwidth(), inet::physicallayer::FlatRadioBase::setBitrate(), inet::physicallayer::NarrowbandRadioBase::setCenterFrequency(), inet::physicallayer::Ieee80211Radio::setChannel(), inet::physicallayer::Ieee80211Radio::setChannelNumber(), inet::physicallayer::Ieee80211Radio::setMode(), inet::physicallayer::Ieee80211Radio::setModeSet(), inet::physicallayer::NarrowbandRadioBase::setModulation(), and inet::physicallayer::FlatRadioBase::setPower().
◆ upperLayerIn
| cGate* inet::physicallayer::Radio::upperLayerIn = nullptr |
|
protected |
◆ upperLayerOut
| cGate* inet::physicallayer::Radio::upperLayerOut = nullptr |
|
protected |
The documentation for this class was generated from the following files:
@ SIGNAL_PART_WHOLE
Definition: IRadioSignal.h:26
INET_API InitStage INITSTAGE_LAST
Operations that no other initializations can depend on, e.g.
@ RECEPTION_STATE_IDLE
The radio medium is free, no signal is detected.
Definition: IRadio.h:136
@ RADIO_MODE_TRANSCEIVER
The radio is prepared for simultaneous frame reception and transmission, power consumption is low whe...
Definition: IRadio.h:111
cMessage * transmissionTimer
The timer that is scheduled to the end of the current transmission.
Definition: Radio.h:146
virtual void encapsulate(Packet *packet) const
Definition: Radio.h:232
@ SIGNAL_PART_NONE
Definition: IRadioSignal.h:25
virtual void decapsulate(Packet *packet) const
Definition: Radio.h:233
virtual void handleReceptionTimer(cMessage *message)
Definition: Radio.cc:235
const int id
An identifier which is globally unique for the whole lifetime of the simulation among all radios.
Definition: Radio.h:55
@ RADIO_MODE_OFF
The radio is turned off, frame reception or transmission is not possible, power consumption is zero,...
Definition: IRadio.h:84
simsignal_t packetReceivedFromUpperSignal
Definition: Simsignals.cc:88
int count(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:54
int mediumModuleId
The module id of the medim model.
Definition: Radio.h:78
@ RADIO_MODE_SWITCHING
The radio is switching from one mode to another, frame reception or transmission is not possible,...
Definition: IRadio.h:117
virtual void updateTransceiverPart()
Definition: Radio.cc:581
RadioMode previousRadioMode
The radio is switching from this radio mode to another if a switch is in progress,...
Definition: Radio.h:121
@ RADIO_MODE_SLEEP
The radio is sleeping, frame reception or transmission is not possible, power consumption is minimal,...
Definition: IRadio.h:90
ModuleRefByPar< IRadioMedium > medium
The radio medium model is never nullptr.
Definition: Radio.h:74
@ RECEPTION_STATE_RECEIVING
The radio medium is busy, a signal strong enough to receive is detected.
Definition: IRadio.h:149
IRadioSignal::SignalPart transmittedSignalPart
The current transmitted signal part.
Definition: Radio.h:137
bool sendRawBytes
When true packets are serialized into a sequence of bytes before sending out.
Definition: Radio.h:86
cGate * radioIn
Definition: Radio.h:103
static simsignal_t signalDepartureEndedSignal
This simsignal is emitted when a signal departure is ended on the medium.
Definition: IRadioMedium.h:75
@ RECEPTION_STATE_UNDEFINED
The radio medium state is unknown, reception state is meaningless, signal detection is not possible.
Definition: IRadio.h:130
static simsignal_t transmissionStateChangedSignal
This signal is emitted when the radio transmission state of the radio is changed.
Definition: IRadio.h:60
simsignal_t receptionStartedSignal
Definition: Simsignals.cc:118
virtual void startTransmission(Packet *macFrame, IRadioSignal::SignalPart part)
Definition: Radio.cc:315
static const char * getRadioModeName(RadioMode radioMode)
Returns the name of the provided radio mode.
Definition: IRadio.cc:46
@ RADIO_MODE_TRANSMITTER
The radio is prepared for frame transmission, frame reception is not possible, power consumption is l...
Definition: IRadio.h:104
ReceptionState
This enumeration specifies the reception state of the radio.
Definition: IRadio.h:124
cMessage * switchTimer
The timer that is scheduled to the end of the radio mode switch.
Definition: Radio.h:156
virtual void updateTransceiverState()
Definition: Radio.cc:549
static simsignal_t signalArrivalEndedSignal
This simsignal is emitted when a signal arrival is ended on the medium.
Definition: IRadioMedium.h:87
static simsignal_t signalDepartureStartedSignal
This simsignal is emitted when a signal departure is started on the medium.
Definition: IRadioMedium.h:69
static simsignal_t receivedSignalPartChangedSignal
This signal is emitted when the received part is changed by the radio.
Definition: IRadio.h:66
static simsignal_t transmittedSignalPartChangedSignal
This signal is emitted when the transmitted part is changed by the radio.
Definition: IRadio.h:72
IRadioSignal::SignalPart receivedSignalPart
The current received signal part.
Definition: Radio.h:133
std::string printFieldToString(const IPrintableObject *object, int level, int evFlags=0)
Definition: IPrintableObject.h:98
@ SIGNAL_PART_HEADER
Definition: IRadioSignal.h:28
virtual std::string getCompleteStringRepresentation(int evFlags=0) const
Definition: IPrintableObject.h:78
virtual bool isReceptionTimer(const cMessage *message) const
Definition: Radio.cc:521
simsignal_t transmissionEndedSignal
Definition: Simsignals.cc:117
@ SIGNAL_PART_PREAMBLE
Definition: IRadioSignal.h:27
@ RADIO_MODE_RECEIVER
The radio is prepared for frame reception, frame transmission is not possible, power consumption is l...
Definition: IRadio.h:97
simsignal_t receptionEndedSignal
Definition: Simsignals.cc:119
virtual void abortReception(cMessage *timer)
Definition: Radio.cc:489
void startRadioModeSwitch(RadioMode newRadioMode, simtime_t switchingTime)
Definition: Radio.cc:147
#define EV_FIELD(...)
Definition: INETDefs.h:112
simsignal_t transmissionStartedSignal
Definition: Simsignals.cc:116
void parseRadioModeSwitchingTimes()
Definition: Radio.cc:116
const IReceiver * receiver
The receiver model is never nullptr.
Definition: Radio.h:70
bool separateTransmissionParts
Determines whether the transmission of the preamble, header and data part are simulated separately or...
Definition: Radio.h:91
cMessage * receptionTimer
The timer that is scheduled to the end of the current reception.
Definition: Radio.h:152
static simsignal_t signalArrivalStartedSignal
This simsignal is emitted when a signal arrival is started on the medium.
Definition: IRadioMedium.h:81
virtual void startReception(cMessage *timer, IRadioSignal::SignalPart part)
Definition: Radio.cc:406
virtual void initialize(int stage) override
Definition: PhysicalLayerBase.cc:16
virtual void abortTransmission()
Definition: Radio.cc:379
virtual bool isListeningPossible() const
Definition: Radio.cc:536
virtual IMobility * getMobility() const =0
Returns the mobility of this antenna that describes its position and orientation over time.
virtual void sendUp(Packet *macFrame)
Definition: Radio.cc:507
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
@ TRANSMISSION_STATE_TRANSMITTING
The radio medium is busy, the radio is currently transmitting a signal.
Definition: IRadio.h:171
@ PRINT_LEVEL_TRACE
Definition: IPrintableObject.h:22
const ITransmitter * transmitter
The transmitter model is never nullptr.
Definition: Radio.h:66
INET_API InitStage INITSTAGE_PHYSICAL_LAYER
Initialization of physical layer protocols includes:
SignalPart
This enumeration specifies a part of a radio signal.
Definition: IRadioSignal.h:24
virtual WirelessSignal * createSignal(Packet *packet) const
Definition: Radio.cc:392
ReceptionState receptionState
The current reception state.
Definition: Radio.h:125
static const char * getSignalPartName(SignalPart signalPart)
Returns the name of the provided signal part.
Definition: IRadioSignal.cc:23
bool separateReceptionParts
Determines whether the reception of the preamble, header and data part are simulated separately or no...
Definition: Radio.h:96
virtual cMessage * createReceptionTimer(WirelessSignal *signal) const
Definition: Radio.cc:514
virtual void endReception(cMessage *timer)
Definition: Radio.cc:460
@ SIGNAL_PART_DATA
Definition: IRadioSignal.h:29
@ ST_DATA_WITH_QOS
Definition: Ieee80211Frame_m.h:169
virtual void continueReception(cMessage *timer)
Definition: Radio.cc:431
@ RECEPTION_STATE_BUSY
The radio medium is busy, a signal is detected but it is not strong enough to receive.
Definition: IRadio.h:143
int evFlags
Definition: INETDefs.cc:12
TransmissionState transmissionState
The current transmission state.
Definition: Radio.h:129
virtual const IListening * createListening(const IRadio *radio, const simtime_t startTime, const simtime_t endTime, const Coord &startPosition, const Coord &endPosition) const =0
Returns a description of how the receiver is listening on the medium.
@ RADIO_C_CONFIGURE
Definition: RadioControlInfo_m.h:62
RadioMode nextRadioMode
The radio is switching to this radio radio mode if a switch is in progress, otherwise this is the sam...
Definition: Radio.h:116
const IAntenna * antenna
The radio antenna model is never nullptr.
Definition: Radio.h:62
cGate * upperLayerIn
Definition: Radio.h:102
cGate * upperLayerOut
Gates.
Definition: Radio.h:101
static const char * getRadioReceptionStateName(ReceptionState receptionState)
Returns the name of the provided radio reception state.
Definition: IRadio.cc:53
#define Enter_Method(...)
Definition: SelfDoc.h:71
TransmissionState
This enumeration specifies the transmission state of the radio.
Definition: IRadio.h:155
virtual bool isTransmitterMode(IRadio::RadioMode radioMode) const
Definition: Radio.cc:531
virtual void initializeRadioMode()
Definition: Radio.cc:72
RadioMode
This enumeration specifies the requested operational mode of the radio.
Definition: IRadio.h:79
virtual void setRadioMode(RadioMode newRadioMode) override
Changes the current radio mode.
Definition: Radio.cc:98
virtual void endTransmission()
Definition: Radio.cc:365
static const char * getRadioTransmissionStateName(TransmissionState transmissionState)
Returns the name of the provided radio transmission state.
Definition: IRadio.cc:60
simsignal_t packetSentToUpperSignal
Definition: Simsignals.cc:87
virtual const Coord & getCurrentPosition()=0
Returns the position at the current simulation time.
@ TRANSMISSION_STATE_UNDEFINED
The transmission state is undefined or meaningless.
Definition: IRadio.h:160
virtual void handleTransmissionTimer(cMessage *message)
Definition: Radio.cc:221
@ TRANSMISSION_STATE_IDLE
The radio is not transmitting a signal on the radio medium.
Definition: IRadio.h:166
virtual void handleMessageWhenDown(cMessage *msg)
Definition: OperationalMixinImpl.h:71
virtual void continueTransmission()
Definition: Radio.cc:351
virtual int getId() const override
Returns an identifier for this radio which is globally unique for the whole lifetime of the simulatio...
Definition: Radio.h:209
RadioMode radioMode
State.
Definition: Radio.h:111
void completeRadioModeSwitch(RadioMode newRadioMode)
Definition: Radio.cc:157
static simsignal_t receptionStateChangedSignal
This signal is emitted when the radio reception state of the radio is changed.
Definition: IRadio.h:54
virtual bool isReceiverMode(IRadio::RadioMode radioMode) const
Definition: Radio.cc:526
static simsignal_t radioModeChangedSignal
This signal is emitted when the radio mode of the radio is changed.
Definition: IRadio.h:42
virtual void handleSwitchTimer(cMessage *message)
Definition: Radio.cc:216
simtime_t switchingTimes[RADIO_MODE_SWITCHING][RADIO_MODE_SWITCHING]
Simulation time required to switch from one radio mode to another.
Definition: Radio.h:82