我目前正在尝试为控制器测试自动生成代码 .
测试将在带有Capl的CANoe中完成 .
我已经尝试了很多东西并且它运行良好,但现在我想测试一条“消息丢失” .
我需要这样的东西 .
CAN 1正在发送10次测试消息 . 3次会有消息丢失 .
接收信号的CAN 2必须以特定值对此作出反应 .
我需要WaitForMessage(int aTimeOut,Message yourMessage)之类的东西,例如0表示成功访问Message或-1表示timeOut .
on timer sendMessage
{
if(anzahlAnBotschaften > 0) // amount of sent Messages
{
if(anzahlAnBotschaften % 3 == 0) // 3 times message lost
{
botschaftWirdGesendet = 0;
lRet = ???? here is the part where i want to wait for a an answer from CAN2
if(lRet != 0)
{
TestStepPass("010.1", "SNA was triggered");
}
else
{
TestStepFail("010.1", "Timeout was triggered, but no SNA was found");
}
}
else
{
botschaftWirdGesendet = 1;
output(sendingCan_BrkSys);
lRet = TestGetWaitEventMsgData(receivingCan_aMessage);
if(lRet == 0)
{
// same for the positive case
}
}
anzahlAnBotschaften -- ;
setTimer(botschaftsAusfall,20);
}
}