2024-05-26 11:13:55 +08:00
|
|
|
|
/*@<40><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>@<40>ַ<EFBFBD><D6B7>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
/******************************************************************************
|
|
|
|
|
| File Name : Dcm_Cfg.h
|
|
|
|
|
| Description:
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
#ifndef DCM_CFG_H
|
|
|
|
|
#define DCM_CFG_H
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
* Description: : Include File Section
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "Dcm_App.h"
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
* Description: : Macro Description Section
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
#define YES 1
|
|
|
|
|
#define NO 0
|
|
|
|
|
|
|
|
|
|
#define DID_RECORD ( NO )
|
|
|
|
|
#define SID_RECORD ( YES )
|
|
|
|
|
|
|
|
|
|
#define DAMING_CAN_BOOT ( NO )
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_SUPPORTSID_COUNT 12U /*֧<>ֵ<EFBFBD>SID<49><44>Ŀ*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
|
|
|
|
|
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_10SUB_COUNT 3U /*10<31><30><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_11SUB_COUNT 2U /*11<31><31><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_19SUB_COUNT 3U /*19<31><39><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
|
|
|
|
|
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_27SUB_COUNT 2U /*27<32><37><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_28SUB_COUNT 3U /*28<32><38><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_31RID_COUNT 1U /*31<33><31><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_RIDFF02_SUB_COUNT 3U /*31 FF02 ֧<>ֵ<EFBFBD><D6B5>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_RIDFF00_SUB_COUNT 3U /*31 FF00 ֧<>ֵ<EFBFBD><D6B5>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_RIDFF01_SUB_COUNT 3U /*31 FF01 ֧<>ֵ<EFBFBD><D6B5>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_RIDF001_SUB_COUNT 3U /* 31 F001 ֧<>ֵ<EFBFBD><D6B5>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2024-05-26 08:08:32 +08:00
|
|
|
|
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_3ESUB_COUNT 1U /*3E<33><45><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_85SUB_COUNT 2U /*85<38><35><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_2CSUB_COUNT 2U /*2C<32><43><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_14DTCGROUP_COUNT 3U /*14<31><34><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD>DTC<54><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
|
|
|
|
|
#if (defined (DAMING_CAN_BOOT) && (DAMING_CAN_BOOT == YES))
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_READ_DIDSUP_COUNT 15U /*22 <20><><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD>DID <20><><EFBFBD><EFBFBD> */
|
2024-05-26 08:08:32 +08:00
|
|
|
|
#else
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_READ_DIDSUP_COUNT 24U /* 22 <20><><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD>DID <20><><EFBFBD><EFBFBD> */
|
2024-05-26 08:08:32 +08:00
|
|
|
|
#endif
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_IO_DIDSUP_COUNT 5U /*2F <20><><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD>DID <20><><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_PERIODIC_DATA_COUNT 0U /*2A <20><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>DID<49><44><EFBFBD><EFBFBD> */
|
2024-05-26 08:08:32 +08:00
|
|
|
|
|
2024-05-26 11:13:55 +08:00
|
|
|
|
#define DCM_WRITE_DIDSUP_COUNT 7U /*2E <20><><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD>DID <20><><EFBFBD><EFBFBD>*/
|
|
|
|
|
#define DCM_ONEDID_MAXDATALENGTH 20U /*22 <20><><EFBFBD><EFBFBD>DID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
* Description: : Structure Type Declaration Section
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ROUTINECTRL_DID_CheckProgrammingIntegrity 0x0202
|
|
|
|
|
#define ROUTINECTRL_DID_CheckProgrammingPreconditions 0x0203
|
|
|
|
|
#define ROUTINECTRL_DID_CheckProgrammingDependencies 0xFF01
|
|
|
|
|
#define ROUTINECTRL_DID_EraseMemory 0xFF00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef TeDcm_h_ResultType (*ServerDealfunc)(void);
|
2024-05-26 11:13:55 +08:00
|
|
|
|
/*SID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2024-05-26 11:13:55 +08:00
|
|
|
|
uint8 SupportSession; /*֧<>ֵĻỰģʽ*/
|
|
|
|
|
uint8 SupportSecurityAccess; /*֧<>ֵİ<D6B5>ȫȨ<C8AB><C8A8>*/
|
|
|
|
|
uint8 SupportRequestAddress; /*֧<>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ*/
|
|
|
|
|
uint8 MinDL; /*SID <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>СDL*/
|
|
|
|
|
uint8 SubCount; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2024-05-26 08:08:32 +08:00
|
|
|
|
uint8 Sid; /*SID */
|
|
|
|
|
ServerDealfunc SidFunction;
|
|
|
|
|
}TsDcm_h_SidCheckInfoType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef TeDcm_h_ResultType (*SubDealfunc)(void );
|
|
|
|
|
typedef TeDcm_h_ResultType (*SubDealfuncWithPara)(uint8 );
|
2024-05-26 11:13:55 +08:00
|
|
|
|
/*<2A>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>б<EFBFBD><D0B1>ṹ<EFBFBD><E1B9B9>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2024-05-26 11:13:55 +08:00
|
|
|
|
uint8 Sub; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD>*/
|
|
|
|
|
uint8 DL; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ȷDL*/
|
|
|
|
|
SubDealfunc SubFunction; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
}TsDcm_h_SubCheckType;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2024-05-26 11:13:55 +08:00
|
|
|
|
uint8 Sub; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD>*/
|
|
|
|
|
uint8 DL; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ȷDL*/
|
|
|
|
|
SubDealfuncWithPara SubFunction; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
}TsDcm_h_WithParaSubCheckType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-26 11:13:55 +08:00
|
|
|
|
/*<2A>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>б<EFBFBD><D0B1>ṹ<EFBFBD><E1B9B9>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2024-05-26 11:13:55 +08:00
|
|
|
|
uint8 Sub; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD>*/
|
|
|
|
|
uint8 DL; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ȷDL*/
|
|
|
|
|
SubDealfunc SubFunction; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
}TsDcm_h_DtcCheckType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef uint8 (*DidDealfunc)(uint8* LeDcm_u_DataAddress,uint8* LeDcm_u_DataLength);
|
2024-05-26 11:13:55 +08:00
|
|
|
|
/* 22 2E 2A<32><41><EFBFBD><EFBFBD> DID <20><>Ϣ<EFBFBD>б<EFBFBD><D0B1>ṹ<EFBFBD><E1B9B9>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2024-05-26 11:13:55 +08:00
|
|
|
|
uint8 SupportSession; /*֧<>ֵĻỰģʽ*/
|
|
|
|
|
uint8 SupportSecurityAccess; /*֧<>ֵİ<D6B5>ȫȨ<C8AB><C8A8>*/
|
|
|
|
|
uint8 DataLength; /*<2A><><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>*/
|
|
|
|
|
uint16 Did; /*<2A><><EFBFBD><EFBFBD>DID*/
|
|
|
|
|
DidDealfunc Function; /*DID <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
}TsDcm_h_DidCheckType;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
uint8 Did;
|
|
|
|
|
uint8 TransmissionMode;
|
|
|
|
|
uint16 TmCount;
|
|
|
|
|
}TsDcm_h_2APeriodicDidServe;
|
|
|
|
|
|
|
|
|
|
typedef TeDcm_h_ResultType (*DtcDealfunc)(uint32 LeDcm_DtcGroup);
|
2024-05-26 11:13:55 +08:00
|
|
|
|
/*14 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>б<EFBFBD><D0B1>ṹ<EFBFBD><E1B9B9>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
#if 0
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2024-05-26 11:13:55 +08:00
|
|
|
|
uint32 Dtc; /* DTC<54><43> */
|
|
|
|
|
DtcDealfunc CleanFunction; /* <20>ӷ<EFBFBD><D3B7><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2024-05-26 08:08:32 +08:00
|
|
|
|
}TsDcm_h_DtcCheckType;
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef TeDcm_h_ResultType (*RidDealfunc)(void);
|
2024-05-26 11:13:55 +08:00
|
|
|
|
/*Rid ֧<>ֵ<EFBFBD><D6B5>ӷ<EFBFBD><D3B7><EFBFBD><F1BCB0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>б<EFBFBD><D0B1>ṹ<EFBFBD><E1B9B9>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
|
2024-05-26 11:13:55 +08:00
|
|
|
|
uint8 Sub; /*<2A>ӷ<EFBFBD><D3B7><EFBFBD>*/
|
|
|
|
|
uint8 DL; /*<2A><><EFBFBD><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ȷDL*/
|
|
|
|
|
RidDealfunc Function; /*<2A><><EFBFBD><EFBFBD> <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
}TsDcm_h_RidSubCheckType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-26 11:13:55 +08:00
|
|
|
|
/* 31<33><31><EFBFBD><EFBFBD> RID <20><>Ϣ<EFBFBD>б<EFBFBD><D0B1>ṹ<EFBFBD><E1B9B9>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2024-05-26 11:13:55 +08:00
|
|
|
|
uint8 SupportSession; /*֧<>ֵĻỰģʽ*/
|
|
|
|
|
uint8 SupportSecurityAccess; /*֧<>ֵİ<D6B5>ȫȨ<C8AB><C8A8>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
uint16 Rid; /*Rid*/
|
2024-05-26 11:13:55 +08:00
|
|
|
|
const TsDcm_h_RidSubCheckType* RidSubTable; /*Rid ֧<>ֵ<EFBFBD><D6B5>ӷ<EFBFBD><D3B7><EFBFBD><EFBFBD>б<EFBFBD>*/
|
2024-05-26 08:08:32 +08:00
|
|
|
|
|
|
|
|
|
}TsDcm_h_RidCheckType;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
uint8 write;
|
|
|
|
|
uint8 data;
|
|
|
|
|
}TsDcm_h_IO_parameter_t;
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
* Description: : Global Variable Declaration Section
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern const TsDcm_h_SidCheckInfoType CaDcm_h_SidCheckInfoTable[DCM_SUPPORTSID_COUNT];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
* Description: : Global Function Prototype Declaration
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
extern uint8 MngDcm_SIDCheckAvailable(uint8 LeDcm_u_Sid);
|
|
|
|
|
extern uint8 MngDcm_SIDCheckSession(uint8 LeDcm_u_SidIndex);
|
|
|
|
|
extern uint8 MngDcm_SIDCheckSecurityAccess(uint8 LeDcm_u_SidIndex);
|
|
|
|
|
extern uint8 MngDcm_SIDFuncAddressAvailable(uint8 LeDcm_u_SidIndex);
|
|
|
|
|
extern uint8 MngDcm_SIDCheckMinDL(uint8 LeDcm_u_SidIndex,uint16 LeDcm_u_DL);
|
|
|
|
|
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_SessionControlService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_ECUResetService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_CleanDTCService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_ReportDTCService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_ReadDidDataService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_SecurityAccessService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_CommunicationControlService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_WriteDidDataService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_RoutineControlService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_TesterPresentService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_DTCSettingControlService(void);
|
|
|
|
|
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_ReadMemoryDataService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_SecurityAccessService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_WriteMemoryDataService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_ReadDataByIdentifier(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_ReadDTCInfoService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_DynamicaDefineIdentifier(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_IOCtrlDIDService(void);
|
|
|
|
|
extern TeDcm_h_ResultType MngDcm_DynamicaDefineIdentifier(void);
|
|
|
|
|
#endif
|