Commit 741d792b authored by hu's avatar hu

调整K-LINEBUG

parent 09c8f60b
...@@ -84,61 +84,70 @@ void Kwp2000_CallService(unsigned char Sid_u8) ...@@ -84,61 +84,70 @@ void Kwp2000_CallService(unsigned char Sid_u8)
} }
} }
#endif #endif
for (index = 0; index < 12; index++) switch (Sid_u8)
{ {
switch (Sid_u8) case KWP2000_ECURESET_REQUEST:
{ serviceFound = 1;
case KWP2000_ECURESET_REQUEST: Kwp2000_ComState.Tx_len = kwp_EcuReset((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
Kwp2000_ComState.Tx_len = kwp_EcuReset((unsigned char *)&Kwp2000_ComState.TxBuffer[4], (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); break;
break; case KWP2000_TESTERPRESENT_REQUEST:
case KWP2000_TESTERPRESENT_REQUEST: serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_TesterPresent((unsigned char *)&Kwp2000_ComState.TxBuffer[4], Kwp2000_ComState.Tx_len = kwp_TesterPresent((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break; break;
case KWP2000_STARTCOMMUNICATION_REQUEST: case KWP2000_STARTCOMMUNICATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_StartCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4], serviceFound = 1;
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); Kwp2000_ComState.Tx_len = kwp_StartCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
break; (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
case KWP2000_STOPCOMMUNICATION_REQUEST: break;
Kwp2000_ComState.Tx_len = kwp_StopCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4], case KWP2000_STOPCOMMUNICATION_REQUEST:
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); serviceFound = 1;
break; Kwp2000_ComState.Tx_len = kwp_StopCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
case KWP2000_READECUIDENTIFICATION_REQUEST: (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
Kwp2000_ComState.Tx_len = kwp_readEcuIdentification((unsigned char *)&Kwp2000_ComState.TxBuffer[4], break;
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); case KWP2000_READECUIDENTIFICATION_REQUEST:
break; serviceFound = 1;
case KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST: Kwp2000_ComState.Tx_len = kwp_readEcuIdentification((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
Kwp2000_ComState.Tx_len = kwp_writeDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4], (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); break;
break; case KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST:
case KWP2000_READDATABYLOCALIDENTIFIER_REQUEST: serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_readDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4], Kwp2000_ComState.Tx_len = kwp_writeDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break; break;
case KWP2000_READDATABYCOMMONIDENTIFIER_REQUEST: case KWP2000_READDATABYLOCALIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataByCommonIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4], serviceFound = 1;
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); Kwp2000_ComState.Tx_len = kwp_readDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
break; (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
case KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST: break;
Kwp2000_ComState.Tx_len = kwp_readDataStatusofDTC((unsigned char *)&Kwp2000_ComState.TxBuffer[4], case KWP2000_READDATABYCOMMONIDENTIFIER_REQUEST:
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); serviceFound = 1;
break; Kwp2000_ComState.Tx_len = kwp_readDataByCommonIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
case KWP2000_CLEARDIAGNOSTICINFORMATION_REQUEST: (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
Kwp2000_ComState.Tx_len = kwp_ClearDiagnosticInformation((unsigned char *)&Kwp2000_ComState.TxBuffer[4], break;
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); case KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST:
break; serviceFound = 1;
case KWP2000_SECURITYACCESS_REQUEST: Kwp2000_ComState.Tx_len = kwp_readDataStatusofDTC((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
Kwp2000_ComState.Tx_len = kwp_readDataAccessMode((unsigned char *)&Kwp2000_ComState.TxBuffer[4], (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); break;
break; case KWP2000_CLEARDIAGNOSTICINFORMATION_REQUEST:
case KWP2000_STARTROUTINEBYLOCALIDENTIFIER_REQUEST: serviceFound = 1;
Kwp2000_ComState.Tx_len = kwp_StartroutInebykocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4], Kwp2000_ComState.Tx_len = kwp_ClearDiagnosticInformation((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]); (unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break; break;
default: case KWP2000_SECURITYACCESS_REQUEST:
break; 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) if (serviceFound == 0)
...@@ -244,7 +253,7 @@ void Kwp2000_Handle(void) ...@@ -244,7 +253,7 @@ void Kwp2000_Handle(void)
if (Kwp2000_ComState_Flag > 7) if (Kwp2000_ComState_Flag > 7)
{ {
Kwp2000_ComState_Flag = 0; Kwp2000_ComState_Flag = 0;
//Kwp2000_CallService(Kwp2000_ComState.SId); Kwp2000_CallService(Kwp2000_ComState.SId);
} }
if (Kwp2000_ComState.Tx_len != 0) if (Kwp2000_ComState.Tx_len != 0)
......
...@@ -260,6 +260,7 @@ void Sys_Run_Mode_100ms_Tasks(void) ...@@ -260,6 +260,7 @@ void Sys_Run_Mode_100ms_Tasks(void)
//YZHD_Count++; //YZHD_Count++;
//if (YZHD_Count == 20) //if (YZHD_Count == 20)
//{ //{
// YZHD_Count = 0;
// UART_Ch2_Send_Multiple_Byte(&YZHD_TEST[0], 10); // 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