Extends "csma" module by some statistics send up to the upper layer. More...
#include <CSMA802154.h>
Inherits csma.
Protected Member Functions | |
virtual void | initialize (int stage) |
Initialization of the module and some variables. | |
virtual cPacket * | decapsMsg (MacPkt *macPkt) |
Extends "csma" module by some statistics send up to the upper layer.
Definition at line 32 of file CSMA802154.h.
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); }