Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

BasicMacLayer Class Reference
[macLayer - MAC layer modulesbasicModules - basic module classes of the MF]

A very simple MAC module template which provides de- and encapsulation of messages using the standard addresses and MacControlInfo of the MF. It also provides basic handling of lower layer messages. More...

#include <BasicMacLayer.h>

Inherits BasicLayer.

Inherited by AlohaMacLayer, and CSMAMacLayer.

Inheritance diagram for BasicMacLayer:

Inheritance graph
[legend]
Collaboration diagram for BasicMacLayer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Module_Class_Members (BasicMacLayer, BasicLayer, 0)
virtual void initialize (int)
 Initialization of the module and some variables.
virtual void handleUpperMsg (cMessage *msg)=0
 Handle messages comming from the network layer.
virtual void handleLowerMsg (cMessage *msg)

Protected Member Functions

virtual cMessage * decapsMsg (MacPkt *)
 decapsulate the network message from the MacPkt
virtual MacPkt * encapsMsg (cMessage *)
 Encapsulate the NetwPkt into an MacPkt.

Protected Attributes

int headerLength
 Length of the MacPkt header.
int myMacAddr
 MAC address (simply module id).
bool coreDebug
 debug this core module?

Detailed Description

A very simple MAC module template which provides de- and encapsulation of messages using the standard addresses and MacControlInfo of the MF. It also provides basic handling of lower layer messages.

Author:
Daniel Willkomm


Member Function Documentation

cMessage * BasicMacLayer::decapsMsg MacPkt *  msg  )  [protected, virtual]
 

decapsulate the network message from the MacPkt

Decapsulates the network packet from the received MacPkt

MacPkt * BasicMacLayer::encapsMsg cMessage *  msg  )  [protected, virtual]
 

Encapsulate the NetwPkt into an MacPkt.

Encapsulates the received NetwPkt into a MacPkt and set all needed header fields.

void BasicMacLayer::handleLowerMsg cMessage *  msg  )  [virtual]
 

If message arrives from lower layer, check whether it is for us. Send it up if yes.

Implements BasicLayer.

Reimplemented in CSMAMacLayer.

virtual void BasicMacLayer::handleUpperMsg cMessage *  msg  )  [pure virtual]
 

Handle messages comming from the network layer.

Here is the place to implement a real medium access functionality.

If message arrives from upper layer, make a MAC packet from it (encapsMsg) and send it down (sendDOwn).

See also:
encapsMsg, sendDown

Implements BasicLayer.

Implemented in AlohaMacLayer, and CSMAMacLayer.

void BasicMacLayer::initialize int  stage  )  [virtual]
 

Initialization of the module and some variables.

First we have to initialize the module from which we derived ours, in this case BasicLayer.

Reimplemented from BasicLayer.

Reimplemented in AlohaMacLayer, and CSMAMacLayer.


The documentation for this class was generated from the following files:
Generated on Fri Jan 12 08:29:40 2007 for Mobility Framework by  doxygen 1.4.4