// Test case for measuring edges of a number of data bytes of a LIN frame.
// Note: This test case can only be used in the context of test module nodes
testcase tcMeasureEdges(int byteIndex)
{
long indices[1];
float timeDiffs[4];
dword numDiffs;
indices[0] = byteIndex;
// set request to measure the edges of the specified byte of the frame with ID=0x33
linMeasEdgeTimeDiffs(1, indices, 0x33);
// wait maximum 1000 [ms] for frame with ID=0x33
waitResult = TestWaitForMessage(0x33, 1000);
// declare failure if Wait has resumed not due to expected event
if (1 != waitResult)
{
TestStepFail("Test1.1","Expected frame has not occurred during 1000 ms!");
}
// retrieve measured edges
numDiffs = LINGetMeasEdgeTimeDiffs(4, timeDiffs);
if (numDiffs == 0)
{
TestStepFail("Test1.1", "Failed to measure edges!");
}
else
{
TestStepPass("Test 1.1", "Edge measurement done...");
}
}