hostId in Inetmanet

17 views
Skip to first unread message

Munirah

unread,
Feb 6, 2010, 8:39:01 PM2/6/10
to omnetpp
Hi,

How do I get hostId in the Inetmanet framework? Is it possible to
extend AirFrame.msg to include sender hostId?

Thank you

Munirah

unread,
Feb 6, 2010, 10:01:14 PM2/6/10
to omnetpp
Hello,

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!!

Alfonso Ariza Quintana

unread,
Feb 7, 2010, 6:05:03 AM2/7/10
to omn...@googlegroups.com
what do you define like node Id?

> Date: Sat, 6 Feb 2010 19:01:14 -0800
> Subject: [Omnetpp-l] Re: hostId in Inetmanet
> From: mun...@gmail.com
> To: omn...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups "omnetpp" group.
> To post to this group, send email to omn...@googlegroups.com.
> To unsubscribe from this group, send email to omnetpp+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/omnetpp?hl=en.
>


Disfruta de un resumen diario de tu Hotmail en tu móvil Movistar. ¡Accede ya!

Munirah

unread,
Feb 7, 2010, 7:45:26 PM2/7/10
to omnetpp
Hi,

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

Munirah

unread,
Feb 8, 2010, 3:30:21 AM2/8/10
to omnetpp
Solved...

Thank you

Reply all
Reply to author
Forward
0 new messages