我想从节点R2接收一条消息并返回答案,并计算msg
到结束之间的延迟,为此我使用了sendDirect ()
。这是R1中的handlemessage代码(必须接收消息),但是在仿真过程中出现问题,我设法将消息从R2发送到R1,但是在仿真停止并显示后:
“ unsupprted命令,在inet :: physicalLayer :: UnitDiskRadio模块中)
有人可以帮我吗?
void R1::handleMessage(cMessage *msg)
{
if (strcmp(msg->getName(), "demande video") == 0)
{
eed1 = simTime() - msg->getTimestamp();
cModule *m = msg->getSenderModule();
a = m->getId();
data = new cMessage("reponse video");
this->sendDirect(msg, m, "radioIn", 0);
simtime_t eed2 = simTime() - data->getTimestamp();
eed_total = eed2.dbl() + eed1.dbl();
答案 0 :(得分:0)
感谢您的答复,我尝试了调试器模式,但遇到了这些错误,但我不知道错误在哪里
omnetpp::cRuntimeError::notifyEnvir() at cexception.cc:260 0x7d49f0 omnetpp::cRuntimeError::cRuntimeError() at cexception.cc:234 0x7d4a7b inet::physicallayer::Radio::handleLowerCommand() at Radio.cc:269 0x9517501 inet::physicallayer::PhysicalLayerBase::handleLowerMessage() at PhysicalLayerBase.cc:38 0x94e6b6c
inet::LayeredProtocolBase::handleMessageWhenUp() at LayeredProtocolBase.cc:29 0x8cdd47a
inet::OperationalBase::handleMessage() at OperationalBase.cc:67 0x8d81da7
omnetpp::cSimulation::doMessageEvent() at csimulation.cc:669 0x855d23
omnetpp::cSimulation::executeEvent() at csimulation.cc:611 0x85581b
omnetpp::qtenv::Qtenv::doRunSimulation() at qtenv.cc:895 0x1819af1
omnetpp::qtenv::Qtenv::runSimulation() at qtenv.cc:745 0x1818f4e