I have create 1 winform to send and read CAN Message of ECU and when i create function Clear All DTC with command: 0x14 0xFF 0xFF 0xFF, Message Response is 7F 14 78 (Request Correctly Received – Response Pending). I add Thread.Sleep to wait for response but it doesn't work very well.
if (receivedMes.DATA[0] == 0x7F && receivedMes.DATA[2] == 0x78)
{
clsLogManager.LogWarning("Received NRC 0x78, waiting for extended time...");
Thread.Sleep(m_nIOTimeOut * 50);
receivedMes = GetResponseClearDTC(ECU_DID.ClearDTCInformation, m_nIOTimeOut);
if (receivedMes == null || receivedMes.ID == 0 || receivedMes.LENGTH == 0) return false;
}
Help me pls. Thank you.
Every UDS command can take longer than P2ServerMax. In that case, on every NRC BUSY, you will need to wait up to P2*ServerMax until the final response will come. These values are ECU-specific and you get them as the response to a diagnostic session control (e.g., 10 01
).