Hi,
I am using mixim 2.3 and OMNeT++ 4.6. I would like to get the RSSI value in the mac layer, which I cannot do. Can someone please help me regarding this? I am not using the new INET because all my codes are developed in mixim.
After a detailed search in the forum, I found two links that gives some information regarding this. Still I cannot solve this problem.
Link1: User l
event okcu wrote on 3/4/12
my answer was incomplete... if u're working in the netw layer u can
use MacToNetwControlInfo to get rssi in mixim.
void NetwLayer::handleLowerMsg(cMessage* msg)
{
WsnPkt *m = check_and_cast<WsnPkt *>(msg);
double rssi = static_cast<MacToNetwControlInfo*>(m-
>getControlInfo())->getRSSI();
}
Link2: User
Khan wrote on 2/21/11
cPacket *csma::decapsMsg(MacPkt * macPkt) {
cPacket * msg = macPkt->decapsulate();
MacToNetwControlInfo* info = new MacToNetwControlInfo(macPkt->getSrcAddr());
msg->setControlInfo(info);
PhyToMacControlInfo* cinfo = static_cast<PhyToMacControlInfo*> (macPkt->getControlInfo());
const DeciderResult802154Narrow* result = static_cast<const DeciderResult802154Narrow*> (cinfo->getDeciderResult());
ev<<result->getRSSI()<<"\n";
return msg;
}
It is very urgent for me. Please someone help me. Thanks in advance.
Regards,
Megh