How do I get hostId in the Inetmanet framework? Is it possible to
extend AirFrame.msg to include sender hostId?
Thank you
This is my code to include hostId in the AirFrame.msg. Please suggest
since I keep getting error during build.
AirFrame.msg
cplusplus {{
#include "INETDefs.h"
#include "Coord.h"
#include "cModule.h"
}}
class noncobject cModule;
packet AirFrameExtended extends AirFrame
{
double carrierFrequency; //
double bandwidth;
double senderModuleId;
cModule *senderHostId; //
}
Then code to encapsulate the msg..
AirFrame* Ieee802154Phy::encapsulatePacket(cMessage *frame)
{
//PhyControlInfo *ctrl = dynamic_cast<PhyControlInfo *>(frame-
>removeControlInfo());
//ASSERT(!ctrl || ctrl->getChannelNumber()==-1); // per-packet
channel switching not supported
// Note: we don't set length() of the AirFrame, because duration
will be used everywhere instead
AirFrameExtended* airframe = new AirFrameExtended();
airframe->setName(frame->getName());
airframe->setPSend(transmitterPower);
airframe->setChannelNumber(getChannelNumber());
airframe->encapsulate(PK(frame));
airframe->setBitrate(rs.getBitrate());
airframe->setDuration(radioModel->calculateDuration(airframe));
airframe->setSenderPos(getMyPosition());
airframe->setCarrierFrequency(carrierFrequency);
airframe->setSenderModuleId(frame->getSenderModuleId());
airframe->setSenderHostId(getParentModule()->getParentModule()-
>getFullName());
//delete ctrl;
EV << "[PHY]: encapsulating " << frame->getName() << " into an
airframe" << endl;
return airframe;
}
Thank you!!
I would like the Airframe to contain sender ID e.g:
host[1],host[2],etc...
Please help,
Thank you
On Feb 7, 7:05 pm, Alfonso Ariza Quintana <aariza...@hotmail.com>
wrote:
> what do you define like node Id?
>
>
>
> > Date: Sat, 6 Feb 2010 19:01:14 -0800
> > Subject: [Omnetpp-l] Re: hostId in Inetmanet
> > From: mun1...@gmail.com
> _________________________________________________________________
> Recibe las alertas Hotmail en tu móvil ¡Actívalas ya!http://home.mobile.live.com/MobileAttach.mvc/?mkt=es-es
Thank you