Public Types | Public Member Functions

MacToPhyInterface Class Reference
[macLayer - MAC layer modulesphyLayer - physical layer modules]

Defines the methods provided by the phy to the mac layer. More...

#include <MacToPhyInterface.h>

Inherited by BasePhyLayer.

List of all members.

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.

Detailed Description

Defines the methods provided by the phy to the mac layer.

Definition at line 17 of file MacToPhyInterface.h.


Member Enumeration Documentation

Message kinds used by every phy layer.

Physical layers should begin their additional kinds at the value of LAST_BASE_PHY_KIND.

Enumerator:
TX_OVER 

Indicates the end of a send transmission.

RADIO_SWITCHING_OVER 

Indicates the end of a radio switch.

CHANNEL_SENSE_REQUEST 

Channel sense control message between Mac and Phy.

AIR_FRAME 

AirFrame kind.

LAST_BASE_PHY_KIND 

Stores the id on which classes extending BasePhy should continue their own kinds.

Definition at line 26 of file MacToPhyInterface.h.

                           {
    TX_OVER = 22000,
    RADIO_SWITCHING_OVER,
    CHANNEL_SENSE_REQUEST,
    AIR_FRAME,
    LAST_BASE_PHY_KIND,
  };


Member Function Documentation

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().


The documentation for this class was generated from the following file: