WirelessMacBase Class Reference

#include <WirelessMacBase.h>

Inheritance diagram for WirelessMacBase:

CSMAMacLayer Ieee80211Mac Mac80211

List of all members.


Detailed Description

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

Author:
Daniel Willkomm, Andras Varga

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

Member Function Documentation

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

Initialization of the module and some variables.

Reimplemented in Ieee80211Mac, CSMAMacLayer, and Mac80211.

Referenced by Mac80211::initialize(), Ieee80211Mac::initialize(), and CSMAMacLayer::initialize().

00029 {
00030     if (stage==0)
00031     {
00032         uppergateIn  = findGate("uppergateIn");
00033         uppergateOut = findGate("uppergateOut");
00034         lowergateIn  = findGate("lowergateIn");
00035         lowergateOut = findGate("lowergateOut");
00036 
00037         // get a pointer to the NotificationBoard module
00038         nb = NotificationBoardAccess().get();
00039     }
00040 }

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

Called every time a message arrives.

00044 {
00045     if (msg->isSelfMessage())
00046         handleSelfMsg(msg);
00047     else if (!msg->isPacket())
00048         handleCommand(msg);
00049     else if (msg->getArrivalGateId()==uppergateIn)
00050         handleUpperMsg(PK(msg));
00051     else
00052         handleLowerMsg(PK(msg));
00053 }

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

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

bool WirelessMacBase::isUpperMsg ( cMessage *  msg  )  [protected, virtual]

Referenced by Ieee80211Mac::handleWithFSM().

00056 {
00057     return msg->getArrivalGateId()==uppergateIn;
00058 }

bool WirelessMacBase::isLowerMsg ( cMessage *  msg  )  [protected, virtual]

Referenced by Ieee80211Mac::handleWithFSM().

00061 {
00062     return msg->getArrivalGateId()==lowergateIn;
00063 }

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

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

Sends a message to the upper layer.

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

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


Member Data Documentation

gate id

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

Referenced by initialize(), and sendUp().

Referenced by initialize(), and isLowerMsg().

Referenced by initialize(), and sendDown().


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

Generated on Fri Mar 20 18:51:23 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5