// Wait until both parameter groups TSC1 and EEC1 are received and analyze its content.
pg TSC1 pgTSC1;
pg EEC1 pgEEC1;
long indexTSC1, indexEEC1;
long result;
// 1. define combination of waiting conditions
indexTSC1 = TestJoinJ1939PGEvent(TSC1);
indexEEC1 = TestJoinJ1939PGEvent(EEC1);
// 2. Wait for both parameter groups
result = TestWaitForAllJoinedEvents(2000);
if (result > 0)
{
// 3. Put data of TSC1 to pgTSC1 and analyze content
if (TestGetWaitJ1939PGData(indexTSC1, pgTSC1) == 0)
{
//4. Validate data of pgTSC1
…
}
// 5. Put data of EEC1 to pgEEC1 and analyze content
if (TestGetWaitJ1939PGData(indexEEC1, pgEEC1) == 0)
{
//4. Validate data of pgEEC1
…
}
}
else if (result == 0)
{
TestStepFail("Validation", " EEC1 and TSC are not received within 2000 ms");
}
else
{
TestStepFail ("Validation", " TestWaitForAllJoinedEvents failed with unexpecetd error %i", result);
}