Commit 741d792b authored by hu's avatar hu

调整K-LINEBUG

parent 09c8f60b
......@@ -84,61 +84,70 @@ void Kwp2000_CallService(unsigned char Sid_u8)
}
}
#endif
for (index = 0; index < 12; index++)
switch (Sid_u8)
{
switch (Sid_u8)
{
case KWP2000_ECURESET_REQUEST:
Kwp2000_ComState.Tx_len = kwp_EcuReset((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_TESTERPRESENT_REQUEST:
Kwp2000_ComState.Tx_len = kwp_TesterPresent((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STARTCOMMUNICATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_StartCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STOPCOMMUNICATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_StopCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READECUIDENTIFICATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readEcuIdentification((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_writeDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDATABYLOCALIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDATABYCOMMONIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataByCommonIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataStatusofDTC((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_CLEARDIAGNOSTICINFORMATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_ClearDiagnosticInformation((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_SECURITYACCESS_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataAccessMode((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STARTROUTINEBYLOCALIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_StartroutInebykocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
default:
break;
}
case KWP2000_ECURESET_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_EcuReset((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_TESTERPRESENT_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_TesterPresent((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STARTCOMMUNICATION_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_StartCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STOPCOMMUNICATION_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_StopCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READECUIDENTIFICATION_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_readEcuIdentification((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_writeDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDATABYLOCALIDENTIFIER_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_readDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDATABYCOMMONIDENTIFIER_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_readDataByCommonIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_readDataStatusofDTC((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_CLEARDIAGNOSTICINFORMATION_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_ClearDiagnosticInformation((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_SECURITYACCESS_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_readDataAccessMode((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STARTROUTINEBYLOCALIDENTIFIER_REQUEST:
serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_StartroutInebykocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
default:
break;
}
if (serviceFound == 0)
......@@ -244,7 +253,7 @@ void Kwp2000_Handle(void)
if (Kwp2000_ComState_Flag > 7)
{
Kwp2000_ComState_Flag = 0;
//Kwp2000_CallService(Kwp2000_ComState.SId);
Kwp2000_CallService(Kwp2000_ComState.SId);
}
if (Kwp2000_ComState.Tx_len != 0)
......
......@@ -260,6 +260,7 @@ void Sys_Run_Mode_100ms_Tasks(void)
//YZHD_Count++;
//if (YZHD_Count == 20)
//{
// YZHD_Count = 0;
// UART_Ch2_Send_Multiple_Byte(&YZHD_TEST[0], 10);
//}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment