Change channel in INETMANET

48 views
Skip to first unread message

Luca Bedogni

unread,
Feb 3, 2012, 2:12:50 PM2/3/12
to omn...@googlegroups.com
Hi
I'm building a model in which I have the host to change their
communication channel.

Actually, my host is composed by: NotificationBoard, Mobility,
Ieee80211Mac, Ieee80211NewRadio. I can set the channel number in
omnetpp.ini, but then I can't get any clue on how to get this number
at runtime and, more important, how to change it.

Any hint? Thanks

surya

unread,
Feb 4, 2012, 11:21:58 AM2/4/12
to omnetpp
I pass a new message to the radio layer from the mac layer. The
following code did the job for me:

cMessage *newtemp = new cMessage();
newtemp->setKind(1);
PhyControlInfo *phyControlInfo = new PhyControlInfo;
phyControlInfo->setChannelNumber(1); // select the channel number here
newtemp->setControlInfo(phyControlInfo);
sendDown(newtemp);
Reply all
Reply to author
Forward
0 new messages