char kBusContextJ1939_1[100] = "J1939_1";
export testfunction TestWaitForDtcCycle(long sa, dword pgn, dword spn, dword timeoutToAppear, dword timeoutToDisappear)
{
long result;
testStepPass();
setBusContext( getBusNameContext(kBusContextJ1939_1) ); // Set the channel, the test function is applied to
// Wait for the given SPN
result = TestWaitForJ1939DTC(sa, pgn, spn, timeoutToAppear );
if (result != 1)
{
// SPN did not occur - Test failed
TestStepFail ("DTC did not occur");
}
// Expect the SPN to be dismissed.
result = testWaitForJ1939DmWithoutSPN(sa, pgn, spn, timeoutToDisappear);
if (result != 1)
{
// SPN is still sent - Test failed
TestStepFail ("SPN is still part of the given DM");
}
}