为什么这个程序不起作用?我只是改变了讯息内容。改变静脉信息
而不是发送路障ID,我想发送一个“MyMessage”字符串的通用消息。
void TraCIDemoRSU11p::sendMessage(std::string blockedRoadId)
{
sentMessage = true;
t_channel channel = dataOnSch ? type_SCH : type_CCH;
WaveShortMessage* wsm = prepareWSM("data", dataLengthBits, channel, dataPriority, -1,2);
//wsm->setWsmData(blockedRoadId.c_str());
wsm->setWsmData("MyMessage");
sendWSM(wsm);
}
仿真开始,但是当第一个消息将被发送出现错误:
TraCI Server reported error executing command 0xc4:"Referenced edge 'MyMessage' is not known".
你是什么意思“不起作用” - 它不编译,或者它产生一个异常或运行时错误? –
我会编辑我的问题,谢谢 – pb772