#ifdef GLOBALS_SER_DIAGNO
#define EXTERN_SER_DIAGNO

#else
#define EXTERN_SER_DIAGNO extern
#endif

#ifndef U2_SER_DIAGNO_H_
#define U2_SER_DIAGNO_H_

#include "U2_uds_includes.h"

#define U2_DID0005 0x0005
extern volatile _U2_N_USData U2_Exct_USData;
extern volatile _U2_DiagnoCtl U2_DiagnoCtl;
extern volatile _U2_DiagClock U2_DiagClock;
extern volatile _U2_ErrorFrame U2_Error;

extern volatile uint32_t U2_CrcCheckSum;

extern void U2_App_SetSequenceTimer(uint32_t Second, _U2_DiagClock *T);
extern uint8_t U2_App_SequenceTimerOver(_U2_DiagClock *T);

extern void U2_App_SetSessionTimer(uint32_t Second, _U2_DiagClock *T);
extern uint8_t U2_App_SessionTimerOver(_U2_DiagClock *T);

extern void U2_App_SetReUnlockTimer(uint32_t Second, _U2_DiagClock *T);
extern uint8_t U2_App_ReUnlockTimerOver(_U2_DiagClock *T);

extern void U2_App_SetDtcMsgTimer(uint32_t Second, _U2_DiagClock *T);
extern uint8_t U2_App_DtcMsgTimerOver(_U2_DiagClock *T);

extern void U2_App_10_service(_U2_N_USData *AppUSData); //会话模式
extern void U2_App_11_service(_U2_N_USData *AppUSData); //复位模式
extern void U2_App_14_service(_U2_N_USData *AppUSData); //清除-故障码(DTC)
extern void U2_App_59_service(_U2_N_USData *AppUSData); //读-故障码(DTC)
extern void U2_App_62_service(_U2_N_USData *AppUSData); //读
extern void U2_App_27_service(_U2_N_USData *AppUSData); //解锁
extern void U2_App_28_service(_U2_N_USData *AppUSData); //RxTx
extern void U2_App_2E_service(_U2_N_USData *AppUSData); //写
extern void U2_App_2F_service(_U2_N_USData *AppUSData); //IO
extern void U2_App_31_service(_U2_N_USData *AppUSData); //Boot
extern void U2_App_34_service(_U2_N_USData *AppUSData); //Boot
extern void U2_App_36_service(_U2_N_USData *AppUSData); //Boot
extern void U2_App_37_service(_U2_N_USData *AppUSData); //Boot
extern void U2_App_3E_service(_U2_N_USData *AppUSData); //Boot
extern void U2_App_85_service(_U2_N_USData *AppUSData); //开关-故障码(DTC)

extern void U2_App_01_service(_U2_N_USData *AppUSData);

extern void U2_DiagnosisInit_main(void);
extern void U2_Diagnosis_main(void);
void Set_UDS_59_MsgRecFlg(uint8_t data);
void Set_UDS_62_MsgRecFlg(uint8_t data);
void Set_UDS_01_MsgRecFlg(uint8_t data);
uint8_t Get_UDS_59_MsgRecFlg(void);
uint8_t Get_UDS_62_MsgRecFlg(void);
uint8_t Get_UDS_01_MsgRecFlg(void);
#endif /* SER_DIAGNO_H_ */
