INET Framework for OMNeT++/OMNEST
WirelessMacBase Class Reference

#include <WirelessMacBase.h>

Inheritance diagram for WirelessMacBase:
CSMAMacLayer Ieee80211Mac Mac80211

List of all members.

Protected Member Functions

virtual void initialize (int)
 Initialization of the module and some variables.
virtual void handleMessage (cMessage *msg)
 Called every time a message arrives.
Handle Messages

Functions to redefine by the programmer

virtual void handleSelfMsg (cMessage *msg)=0
 Handle self messages such as timers.
virtual void handleUpperMsg (cPacket *msg)=0
 Handle packets from upper layer.
virtual void handleCommand (cMessage *msg)=0
 Handle commands from upper layer.
virtual void handleLowerMsg (cPacket *msg)=0
 Handle packets from lower layer.
virtual bool isUpperMsg (cMessage *msg)
virtual bool isLowerMsg (cMessage *msg)
Convenience Functions
virtual void sendDown (cMessage *msg)
 Sends a message to the lower layer.
virtual void sendUp (cMessage *msg)
 Sends a message to the upper layer.

Protected Attributes

NotificationBoardnb
 Cached pointer to the NotificationBoard module.
int uppergateIn
 gate id
int uppergateOut
int lowergateIn
int lowergateOut

Detailed Description

Base class for wireless MAC protocols that use MF's physical layer.

Author:
Daniel Willkomm, Andras Varga

Member Function Documentation

virtual void WirelessMacBase::handleCommand ( cMessage *  msg) [protected, pure virtual]

Handle commands from upper layer.

Implemented in Ieee80211Mac, CSMAMacLayer, and Mac80211.

Referenced by handleMessage().

virtual void WirelessMacBase::handleLowerMsg ( cPacket *  msg) [protected, pure virtual]

Handle packets from lower layer.

Implemented in Ieee80211Mac, CSMAMacLayer, and Mac80211.

Referenced by handleMessage().

void WirelessMacBase::handleMessage ( cMessage *  msg) [protected, virtual]

Called every time a message arrives.

{
    if (msg->isSelfMessage())
        handleSelfMsg(msg);
    else if (!msg->isPacket())
        handleCommand(msg);
    else if (msg->getArrivalGateId()==uppergateIn)
        handleUpperMsg(PK(msg));
    else
        handleLowerMsg(PK(msg));
}
virtual void WirelessMacBase::handleSelfMsg ( cMessage *  msg) [protected, pure virtual]

Handle self messages such as timers.

Implemented in Ieee80211Mac, CSMAMacLayer, and Mac80211.

Referenced by handleMessage().

virtual void WirelessMacBase::handleUpperMsg ( cPacket *  msg) [protected, pure virtual]

Handle packets from upper layer.

Implemented in Ieee80211Mac, CSMAMacLayer, and Mac80211.

Referenced by handleMessage().

void WirelessMacBase::initialize ( int  stage) [protected, virtual]

Initialization of the module and some variables.

Reimplemented in Ieee80211Mac, CSMAMacLayer, and Mac80211.

{
    if (stage==0)
    {
        uppergateIn  = findGate("uppergateIn");
        uppergateOut = findGate("uppergateOut");
        lowergateIn  = findGate("lowergateIn");
        lowergateOut = findGate("lowergateOut");

        // get a pointer to the NotificationBoard module
        nb = NotificationBoardAccess().get();
    }
}
bool WirelessMacBase::isLowerMsg ( cMessage *  msg) [protected, virtual]

Referenced by Ieee80211Mac::handleWithFSM().

{
    return msg->getArrivalGateId()==lowergateIn;
}
bool WirelessMacBase::isUpperMsg ( cMessage *  msg) [protected, virtual]

Referenced by Ieee80211Mac::handleWithFSM().

{
    return msg->getArrivalGateId()==uppergateIn;
}
void WirelessMacBase::sendUp ( cMessage *  msg) [protected, virtual]

Sends a message to the upper layer.

Referenced by Mac80211::decapsulateAndSendUp(), CSMAMacLayer::handleLowerMsg(), and Ieee80211Mac::handleWithFSM().

{
    EV << "sending up " << msg << "\n";
    send(msg, uppergateOut);
}

Member Data Documentation

Referenced by initialize(), and isLowerMsg().

Referenced by initialize(), and sendDown().

gate id

Referenced by handleMessage(), initialize(), and isUpperMsg().

Referenced by initialize(), and sendUp().


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