Problem with mobility framework

4 views
Skip to first unread message

Elwin

unread,
Nov 6, 2009, 12:31:32 PM11/6/09
to omnetpp
I have modified some source code of the mobility framework and written
some code with my own application.
Here is a part of the function for appl layer I have written:
cModule *nmod = getParentModule()->getSubmodule("net");
SimpleNetwLayer *netP = (SimpleNetwLayer *) nmod;
int netAddr = netP->getNetAddr(); // a function written by me and
it returns the net address of the host

cModule *mmod = getParentModule()->getSubmodule("nic")-
>getSubmodule("mac");
Mac80211 *macP = (Mac80211 *) mmod;
int index = macP->randNeighborAddr(); // a function written by me
and it returns the module index of a neighbor host

ApplPkt *pkt = new ApplPkt("DATAFRAME_MESSAGE",
DATAFRAME_MESSAGE);
pkt->setDestAddr(index);
// we use the host modules getIndex() as a appl address
pkt->setSrcAddr( myApplAddr() );
pkt->setBitLength(headerLength);

// set the control info to tell the network layer the layer 3
// address;
pkt->setControlInfo( new NetwControlInfo(netAddr) );

EV << "Sending data frame packet!\n";
sendDown( pkt );

When I ran this function, the application just terminated with exit
code: -1073741819
Reply all
Reply to author
Forward
0 new messages