With scheduleAt, see the examples
void Wireless :: initialize()
{
if(par("sendInitMsg").boolValue()==true)
{
EV<<"Sending initial message....\n"; // printing statement
target = getParentModule()->getSubmodule("wireless1"); // defining a module
cMessage *msg = new cMessage("tictocMsg"); // creating a message
simtime_t delay_t = 0.5;
simtime_t dur = 1.0;
sendDirect(msg,0,target,"radioIn"); // sendDirect
message
cMessage *msg2 = new cMessage();
scheduleAt(msg2,siTime()+1);
}
}
void Wireless :: handleMessage(cMessage *msg)
{
If (msg->isSelfMessage()) {
target = getParentModule()->getSubmodule("wireless1"); // defining a module
cMessage *msg2 = new cMessage("tictocMsg"); // creating a message
sendDirect(msg,0,target,"radioIn"); // sendDirect message
cMessage *msg2 = new cMessage();
scheduleAt(msg,siTime()+1);
}
Enviado desde Correo para Windows 10
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.