About UDS_WaitForMultipleMessage and UDS_SvcTesterPresent
Posted: Thu 27. Apr 2017, 11:24
Hello,
In my case,the ECU's TesterPresent (0x3E) service is not standard.
Here is what I need: But the PCAN UDS API does not match: I want to disable the TesterPresent function,So I set to the default session:
But when UDS_WaitForMultipleMessage is timeout,the API send TesterPresent messsage automatically:
Question 1:When I use UDS_WaitForMultipleMessage function,is there any way to disable TesterPresent completely?
Question 2:Is there any way to set the TesterPresent function to send "0x3E" instead of "0x3E 0x80"?
Best regards.
In my case,the ECU's TesterPresent (0x3E) service is not standard.
Here is what I need: But the PCAN UDS API does not match: I want to disable the TesterPresent function,So I set to the default session:
Code: Select all
TPUDSSessionInfo session;
result = UDS_GetValue(PUDS_USBBUS1, PUDS_PARAM_SESSION_INFO, &session, sizeof(TPUDSSessionInfo));
session.SESSION_TYPE = PUDS_SVC_PARAM_DSC_DS;
result = UDS_SetValue(PUDS_USBBUS1, PUDS_PARAM_SESSION_INFO, &session, sizeof(TPUDSSessionInfo));
Code: Select all
Line_Send_Again_1:
MsgUDS_WRITE.LEN = 2;
MsgUDS_WRITE.DATA.RAW[0] = 0x33;
MsgUDS_WRITE.DATA.RAW[1] = 0x02;
result = UDS_Write(PUDS_USBBUS1, &MsgUDS_WRITE);
if (result == PUDS_ERROR_OK)
{
result = UDS_WaitForMultipleMessage(PUDS_USBBUS1, MsgUDS_READ, numECU, &count, &MsgUDS_WRITE, 5, 2000, 2000, FALSE);
if (result != PUDS_ERROR_OK)
{
MessageBox(L"UDS_WaitForMultipleMessage 10");
return;
}
else if (
(MsgUDS_READ[0].DATA.RAW[0] == 0x7F &&
MsgUDS_READ[0].DATA.RAW[1] == 0x33 &&
MsgUDS_READ[0].DATA.RAW[2] == 0xFB) ||
(MsgUDS_READ[1].DATA.RAW[0] == 0x7F &&
MsgUDS_READ[1].DATA.RAW[1] == 0x33 &&
MsgUDS_READ[1].DATA.RAW[2] == 0xFB))
{
goto Line_Send_Again_1;
Sleep(20);
}
}
Question 2:Is there any way to set the TesterPresent function to send "0x3E" instead of "0x3E 0x80"?
Best regards.