I am creating a CAPL lib to test UDS. I use the function testWaitForDiagResponseStart to detect the first response frame within a defined time. The function work well on CAN, however a problem arrived when use on LIN protocol.
- This function can detect the first positive response frame.
- This function can detect the first negative response frame (e.g. NRC7E, NRC13)
- This function can not detect the first negative response frame with NRC 78.
Why this function can detect other NRC other than NRC 78? Is this have to do with other physical configuration in ldf file or ISO TP? Anyone who have knowledge on this topic please support me. positive NRC7E NRC78
ret = testWaitForDiagResponseStart(reqObj,Timer50ms*1.1); //<0: error; 0: timeout; 1:success
switch(ret)
{
case 0: //The timeout, the event not occurred.
//testStepFail("","No response received!");
switch(diagGetSuppressResp(reqObj))
{
case 0: //SPRMIBit is not set.
testStepFail("","No response received within P2 = %d ms",Timer50ms);
break;
case 1: //SPRMIBit is set.
testStepPass("","UDS request's suppressPosRspMsgIndicationBit is set!\nNo response received within P2 = %d ms",Timer50ms);
break;
default: //Error code
testStepFail("","Error while getting Suppress bit status. Error code: %ld", diagGetSuppressResp(reqObj));
break;
}
break;
I have never dealt with UDS over LIN, but it's possible your diagnostic description (.odx, .pdx, .cdd) assigned to your node does not define 0x78 as a valid NRC for the service request you are making, as in this example:
If you look at the bottom right corner, the only defined NRCs for this diagnostic request are 0x13, 0x22, and 0x7E. I guess it's possible the CAPL function only recognizes responses with an assigned NRC as valid responses to the request? I would investigate you diagnostic description.