#ifndef UDS_H_ #define UDS_H_ #include "did.h" #include "uds_user.h" /*************************************************** * Global Defines ***************************************************/ /*************************************************** * Forward declarations ***************************************************/ struct CAN_Message; /*************************************************** * External Declarations (for Internal Signals) **************************************************/ #if 0 /* ²ð·Ö */ typedef enum { READONLY = 0, READWRITE = 1 } UDS_DID_AccessType_e; typedef enum { DID_UDS_NS_CoreAssemblyId_sz = 0xF111u, DID_UDS_NS_EcuDeliveryAssemblyId_sz = 0xF113u, DID_UDS_NS_EcuMainSwId_sz = 0xF188u, DID_UDS_NS_GsmPartNum_sz = 0xF192u, DID_UDS_NS_UnitSerialNum_sz = 0xF193u, DID_UDS_NS_Version_sz = 0xF194u, DID_UDS_NS_HGID_sz = 0xF195u, DID_UDS_NS_PcbSerialNum_sz = 0xF196u, DID_UDS_NS_VINDataIdentifier = 0xF190u, DID_UDS_NS_SystemNameDataIdentifier = 0xF197u, DID_UDS_NS_VehiclePowerMode = 0xF1A0u, DID_UDS_NS_BatteryVoltage = 0xF1A2u, DID_UDS_NS_CompressedVPPS = 0xF1B0u, DID_UDS_NS_DUNSIdentification = 0xF1B1u, DID_UDS_NS_MTC = 0xF1B2u, DID_UDS_NS_ECUSourceID = 0xF1C0u, DID_UDS_NS_BootSoftwareIdentificationDataIdentifier = 0xF180u, DID_UDS_NS_ApplicationSoftwareIdentificationDataIdentifier = 0xF181u, DID_UDS_NS_ApplicationDataIdentificationDataIdentifier = 0xF182u, DID_UDS_NS_BaseModelPartNumber = 0xF1D0u, DID_UDS_NS_BaseModelPartNumberVersionCode = 0xF1D1u, DID_UDS_NS_EndModelPartNumber = 0xF1D2u, DID_UDS_NS_EndModelPartNumberVersionCode = 0xF1D3u, DID_UDS_NS_ManufacturersModeFlag = 0xF1DFu, DID_UDS_NS_ProgramState = 0xF1E0u, DID_UDS_UDS_NS_FingerprintRead = 0xF15Bu, DIDMAX } UDS_DIDList_e; typedef struct { UDS_DIDList_e DidEnum; void *address; uint8_t nvBlockID; uint16_t size; UDS_DID_AccessType_e access; uint16_t crc; } UDS_DIDtableEntry; #endif /* // AddressAndLengthFormatIdentifier typedef union AddrAndLenFmtId { uint8_t frame; struct { unsigned int AddressLength : 4; unsigned int SizeLength : 4; } AddressSizeLength; } AddrAndLenFmtId_t; */ typedef enum { EnableRxAndTx = 0x00, EnableRxAndDisableTx = 0x01, DisableRxAndTx = 0x03 } UDS_CONTOL_TYPE_e; typedef enum { NormalCommunicationMessage = 0x01, NetManageCommMessage = 0x02, BothCommunicationMessage = 0x03 } UDS_CommunicationType_e; typedef void (*RegDID_WR_FUNC_t)(uint16_t DIDitem, uint8_t nvBlockID, void *address, uint16_t size); typedef void (*RegDID_RO_FUNC_t)(uint16_t DIDitem, const void *address, uint16_t size); struct USD_RegDID { RegDID_WR_FUNC_t Reg_RW_DID; RegDID_RO_FUNC_t Reg_RO_DID; }; /*****************************************************************************/ /* Output signal */ /*****************************************************************************/ /* UDS_StreamCmd_e is expeceted to be set to STREAM_NONE * by it's consumer when it's finished with the signal. */ /*****************************************************************************/ /* External function prototypes */ /*****************************************************************************/ extern void UDS_Init(void); extern void UDS_Task_10ms(void *p); extern void UDS_Task_1ms(void *p); extern void UDS_RxMessage(TP_PDU_t *msg); extern void UDS_RxFunIdMessage(TP_PDU_t *msg); extern void UDS_InitDIDMapRW(UDS_DIDList_e DIDitem, uint16_t nvBlockID, void *address, uint16_t size); extern void UDS_InitDIDMapRO(UDS_DIDList_e DIDitem, const void *address, uint16_t size); extern void UDS_SwitchtoProgrammingSession(void); extern void UDS_ResponseEntryProgrammingSession(void); #endif