Protected Member Functions

CSMA802154 Class Reference
[macLayer - MAC layer modulesCSMA - Classes for the CSMA implementation of MiXiMIEEE 802.15.4 - Classes for the IEEE 802.15.4 implementation of MiXiM]

Extends "csma" module by some statistics send up to the upper layer. More...

#include <CSMA802154.h>

Inherits csma.

Collaboration diagram for CSMA802154:
Collaboration graph
[legend]

List of all members.

Protected Member Functions

virtual void initialize (int stage)
 Initialization of the module and some variables.
virtual cPacket * decapsMsg (MacPkt *macPkt)

Detailed Description

Extends "csma" module by some statistics send up to the upper layer.

Author:
Jerome Rousselot, Amre El-Hoiydi, Marc Loebbers, Yosia Hadisusanto, Andreas Koepke
Karl Wessel (port for MiXiM)

Definition at line 32 of file CSMA802154.h.


Member Function Documentation

cPacket * CSMA802154::decapsMsg ( MacPkt *  macPkt  )  [protected, virtual]

Update the internal copies of interesting BB variables

Reimplemented from csma.

Definition at line 29 of file CSMA802154.cc.

References DeciderResult802154Narrow::getBER(), PhyToMacControlInfo::getDeciderResult(), DeciderResult802154Narrow::getRSSI(), MacToNetwControlInfo::setBitErrorRate(), and MacToNetwControlInfo::setRSSI().

                                              {

  cPacket * msg = csma::decapsMsg(macPkt);

  // get bit error rate
  PhyToMacControlInfo* cinfo = static_cast<PhyToMacControlInfo*> (macPkt->getControlInfo());
  const DeciderResult802154Narrow* result = static_cast<const DeciderResult802154Narrow*> (cinfo->getDeciderResult());
  double ber = result->getBER();
  double rssi = result->getRSSI();

  //get control info attached by base class decapsMsg method
  //and set its rssi and ber
  assert(dynamic_cast<MacToNetwControlInfo*>(msg->getControlInfo()));
  MacToNetwControlInfo* cInfo = static_cast<MacToNetwControlInfo*>(msg->getControlInfo());
  cInfo->setBitErrorRate(ber);
  cInfo->setRSSI(rssi);

  return msg;
}

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

Initialization of the module and some variables.

Initialize the of the omnetpp.ini variables in stage 1. In stage two subscribe to the RadioState.

Reimplemented from csma.

Definition at line 24 of file CSMA802154.cc.

{
  csma::initialize(stage);
}


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