testcase ByteBitRatesTest()
{
long indices[2] = { -2, -1 };
float byteBitRates[2];
dword numByteBitRates, i;
char variableDesc[32];
// start a new edge difference measurement for the next frame
if (linMeasEdgeTimeDiffs(2, indices) == 0)
{
TestStepFail("ByteBitRatesTest", "Starting of edge measurement failed.");
return;
}
// wait for any lin header
if (testWaitForLinHeader(1000) != 1)
{
TestStepFail("ByteBitRatesTest", "No LIN header received within 1000 ms.");
return;
}
// receive the measured bitrates
numByteBitRates = linGetMeasByteBitRates(elCount(byteBitRates), byteBitRates);
if (numByteBitRates != elCount(indices))
{
TestStepFail("ByteBitRatesTest", "Received implausible number of bitrates.");
return;
}
for (i = 0; i < numByteBitRates; i++)
{
snprintf(variableDesc, elCount(variableDesc), "Bitrate of byte %d", indices[i]);
testCaseReportMeasuredValue(variableDesc, byteBitRates[i], "bit/s");
}
TestStepPass("ByteBitRatesTest", "All byte bitrates have been received.");
}