Defines the methods provided by the phy to the mac layer. More...
#include <MacToPhyInterface.h>
Inherited by BasePhyLayer.
Public Types | |
enum | BasePhyMessageKinds { TX_OVER = 22000, RADIO_SWITCHING_OVER, CHANNEL_SENSE_REQUEST, AIR_FRAME, LAST_BASE_PHY_KIND } |
Message kinds used by every phy layer. More... | |
Public Member Functions | |
virtual int | getRadioState ()=0 |
Returns the current state the radio is in. See RadioState for possible values. | |
virtual simtime_t | setRadioState (int rs)=0 |
Tells the BasePhyLayer to switch to the specified radio state. | |
virtual ChannelState | getChannelState ()=0 |
Returns the current state of the channel. See ChannelState for details. | |
virtual int | getPhyHeaderLength ()=0 |
Returns the length of the phy header in bits. | |
virtual void | setCurrentRadioChannel (int newRadioChannel)=0 |
Sets the channel currently used by the radio. | |
virtual int | getCurrentRadioChannel ()=0 |
Returns the channel currently used by the radio. | |
virtual int | getNbRadioChannels ()=0 |
Returns the number of channels available on this radio. |
Defines the methods provided by the phy to the mac layer.
Definition at line 17 of file MacToPhyInterface.h.
Message kinds used by every phy layer.
Physical layers should begin their additional kinds at the value of LAST_BASE_PHY_KIND.
Definition at line 26 of file MacToPhyInterface.h.
{ TX_OVER = 22000, RADIO_SWITCHING_OVER, CHANNEL_SENSE_REQUEST, AIR_FRAME, LAST_BASE_PHY_KIND, };
virtual ChannelState MacToPhyInterface::getChannelState | ( | ) | [pure virtual] |
Returns the current state of the channel. See ChannelState for details.
NOTE: Channel state information is not available until initialization is over and the simulation has started.
Implemented in BasePhyLayer.
Referenced by Mac80211::beginNewCycle(), and CSMAMacLayer::handleSelfMsg().
virtual int MacToPhyInterface::getPhyHeaderLength | ( | ) | [pure virtual] |
Returns the length of the phy header in bits.
Since the MAC layer has to create the signal for a transmission it has to know the total length of the packet and therefore needs the length of the phy header.
Implemented in BasePhyLayer.
Referenced by BaseMacLayer::initialize().
virtual int MacToPhyInterface::getRadioState | ( | ) | [pure virtual] |
Returns the current state the radio is in. See RadioState for possible values.
NOTE: Radio state information is not available until initialization-stage 1.
This method is mainly used by the mac layer.
Implemented in BasePhyLayer.
Referenced by Mac80211::handleLowerControl(), LMacLayer::handleLowerControl(), CSMAMacLayer::handleLowerControl(), BMacLayer::handleLowerControl(), Mac80211::handleLowerMsg(), CSMAMacLayer::handleSelfMsg(), BMacLayer::handleSelfMsg(), and CSMAMacLayer::scheduleBackoff().
virtual simtime_t MacToPhyInterface::setRadioState | ( | int | rs | ) | [pure virtual] |
Tells the BasePhyLayer to switch to the specified radio state.
NOTE: Radio state can't be changed until initialization-stage 1.
The switching process can take some time depending on the specified switching times in the ned file. The return value is the time needed to switch to the specified state, or smaller zero if the radio could not be switched (propably because it is already switching.
Implemented in BasePhyLayer, PhyLayerBattery, and PhyLayerUWBIR.
Referenced by Mac80211::handleEndContentionTimer(), Mac80211::handleEndSifsTimer(), Mac80211::handleLowerControl(), LMacLayer::handleLowerControl(), CSMAMacLayer::handleLowerControl(), LMacLayer::handleSelfMsg(), CSMAMacLayer::handleSelfMsg(), BMacLayer::handleSelfMsg(), AlohaMacLayer::initialize(), and SimpleMacLayer::initialize().