Commit 53981bdb authored by 李延凯's avatar 李延凯

feat: 增加诊断27服务

parent 5f9e98d4
...@@ -68,6 +68,7 @@ static void Power_KL30_Init(void) ...@@ -68,6 +68,7 @@ static void Power_KL30_Init(void)
g_stRTCInformation.u8RTCYear = 20; g_stRTCInformation.u8RTCYear = 20;
RTE_RTC_Init(g_stRTCInformation); RTE_RTC_Init(g_stRTCInformation);
Menu_User_Init(); Menu_User_Init();
UDS_Startup_Init();
Can_Init(); Can_Init();
Protocol_KL30_Wakeup_Init(); Protocol_KL30_Wakeup_Init();
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 500); TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 500);
......
...@@ -203,11 +203,13 @@ void UDS_S_Data_Indication(uint16_t S_TAtype, uint8_t *S_Data, uint16_t S_Length ...@@ -203,11 +203,13 @@ void UDS_S_Data_Indication(uint16_t S_TAtype, uint8_t *S_Data, uint16_t S_Length
返回值:无 SYSC0_RUNPLL2CNTR 返回值:无 SYSC0_RUNPLL2CNTR
******************************************************************************/ ******************************************************************************/
extern uint8_t S3_Server_refresh; extern uint8_t S3_Server_refresh;
extern uint8_t S3_ServerEN;
extern uint8_t SessionType;
void UDS_Process_Service_Request(void) void UDS_Process_Service_Request(void)
{ {
if (UDS_APP_RX.A_PDU.New) if (UDS_APP_RX.A_PDU.New)
{ {
S3_Server_refresh = 1; S3_ServerEN = 0; // 收到消息时,暂停S3Timer
switch (UDS_APP_RX.A_PDU.A_PCI.SI) switch (UDS_APP_RX.A_PDU.A_PCI.SI)
{ {
case 0x10: UDS_Service_10_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data); case 0x10: UDS_Service_10_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
...@@ -218,10 +220,10 @@ void UDS_Process_Service_Request(void) ...@@ -218,10 +220,10 @@ void UDS_Process_Service_Request(void)
UDS_Service_22_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data); UDS_Service_22_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
} }
break; break;
/* case 0x2E: UDS_Service_2E_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break;
case 0x27: UDS_Service_27_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data); case 0x27: UDS_Service_27_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break; break;
/* case 0x2E: UDS_Service_2E_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break;
case 0x28: UDS_Service_28_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data); case 0x28: UDS_Service_28_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break; break;
case 0x85: UDS_Service_85_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data); case 0x85: UDS_Service_85_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
...@@ -239,6 +241,12 @@ void UDS_Process_Service_Request(void) ...@@ -239,6 +241,12 @@ void UDS_Process_Service_Request(void)
break; break;
} }
UDS_APP_RX.A_PDU.New = 0; UDS_APP_RX.A_PDU.New = 0;
if(SessionType > DefaultSession) // 非默认会话时执行
{
S3_Server_refresh = 1; // 诊断请求处理完成, 刷新S3Timer
S3_ServerEN = 1; // 消息处理完成,恢复S3Timer计时
}
} }
} }
......
This diff is collapsed.
...@@ -341,9 +341,12 @@ typedef struct ...@@ -341,9 +341,12 @@ typedef struct
void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data); void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data); void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data); void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void UDS_Service_27_Indication(uint32_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void UDS_Service_3E_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data); void UDS_Service_3E_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void S3_ServerCNTT(void); void S3_ServerCNTT(void);
extern void DIAG_InitParameter(void);
extern void UDS_Normal_Init(void);
extern void UDS_Startup_Init(void);
typedef void (*InitFunction)(void); typedef void (*InitFunction)(void);
...@@ -360,4 +363,8 @@ void Write_App_InValid(uint32_t m32); ...@@ -360,4 +363,8 @@ void Write_App_InValid(uint32_t m32);
extern void Get_Into_630H_Update_MCU_Mode(void); extern void Get_Into_630H_Update_MCU_Mode(void);
extern void Check_MCU_Info_in_630H(void); extern void Check_MCU_Info_in_630H(void);
extern void Ser27_CreateRandomSeed(void);
extern uint32_t CalculateKey(uint8_t seed_array[]);
extern uint32_t Combine_U8_Into_U32(uint8_t *U8);
#endif #endif
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