AUTOSAR Classic Diagnostic Services
Die Diagnostic Services der AUTOSAR Classic Platform implementieren normierte Diagnoseprotokolle nach ISO 14229 (UDS) und ISO 15765-4 (OBD), Fehlererkennung und -speicherung im Fehlerspeicher (DEM), Entwicklungsfehler-Tracing (DET) sowie strukturiertes Logging (DLT).
初始化与状态
Dcm_GetVersionInfoDcm_InitDem_GetVersionInfoDem_InitDet_GetVersionInfoDet_InitDlt_GetVersionInfoDlt_InitFiM_GetVersionInfoFiM_Init服务 · Get…
服务 · Set…
服务 · Dcm…
服务 · J1939…
服务 · Process…
服务 · Read…
服务 · Write…
服务 · Reset…
服务 · Dem…
服务 · Start…
服务 · Clear…
服务 · Com…
服务 · Report…
服务 · Request…
服务 · Select…
服务 · Stop…
服务 · 其他
CBFidStatusChangedDcm_BndMWriteBlockFinishDcm_CsmAsyncJobFinishedDcm_KeyMAsyncCertificateVerifyFinishedDcm_TriggerOnEventDem_CallbackEventSyncStorageProcessedDem_DisableDTCRecordUpdateDem_DisableDTCSettingDem_EnableDTCRecordUpdateDem_EnableDTCSettingDem_PreInitDem_PrestoreFreezeFrameDem_RepIUMPRDenReleaseDem_RepIUMPRFaultDetectDem_RestartOperationCycleDem_ShutdownDlt_DetForwardErrorTraceDlt_SendLogMessageDlt_SendTraceMessageDlt_StoreConfigurationDlt_TxFunctionDlt_UnregisterContextXxx_CompareKeyXxx_ConditionCheckReadXxx_ConditionCheckRead#2Xxx_ConfirmationXxx_FreezeCurrentStateXxx_FreezeCurrentState#2Xxx_IndicationXxx_IsDidAvailableXxx_ReturnControlToECUXxx_ShortTermAdjustmentXxx_ShortTermAdjustment#2回调
Dcm_CopyRxDataDcm_CopyTxDataDcm_StartOfReceptionDcm_TpRxIndicationDcm_TpTxConfirmationDcm_TxConfirmationDlt_CopyRxDataDlt_CopyTxDataDlt_RxIndicationDlt_StartOfReceptionDlt_TpRxIndicationDlt_TpTxConfirmationDlt_TriggerTransmitDlt_TxConfirmationCallout 与预期接口
<DetReportRuntimeErrorCallout><DetReportTransientFaultCallout><User_Error_Hooks>周期性
Dcm_MainFunctionDem_MainFunctionFiM_MainFunction类型
ControlDTCSettingModeSwitchInterfaceDcm_AuthenticationRoleTypeDcm_CommunicationModeTypeDcm_ConfigTypeDcm_ConfirmationStatusTypeDcm_DataArrayTypeDcm_DidSupportedTypeDcm_EcuStartModeTypeDcm_ExtendedOpStatusTypeDcm_FileAndDirNameTypeDcm_IdContextTypeDcm_InfoTypeDcm_InputOutputControlParameterTypeDcm_IOOperationResponseTypeDcm_MsgAddInfoTypeDcm_MsgContextTypeDcm_MsgItemTypeDcm_MsgLenTypeDcm_MsgTypeDcm_NegativeResponseCodeTypeDcm_OpStatusTypeDcm_ProgConditionsTypeDcm_ProtocolTypeDcm_RequestDataArrayTypeDcm_ResponseDataArrayTypeDcm_ReturnReadMemoryTypeDcm_ReturnWriteMemoryTypeDcm_SecLevelTypeDcm_SesCtrlTypeDcm_StatusTypeDcmCommunicationControlDcmControlDTCSettingDcmDiagnosticSessionControlDcmEcuResetDcmModeRapidPowerShutDownDcmResponseOnEventDcmSecurityAccessDem_ComponentIdTypeDem_ConfigTypeDem_DataArrayTypeDem_DataPrimitiveTypeDem_DataTypeDem_DebounceResetStatusTypeDem_DTCFormatTypeDem_DTCKindTypeDem_DTCOriginTypeDem_DTCRequestTypeDem_DTCTranslationFormatTypeDem_DTRControlTypeDem_EventIdTypeDem_EventStatusTypeDem_IndicatorStatusTypeDem_InitMonitorReasonTypeDem_IumprDenomCondIdTypeDem_IumprDenomCondStatusTypeDem_J1939DcmDiagnosticReadiness1TypeDem_J1939DcmDiagnosticReadiness2TypeDem_J1939DcmDiagnosticReadiness3TypeDem_J1939DcmDTCStatusFilterTypeDem_J1939DcmLampStatusTypeDem_J1939DcmSetClearFilterTypeDem_J1939DcmSetFreezeFrameFilterTypeDem_MaxDataValueTypeDem_MonitorDataTypeDem_PID21valueTypeDem_PID31valueTypeDem_PID4DvalueTypeDem_PID4EvalueTypeDem_RatioIdTypeDet_ConfigTypeDiagnosticSessionControlModeSwitchInterfaceDlt_ApplicationIdInfoTypeDlt_ApplicationIDTypeDlt_AssignmentOperationDlt_ConfigTypeDlt_ContextIdInfoTypeDlt_ContextIDTypeDlt_LogInfoTypeDlt_MessageArgumentCountDlt_MessageIDTypeDlt_MessageLogInfoTypeDlt_MessageLogLevelTypeDlt_MessageNetworkTraceInfoTypeDlt_MessageOptionsTypeDlt_MessageTraceInfoTypeDlt_MessageTraceTypeDlt_MessageTypeDlt_SessionIDTypeEcuResetModeSwitchInterfaceFiM_ConfigTypeFiM_FunctionIdTypeModeRapidPowerShutDownModeSwitchInterfaceSecurityAccessModeSwitchInterfaceType函数
<DetReportRuntimeErrorCallout><DetReportTransientFaultCallout><User_Error_Hooks>CBFidStatusChangedDcm_BndMWriteBlockFinishDcm_ComM_FullComModeEnteredDcm_ComM_NoComModeEnteredDcm_ComM_SilentComModeEnteredDcm_CopyRxDataDcm_CopyTxDataDcm_CsmAsyncJobFinishedDcm_DemTriggerOnDTCStatusDcm_GetActiveProtocolDcm_GetProgConditionsDcm_GetSecurityLevelDcm_GetSesCtrlTypeDcm_GetVersionInfoDcm_GetVinDcm_InitDcm_KeyMAsyncCertificateVerifyFinishedDcm_MainFunctionDcm_ProcessRequestAddFileDcm_ProcessRequestDeleteFileDcm_ProcessRequestReadDirDcm_ProcessRequestReadFileDcm_ProcessRequestReplaceFileDcm_ReadFileOrDirDcm_ReadMemoryDcm_ResetToDefaultSessionDcm_SetActiveDiagnosticDcm_SetDeauthenticatedRoleDcm_SetProgConditionsDcm_StartOfReceptionDcm_TpRxIndicationDcm_TpTxConfirmationDcm_TriggerOnEventDcm_TxConfirmationDcm_WriteFileDcm_WriteMemoryDem_CallbackEventSyncStorageProcessedDem_ClearDTCDem_ClearPrestoredFreezeFrameDem_DcmGetAvailableOBDMIDsDem_DcmGetDTCOfOBDFreezeFrameDem_DcmGetDTRDataDem_DcmGetInfoTypeValue08Dem_DcmGetInfoTypeValue0BDem_DcmGetNumTIDsOfOBDMIDDem_DcmReadDataOfOBDFreezeFrameDem_DcmReadDataOfPID01Dem_DcmReadDataOfPID1CDem_DcmReadDataOfPID21Dem_DcmReadDataOfPID30Dem_DcmReadDataOfPID31Dem_DcmReadDataOfPID41Dem_DcmReadDataOfPID4DDem_DcmReadDataOfPID4EDem_DcmReadDataOfPID91Dem_DisableDTCRecordUpdateDem_DisableDTCSettingDem_EnableDTCRecordUpdateDem_EnableDTCSettingDem_GetB1CounterDem_GetComponentFailedDem_GetCycleQualifiedDem_GetDataOfPID21Dem_GetDebouncingOfEventDem_GetDTCByOccurrenceTimeDem_GetDTCOfEventDem_GetDTCSelectionResultDem_GetDTCSelectionResultForClearDTCDem_GetDTCSeverityAvailabilityMaskDem_GetDTCStatusAvailabilityMaskDem_GetDTCSuppressionDem_GetEventAvailableDem_GetEventExtendedDataRecordExDem_GetEventFreezeFrameDataExDem_GetEventMemoryOverflowDem_GetEventUdsStatusDem_GetFaultDetectionCounterDem_GetFunctionalUnitOfDTCDem_GetIndicatorStatusDem_GetIUMPRDenConditionDem_GetMonitorStatusDem_GetNextExtendedDataRecordDem_GetNextFilteredDTCDem_GetNextFilteredDTCAndFDCDem_GetNextFilteredDTCAndSeverityDem_GetNextFilteredRecordDem_GetNextFreezeFrameDataDem_GetNumberOfEventMemoryEntriesDem_GetNumberOfFilteredDTCDem_GetNumberOfFreezeFrameRecordsDem_GetSeverityOfDTCDem_GetSizeOfExtendedDataRecordSelectionDem_GetSizeOfFreezeFrameSelectionDem_GetStatusOfDTCDem_GetTranslationTypeDem_GetVersionInfoDem_InitDem_J1939DcmClearDTCDem_J1939DcmFirstDTCwithLampStatusDem_J1939DcmGetNextDTCwithLampStatusDem_J1939DcmGetNextFilteredDTCDem_J1939DcmGetNextFilteredRatioDem_J1939DcmGetNextFreezeFrameDem_J1939DcmGetNextSPNInFreezeFrameDem_J1939DcmGetNumberOfFilteredDTCDem_J1939DcmReadDiagnosticReadiness1Dem_J1939DcmReadDiagnosticReadiness2Dem_J1939DcmReadDiagnosticReadiness3Dem_J1939DcmSetDTCFilterDem_J1939DcmSetFreezeFrameFilterDem_J1939DcmSetRatioFilterDem_MainFunctionDem_PreInitDem_PrestoreFreezeFrameDem_ReadDataOfPID01Dem_RepIUMPRDenReleaseDem_RepIUMPRFaultDetectDem_ResetEventDebounceStatusDem_ResetEventStatusDem_RestartOperationCycleDem_SelectDTCDem_SelectExtendedDataRecordDem_SelectFreezeFrameDataDem_SetComponentAvailableDem_SetCycleQualifiedDem_SetDataOfPID21Dem_SetDataOfPID31Dem_SetDataOfPID4DDem_SetDataOfPID4EDem_SetDTCFilterDem_SetDTCSuppressionDem_SetDTRDem_SetEnableConditionDem_SetEventAvailableDem_SetEventConfirmationThresholdCounterDem_SetEventDisabledDem_SetEventFailedWithSyncFreezeFrameDem_SetEventStatusDem_SetEventStatusWithMonitorDataDem_SetFreezeFrameRecordFilterDem_SetIUMPRDenConditionDem_SetPtoStatusDem_SetStorageConditionDem_SetWIRStatusDem_ShutdownDet_GetVersionInfoDet_InitDet_ReportErrorDet_ReportRuntimeErrorDet_ReportTransientFaultDet_StartDlt_CopyRxDataDlt_CopyTxDataDlt_DetForwardErrorTraceDlt_GetDefaultLogLevelDlt_GetLogInfoDlt_GetTraceStatusDlt_GetVersionInfoDlt_InitDlt_ResetToFactoryDefaultDlt_RxIndicationDlt_SendLogMessageDlt_SendTraceMessageDlt_SetDefaultLogLevelDlt_SetLogLevelDlt_SetMessageFilteringDlt_SetTraceStatusDlt_StartOfReceptionDlt_StoreConfigurationDlt_TpRxIndicationDlt_TpTxConfirmationDlt_TriggerTransmitDlt_TxConfirmationDlt_TxFunctionDlt_UnregisterContextFiM_DemInitFiM_DemTriggerOnComponentStatusFiM_DemTriggerOnMonitorStatusFiM_GetFunctionPermissionFiM_GetVersionInfoFiM_InitFiM_MainFunctionFiM_SetFunctionAvailableXxx_ClearDTCCheckFncXxx_CompareKeyXxx_ConditionCheckReadXxx_ConditionCheckRead#2Xxx_ConfirmationXxx_FreezeCurrentStateXxx_FreezeCurrentState#2Xxx_GetInfotypeValueDataXxx_GetScalingInformationXxx_GetScalingInformation#2Xxx_GetSecurityAttemptCounterXxx_GetSeedXxx_GetSeed#2Xxx_IndicationXxx_IsDidAvailableXxx_ProcessRequestDownloadXxx_ProcessRequestTransferExitXxx_ProcessRequestUploadXxx_ProcessTransferDataReadXxx_ProcessTransferDataWriteXxx_ReadDataXxx_ReadData#2Xxx_ReadData#3Xxx_ReadDataLengthXxx_ReadDataLength#2Xxx_ReadDidDataXxx_ReadDidRangeDataLengthXxx_RequestControlXxx_RequestResultsXxx_RequestResultsConfirmationXxx_ResetToDefaultXxx_ResetToDefault#2Xxx_ReturnControlToECUXxx_SetSecurityAttemptCounterXxx_ShortTermAdjustmentXxx_ShortTermAdjustment#2Xxx_StartXxx_StartConfirmationXxx_StartProtocolXxx_StopXxx_StopConfirmationXxx_StopProtocolXxx_WriteDataXxx_WriteData#2Xxx_WriteData#3Xxx_WriteData#4Xxx_WriteDidData类型
ControlDTCSettingModeSwitchInterfaceDcm_AuthenticationRoleTypeDcm_CommunicationModeTypeDcm_ConfigTypeDcm_ConfirmationStatusTypeDcm_DataArrayTypeDcm_DidSupportedTypeDcm_EcuStartModeTypeDcm_ExtendedOpStatusTypeDcm_FileAndDirNameTypeDcm_IdContextTypeDcm_InfoTypeDcm_InputOutputControlParameterTypeDcm_IOOperationResponseTypeDcm_MsgAddInfoTypeDcm_MsgContextTypeDcm_MsgItemTypeDcm_MsgLenTypeDcm_MsgTypeDcm_NegativeResponseCodeTypeDcm_OpStatusTypeDcm_ProgConditionsTypeDcm_ProtocolTypeDcm_RequestDataArrayTypeDcm_ResponseDataArrayTypeDcm_ReturnReadMemoryTypeDcm_ReturnWriteMemoryTypeDcm_SecLevelTypeDcm_SesCtrlTypeDcm_StatusTypeDcmCommunicationControlDcmControlDTCSettingDcmDiagnosticSessionControlDcmEcuResetDcmModeRapidPowerShutDownDcmResponseOnEventDcmSecurityAccessDem_ComponentIdTypeDem_ConfigTypeDem_DataArrayTypeDem_DataPrimitiveTypeDem_DataTypeDem_DebounceResetStatusTypeDem_DTCFormatTypeDem_DTCKindTypeDem_DTCOriginTypeDem_DTCRequestTypeDem_DTCTranslationFormatTypeDem_DTRControlTypeDem_EventIdTypeDem_EventStatusTypeDem_IndicatorStatusTypeDem_InitMonitorReasonTypeDem_IumprDenomCondIdTypeDem_IumprDenomCondStatusTypeDem_J1939DcmDiagnosticReadiness1TypeDem_J1939DcmDiagnosticReadiness2TypeDem_J1939DcmDiagnosticReadiness3TypeDem_J1939DcmDTCStatusFilterTypeDem_J1939DcmLampStatusTypeDem_J1939DcmSetClearFilterTypeDem_J1939DcmSetFreezeFrameFilterTypeDem_MaxDataValueTypeDem_MonitorDataTypeDem_PID21valueTypeDem_PID31valueTypeDem_PID4DvalueTypeDem_PID4EvalueTypeDem_RatioIdTypeDet_ConfigTypeDiagnosticSessionControlModeSwitchInterfaceDlt_ApplicationIdInfoTypeDlt_ApplicationIDTypeDlt_AssignmentOperationDlt_ConfigTypeDlt_ContextIdInfoTypeDlt_ContextIDTypeDlt_LogInfoTypeDlt_MessageArgumentCountDlt_MessageIDTypeDlt_MessageLogInfoTypeDlt_MessageLogLevelTypeDlt_MessageNetworkTraceInfoTypeDlt_MessageOptionsTypeDlt_MessageTraceInfoTypeDlt_MessageTraceTypeDlt_MessageTypeDlt_SessionIDTypeEcuResetModeSwitchInterfaceFiM_ConfigTypeFiM_FunctionIdTypeModeRapidPowerShutDownModeSwitchInterfaceSecurityAccessModeSwitchInterfaceType主题图
DCM
123DEM
141DET
10Dlt
42此版本没有元素数据
DCM
Called by BndM to indicate that a block write operation has finished.
void Dcm_BndMWriteBlockFinish (BndM_BlockIdType BlockId, BndM_ResultType result);This call informs the DCM module about a ComM mode change to COMM_FULL_ COMMUNICATION.
void Dcm_ComM_FullComModeEntered (uint8 NetworkId);This call informs the DCM module about a ComM mode change to COMM_NO_ COMMUNICATION.
void Dcm_ComM_NoComModeEntered (uint8 NetworkId);This call informs the DCM module about a ComM mode change to COMM_SILENT_ COMMUNICATION.
void Dcm_ComM_SilentComModeEntered (uint8 NetworkId);This function is called to provide the received data of an I-PDU segment (N-PDU) to the upper layer. Each call to this function provides the next part of the I-PDU data. The size of the remaining buffer is written to the position indicated by bufferSizePtr. This function might be called in interrupt context.
BufReq_ReturnType Dcm_CopyRxData (PduIdType id, const PduInfoType* info, PduLengthType* bufferSizePtr);This function is called to acquire the transmit data of an I-PDU segment (N-PDU). Each call to this function provides the next part of the I-PDU data unless retry->TpDataState is TP_ DATARETRY. In this case the function restarts to copy the data beginning at the offset from the current position indicated by retry->TxTpDataCnt. The size of the remaining data is written to the position indicated by availableDataPtr. This function might be called in interrupt context.
BufReq_ReturnType Dcm_CopyTxData (PduIdType id, const PduInfoType* info, const RetryInfoType* retry, PduLengthType* availableDataPtr);Can be called from CSM upon finishing an asynchronous job processing. The integrator will configure this name as callback function within the CSM ECUC configuration for asynchronous jobs. Only one such callback is available, the DCM detects the job that has finished by evaluating the job parameter. API availability: This API will be available only if ({ecuc(DCM/DCM Dsp/DcmDspAuthentication/DcmDspAuthenticationConnection} != null).
Std_ReturnType Dcm_CsmAsyncJobFinished (Csm_ResultType result);Triggers on changes of the UDS status byte. Allows to trigger on ROE Event for subservice On DTCStatusChanged.
Std_ReturnType Dcm_DemTriggerOnDTCStatus (uint32 DTC, Dem_UdsStatusByteType DTCStatusOld, Dem_UdsStatusByteType DTCStatusNew);This function returns the active UDS protocol details
Std_ReturnType Dcm_GetActiveProtocol (Dcm_ProtocolType* ActiveProtocolType, uint16* ConnectionId, uint16* TesterSourceAddress);The Dcm_GetProgConditions callout is called upon DCM initialization and allows to determine if a response ($50 or $51) has to be sent. The context parameters are defined in Dcm_Prog ConditionsType.
Dcm_EcuStartModeType Dcm_GetProgConditions (Dcm_ProgConditionsType* ProgConditions);This function provides the active security level value.
Std_ReturnType Dcm_GetSecurityLevel (Dcm_SecLevelType* SecLevel);This function provides the active session control type value.
Std_ReturnType Dcm_GetSesCtrlType (Dcm_SesCtrlType* SesCtrlType);Returns the version information of this module
void Dcm_GetVersionInfo (Std_VersionInfoType* versionInfo);Function to get the VIN (as defined in SAE J1979-DA)
Std_ReturnType Dcm_GetVin (uint8* Data);Service for basic initialization of DCM module.
void Dcm_Init (const Dcm_ConfigType* ConfigPtr);Can be called from Key upon finishing an asynchronous certificate verification. The integrator will configure this name as callback function within the KeyM ECUC configuration for asynchronous jobs. Only one such callback is available, the DCM detects the certificate that has finished by evaluating the certId parameter. API availability: This API will be available only if ({ecuc(DCM/DcmDsp/DcmDspAuthentication/DcmDspAuthenticationConnection} != null).
Std_ReturnType Dcm_KeyMAsyncCertificateVerifyFinished (KeyM_CertificateIdType CertID, KeyM_CertificateStatusType Result);This service is used for processing the tasks of the main loop.
void Dcm_MainFunction (void);Callout function. DCM shall call this function to start a RequestFileTransfer process with mode OfOperation equal to 0x01 (AddFile).
Std_ReturnType Dcm_ProcessRequestAddFile (Dcm_OpStatusType OpStatus, uint16 filePathAndNameLength, const uint8* filePathAndName, uint8 dataFormatIdentifier, uint64 fileSizeUncompressed, uint64 fileSizeCompressed, uint64* maxNumberOfBlockLength, Dcm_NegativeResponseCodeType* ErrorCode);Callout function. DCM shall call this function to start a RequestFileTransfer process with mode OfOperation equal to 0x02 (DeleteFile). Manager
Std_ReturnType Dcm_ProcessRequestDeleteFile (Dcm_OpStatusType OpStatus, uint16 filePathAndNameLength, const uint8* filePathAndName, Dcm_NegativeResponseCodeType* ErrorCode);Callout function. DCM shall call this function to start a RequestFileTransfer process with mode OfOperation equal to 0x05 (ReadDir).
Std_ReturnType Dcm_ProcessRequestReadDir (Dcm_OpStatusType OpStatus, uint16 filePathAndNameLength, const uint8* filePathAndName, uint64* dirInfoLength, uint64* maxNumberOfBlockLength, Dcm_NegativeResponseCodeType* ErrorCode);Callout function. DCM shall call this function to start a RequestFileTransfer process with mode OfOperation equal to 0x04 (ReadFile).
Std_ReturnType Dcm_ProcessRequestReadFile (Dcm_OpStatusType OpStatus, uint16 filePathAndNameLength, const uint8* filePathAndName, uint8 dataFormatIdentifier, uint64 fileSizeUncompressed, uint64 fileSizeCompressed, uint64* maxNumberOfBlockLength, Dcm_NegativeResponseCodeType* ErrorCode);Callout function. DCM shall call this function to start a RequestFileTransfer process with mode OfOperation equal to 0x03 (ReplaceFile).
Std_ReturnType Dcm_ProcessRequestReplaceFile (Dcm_OpStatusType OpStatus, uint16 filePathAndNameLength, const uint8* filePathAndName, uint8 dataFormatIdentifier, uint64 fileSizeUncompressed, uint64 fileSizeCompressed, uint64* maxNumberOfBlockLength, Dcm_NegativeResponseCodeType* ErrorCode);Callout function. DCM shall call this function when data shall be sent as a response to UDS service TransferData if there's an ongoing RequestFileTransfer process started with 0x04 (ReadFile) or 0x05 (ReadDir).
Std_ReturnType Dcm_ReadFileOrDir (Dcm_OpStatusType OpStatus, uint64* DataLength, uint8* Data, Dcm_NegativeResponseCodeType* ErrorCode);The Dcm_ReadMemory callout is used to request memory data identified by the parameter memoryAddress and memorySize from the UDS request message. This service is needed for the implementation of UDS services: • ReadMemoryByAddress • RequestUpload • ReadDataByIdentifier (in case of Dynamical DID defined by memory address) • TransferData
Dcm_ReturnReadMemoryType Dcm_ReadMemory (Dcm_OpStatusType OpStatus, uint8 MemoryIdentifier, uint32 MemoryAddress, uint32 MemorySize, uint8* MemoryData, Dcm_NegativeResponseCodeType* ErrorCode);The call to this function allows the application to reset the current session to Default session. Example: Automatic termination of an extended diagnostic session upon exceeding of a speed limit.
Std_ReturnType Dcm_ResetToDefaultSession (void);Allows to activate and deactivate the call of ComM_DCM_ActiveDiagnostic() function.
Std_ReturnType Dcm_SetActiveDiagnostic (boolean active);Sets a new role used in deauthenticated state for that connection. The set role is valid until the connection switches into authenticated state or the ECU is reset.
Std_ReturnType Dcm_SetDeauthenticatedRole (uint16 connectionId, Dcm_AuthenticationRoleType deauthenticatedRole);The Dcm_SetProgConditions callout allows the integrator to store relevant information prior to jumping to bootloader / jump due to ECUReset request. The context parameter are defined in Dcm_ProgConditionsType.
Std_ReturnType Dcm_SetProgConditions (Dcm_OpStatusType OpStatus, const Dcm_ProgConditionsType* ProgConditions);This function is called at the start of receiving an N-SDU. The N-SDU might be fragmented into multiple N-PDUs (FF with one or more following CFs) or might consist of a single N-PDU (SF). The service shall provide the currently available maximum buffer size when invoked with TpSdu Length equal to 0. This function might be called in interrupt context.
BufReq_ReturnType Dcm_StartOfReception (PduIdType id, const PduInfoType* info, PduLengthType TpSduLength, PduLengthType* bufferSizePtr);Called after an I-PDU has been received via the TP API, the result indicates whether the transmission was successful or not. This function might be called in interrupt context.
void Dcm_TpRxIndication (PduIdType id, Std_ReturnType result);This function is called after the I-PDU has been transmitted on its network, the result indicates whether the transmission was successful or not. This function might be called in interrupt context.
void Dcm_TpTxConfirmation (PduIdType id, Std_ReturnType result);The call to this function allows to trigger an event linked to a ResponseOnEvent request. On the function call, the DCM will execute the associated service if the corresponding Mode of the Roe EventId is 'ROE started'.
Std_ReturnType Dcm_TriggerOnEvent (uint8 RoeEventId);The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU. This function might be called in interrupt context.
void Dcm_TxConfirmation (PduIdType TxPduId, Std_ReturnType result);Callout function. DCM shall call this function when data is received using UDS service Transfer Data if there's an ongoing RequestFileTransfer process started with 0x01 (AddFile) or 0x03 (ReplaceFile).
Std_ReturnType Dcm_WriteFile (Dcm_OpStatusType OpStatus, uint64 DataLength, uint8* Data, Dcm_NegativeResponseCodeType* ErrorCode);The Dcm_WriteMemory callout is used to write memory data identified by the parameter memoryAddress and memorySize. This service is needed for the implementation of UDS services : • WriteMemoryByAddress • RequestDownload • TransferData
Dcm_ReturnWriteMemoryType Dcm_WriteMemory (Dcm_OpStatusType OpStatus, uint8 MemoryIdentifier, uint32 MemoryAddress, uint32 MemorySize, const uint8* MemoryData, Dcm_NegativeResponseCodeType* ErrorCode);Callout function for condition check, manufacturer / supplier specific checks on the groupOf DTC, which is requested to clear.
Std_ReturnType Xxx_ClearDTCCheckFnc (uint32 GoDTC, Dcm_NegativeResponseCodeType* ErrorCode);Request to application for asynchronous comparing key (DcmDspSecurityUsePort = USE_ ASYNCH_CLIENT_SERVER)
Std_ReturnType Xxx_CompareKey (const uint8* Key, Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application if the conditions to read the Data are correct.
Std_ReturnType Xxx_ConditionCheckRead (Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application if the conditions to read the Data are correct.
Std_ReturnType Xxx_ConditionCheckRead (Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType* ErrorCode);This function confirms to the application the successful transmission or a transmission error of a diagnostic service.
Std_ReturnType Xxx_Confirmation (uint8 SID, uint8 ReqType, uint16 ConnectionId, Dcm_ConfirmationStatusType ConfirmationStatus, Dcm_ProtocolType ProtocolType, uint16 TesterSourceAddress);This function requests to the application to freeze the current state of an IOControl.
Std_ReturnType Xxx_FreezeCurrentState ([ Dcm_ControlMask_{DID}Type controlMask ], [ uint8* controlMask2 ], Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application to freeze the current state of an IOControl.
Std_ReturnType Xxx_FreezeCurrentState (Dcm_OpStatusType OpStatus, [ Dcm_ControlMask_{DID}Type controlMask ], [ uint8* controlMask2 ], Dcm_NegativeResponseCodeType* ErrorCode);The function provides the data related to the requested Infotype.
Std_ReturnType Xxx_GetInfotypeValueData (Dcm_OpStatusType OpStatus, uint8* DataValueBuffer, uint8* DataValueBufferSize);This function requests to the application for the scaling information of a Data.
Std_ReturnType Xxx_GetScalingInformation (uint8* ScalingInfo, Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application for the scaling information of a Data.
Std_ReturnType Xxx_GetScalingInformation (Dcm_OpStatusType OpStatus, uint8* ScalingInfo, Dcm_NegativeResponseCodeType* ErrorCode);Read the attempt counter for a specific security level from the application
Std_ReturnType Xxx_GetSecurityAttemptCounter (Dcm_OpStatusType OpStatus, uint8* AttemptCounter);Request to application for asynchronous provision of seed value
Std_ReturnType Xxx_GetSeed (const uint8* SecurityAccessDataRecord, Dcm_OpStatusType OpStatus, uint8* Seed, Dcm_NegativeResponseCodeType* ErrorCode);Request to application for asynchronous provision of seed value
Std_ReturnType Xxx_GetSeed (Dcm_OpStatusType OpStatus, uint8* Seed, Dcm_NegativeResponseCodeType* ErrorCode);This function indicates to the application that a service is about to be executed and allows the application to reject the execution of the service request
Std_ReturnType Xxx_Indication (uint8 SID, const uint8* RequestData, uint32 DataSize, uint8 ReqType, uint16 ConnectionId, Dcm_NegativeResponseCodeType* ErrorCode, Dcm_ProtocolType ProtocolType, uint16 TesterSourceAddress);This function requests if a specific DID is available within the range or not.
Std_ReturnType Xxx_IsDidAvailable (uint16 DID, Dcm_OpStatusType OpStatus, Dcm_DidSupportedType* supported);Callout function. DCM shall call this callout function to start a download process. This service is needed for the implementation of UDS service RequestDownload.
Std_ReturnType Xxx_ProcessRequestDownload (Dcm_OpStatusType OpStatus, uint8 DataFormatIdentifier, uint8 MemoryIdentifier, uint32 MemoryAddress, uint32 MemorySize, uint32* BlockLength, Dcm_NegativeResponseCodeType* ErrorCode);Callout function. DCM shall call this callout function to terminate a download or upload process. This callout is needed for the implementation of UDS service RequestTransferExit.
Std_ReturnType Xxx_ProcessRequestTransferExit (Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType* ErrorCode);Callout function. DCM shall call this callout function to start an upload process. This service is needed for the implementation of UDS service RequestUpload.
Std_ReturnType Xxx_ProcessRequestUpload (Dcm_OpStatusType OpStatus, uint8 DataFormatIdentifier, uint8 MemoryIdentifier, uint32 MemoryAddress, uint32 MemorySize, uint32* BlockLength, Dcm_NegativeResponseCodeType* ErrorCode);The ProcessTransferDataRead callout is used to request memory data identified by the parameter memoryAddress and memorySize from the UDS request message. This service is needed for the implementation of UDS services: • ReadMemoryByAddress • RequestUpload • ReadDataByIdentifier (in case of Dynamical DID defined by memory address) • TransferData
Dcm_ReturnReadMemoryType Xxx_ProcessTransferDataRead (Dcm_OpStatusType OpStatus, uint8 MemoryIdentifier, uint32 MemoryAddress, uint32 MemorySize, Dcm_RequestDataArrayType MemoryData, Dcm_NegativeResponseCodeType* ErrorCode);The ProcessTransferDataWrite callout is used to write memory data identified by the parameter memoryAddress and memorySize. This service is needed for the implementation of UDS services : • WriteMemoryByAddress • RequestDownload • TransferData
Dcm_ReturnWriteMemoryType Xxx_ProcessTransferDataWrite (Dcm_OpStatusType OpStatus, uint8 MemoryIdentifier, uint32 MemoryAddress, uint32 MemorySize, const Dcm_RequestDataArrayType MemoryData, Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application a data value of a DID/PID if DcmDspDataUsePort is set to USE_DATA_SYNCH_CLIENT_SERVER.
Std_ReturnType Xxx_ReadData (uint8* Data);This function requests to the application a data value of a DID/PID if DcmDspDataUsePort is set to USE_DATA_ASYNCH_CLIENT_SERVER.
Std_ReturnType Xxx_ReadData (Dcm_OpStatusType OpStatus, uint8* Data);This function requests to the application a data value of a DID/PID if DcmDspDataUsePort is set to USE_DATA_ASYNCH_CLIENT_SERVER.
Std_ReturnType Xxx_ReadData (Dcm_OpStatusType OpStatus, uint8* Data, Dcm_NegativeResponseCodeType* ErrorCode);This function requests the application to return the data length in byte of a Data.
Std_ReturnType Xxx_ReadDataLength (uint16* DataLength);This function requests the application to return the data length in byte of a Data.
Std_ReturnType Xxx_ReadDataLength (Dcm_OpStatusType OpStatus, uint16* DataLength);This function requests to the application a data value of a DID
Std_ReturnType Xxx_ReadDidData (uint16 DID, uint8* Data, Dcm_OpStatusType OpStatus, uint16 DataLength, Dcm_NegativeResponseCodeType ErrorCode);This function requests the application to return the data length of a DID Range.
Std_ReturnType Xxx_ReadDidRangeDataLength (uint16 DID, Dcm_OpStatusType OpStatus, uint16* DataLength);Invokes a TID-specific function taking a configured number of bytes as input and returing a fixed number of bytes as output. This is typically used to implement OBD Service $08
Std_ReturnType Xxx_RequestControl (uint8* OutBuffer, const uint8* InBuffer);This function requests to the application the result of a routine execution
Std_ReturnType Xxx_RequestResults (Dcm_OpStatusType OpStatus, [ DcmDspRoutineSignalType* dataIn_1, ... DcmDspRoutineSignalType* dataIn_n ], [ const uint8* dataInVar ], [ DcmDspRoutineSignalType* dataOut_1, ... DcmDspRoutineSignalType* dataOut_n ], [ uint8* dataOutVar ], [ uint16* variableDataLength ], Dcm_NegativeResponseCodeType* ErrorCode);This function indicates the transmission of a response to a RequestRoutineResults request
Std_ReturnType Xxx_RequestResultsConfirmation (Dcm_ConfirmationStatusType ConfirmationStatus);This function requests to the application to reset an IOControl to default value.
Std_ReturnType Xxx_ResetToDefault ([ Dcm_ControlMask_{DID}Type controlMask ], [ uint8* controlMask2 ], Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application to reset an IOControl to default value.
Std_ReturnType Xxx_ResetToDefault (Dcm_OpStatusType OpStatus, [ Dcm_ControlMask_{DID}Type controlMask ], [ uint8* controlMask2 ], Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application to return control to ECU of an IOControl.
Std_ReturnType Xxx_ReturnControlToECU ([ Dcm_ControlMask_{DID}Type controlMask ], [ uint8* controlMask2 ], Dcm_NegativeResponseCodeType* ErrorCode);Set the attempt counter for a specific security level in the application
Std_ReturnType Xxx_SetSecurityAttemptCounter (Dcm_OpStatusType OpStatus, uint8 AttemptCounter);This function requests to the application to adjust the IO signal.
Std_ReturnType Xxx_ShortTermAdjustment (const uint8* ControlStateInfo, [ Dcm_ControlMask_{DID}Type controlMask ], [ uint8* controlMask2 ], Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application to adjust the IO signal.
Std_ReturnType Xxx_ShortTermAdjustment (const uint8* ControlStateInfo, uint16 DataLength, Dcm_OpStatusType OpStatus, [ Dcm_ControlMask_{DID}Type controlMask ], [ uint8* controlMask2 ], Dcm_NegativeResponseCodeType* ErrorCode);This function requests to the application to start the execution of a routine.
Std_ReturnType Xxx_Start ([ DcmDspRoutineSignalType dataIn_1, ... DcmDspRoutineSignalType dataIn_n ], [ const uint8* dataInVar ], Manager Dcm_OpStatusType OpStatus, [ DcmDspRoutineSignalType dataOut_1, ... DcmDspRoutineSignalType dataOut_n ], [ uint8* dataOutVar ], [ uint16* currentDataLength ], Dcm_NegativeResponseCodeType ErrorCode); ⚠️This function indicates the transmission of a response to a StartRoutine request
Std_ReturnType Xxx_StartConfirmation (Dcm_ConfirmationStatusType ConfirmationStatus);This function allows the application to examine the environment conditions and enable/disable further processing of the protocol.
Std_ReturnType Xxx_StartProtocol (Dcm_ProtocolType ProtocolType, uint16 TesterSourceAddress, uint16 ConnectionId);This function requests to the application to stop the execution of a routine
Std_ReturnType Xxx_Stop ([ DcmDspRoutineSignalType dataIn_1, ... DcmDspRoutineSignalType dataIn_n ], [ const uint8* dataInVar ], [ DcmDspRoutineSignalType dataOut_1, ... DcmDspRoutineSignalType dataOut_n ], [ uint8* dataOutVar ], [ uint16* currentDataLength ], Dcm_NegativeResponseCodeType* ErrorCode);This function indicates the transmission of a response to a StopRoutine request
Std_ReturnType Xxx_StopConfirmation (Dcm_ConfirmationStatusType ConfirmationStatus);This function informs the application of the protocol stop.
Std_ReturnType Xxx_StopProtocol (Dcm_ProtocolType ProtocolType, uint16 TesterSourceAddress, uint16 ConnectionId);This function requests the application to write a data value of a DID.
Std_ReturnType Xxx_WriteData (const uint8* Data, Dcm_NegativeResponseCodeType* ErrorCode);This function requests the application to write a data value of a DID.
Std_ReturnType Xxx_WriteData (const uint8* Data, uint16 DataLength, Dcm_NegativeResponseCodeType* ErrorCode);This function requests the application to write a data value of a DID.
Std_ReturnType Xxx_WriteData (const uint8* Data, Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType* ErrorCode);This function requests the application to write a data value of a DID.
Std_ReturnType Xxx_WriteData (const uint8* Data, uint16 DataLength, Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType* ErrorCode);This function requests the application to write a data value of a DID.
Std_ReturnType Xxx_WriteDidData (uint16 DID, const uint8* Data, Dcm_OpStatusType OpStatus, uint16 DataLength, Dcm_NegativeResponseCodeType ErrorCode);A ModeSwitchInterface PPortPrototype used to notify SW-Cs about the DTC Setting mode
Manager
This type defines a data structure for the post build parameters of the DCM . At initialization the DCM gets a pointer to a structure of this type to get access to its configuration data, which is necessary for initialization.
Allows the DCM to know if a diagnostic response shall be sent in the case of a jump from bootloader
This message context identifier can be used to determine the relation between request and response confirmation.
Additional information on message request. Datastructure: Bitfield
This data structure contains all information which is necessary to process a diagnostic message from request to response and response confirmation.
Base type for diagnostic message item
Length of diagnostic message (request, positive or negative response). The maximum length is dependent of the underlying transport protocol/media.
Base type for diagnostic message (request, positive or negative response)
Type Dcm_NegativeResponseCodeType.
Used in Dcm_SetProgConditions() to allow the integrator to store relevant information prior to jumping to bootloader / jump due to ECUReset request.
Type Dcm_ProtocolType.
Return values of Callout Dcm_ReadMemory
Return type of callout Dcm_WriteMemory
Security Level type definition
Session type definition. 0, 127 and all values above 127 are reserved by ISO.
Base item type to transport status information.
ModeDeclarationGroup representing the different communication control states
ModeDeclarationGroup representing the enable/disable state for DTC storage
ModeDeclarationGroup representing the different diagnostic sessions Further modes to be added: {ecuc(DCM/DcmConfigSet/DcmDsp/DcmDspSession/ DcmDspSessionRow.SHORT-NAME)}
ModeDeclarationGroup representing the different ECU reset types
ModeDeclarationGroup representing the enable/disable state of rapid power shutdown
ModeDeclarationGroup representing the state of a Response On Event
ModeDeclarationGroup representing the different diagnostic security levels Further modes to be added: {ecuc(DCM/DcmConfigSet/DcmDsp/DcmDsp Security/DcmDspSecurityRow.SHORT-NAME)}
A ModeSwitchInterface PPortPrototype used to notify SW-Cs about the current Diagnostic Session
A ModeSwitchInterface PPortPrototype used to notify SW-Cs about an upcoming ECU Reset and its type
A ModeSwitchInterface PPortPrototype used to notify SW-Cs about the rapid power shut down mode
A ModeSwitchInterface PPortPrototype used to notify SW-Cs about the current Security Level
DEM
Called by the DEM after the internal processing of Dem_SetEventFailedWithSyncFreezeFrame is done and a further call of Dem_SetEventFailedWithSyncFreezeFrame with the same event ID can be processed by the DEM. Tags: atp.Status=draft
Std_ReturnType Dem_CallbackEventSyncStorageProcessed (void);Clears single DTCs, as well as groups of DTCs.
Std_ReturnType Dem_ClearDTC (uint8 ClientId);Clears a prestored freeze frame of a specific event. This API can only be used through the RTE and therefore no declaration is exported via Dem.h. API Availability: This API will be available only if ({ecuc(DEM/DemConfigSet/DemEvent Parameter.DemFFPrestorageSupported)} == true)
Std_ReturnType Dem_ClearPrestoredFreezeFrame (Dem_EventIdType EventId);Reports the value of a requested "availability-OBDMID" to the DCM upon a Service $06 request. Derived from that the tester displays the supported tests a mechanic can select from. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmGetAvailableOBDMIDs (uint8 Obdmid, uint32* Obdmidvalue);Gets DTC by freeze frame record number. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmGetDTCOfOBDFreezeFrame (uint8 FrameNumber, uint32* DTC, Dem_DTCFormatType DTCFormat);Reports a DTR data along with TID-value, UaSID, test result with lower and upper limit. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Service is used for requesting IUMPR data according to InfoType $08. This interface is derived from the prototype _GetInfotypeValueData() defined by the DCM. Therefore Dcm_Op StatusType and Std_ReturnType are contained. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmGetInfoTypeValue08 (Dcm_OpStatusType OpStatus, uint8* Iumprdata08, uint8* Iumprdata08BufferSize);Service is used for requesting IUMPR data according to InfoType $0B. This interface is derived from the prototype _GetInfotypeValueData() defined by the DCM. Therefore Dcm_Op StatusType and Std_ReturnType are contained. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmGetInfoTypeValue0B (Dcm_OpStatusType OpStatus, uint8* Iumprdata0B, uint8* Iumprdata0BBufferSize);Gets the number of TIDs per (functional) OBDMID. This can be used by the DCM to iteratively request for OBD/TID result data within a loop from 0....numberOfTIDs-1 API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmGetNumTIDsOfOBDMID (uint8 Obdmid, uint8* numberOfTIDs);Gets data element per PID and index of the most important freeze frame being selected for the output of service $02. The function stores the data in the provided DestBuffer. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmReadDataOfOBDFreezeFrame (uint8 PID, uint8 DataElementIndexOfPID, uint8* DestBuffer, uint16* BufSize);Service to report the value of PID $01 computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmReadDataOfPID01 (uint8* PID01value);Service to report the value of PID $1C computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmReadDataOfPID1C (uint8* PID1Cvalue);Service to report the value of PID $21 computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmReadDataOfPID21 (uint8* PID21value);Service to report the value of PID $30 computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmReadDataOfPID30 (uint8* PID30value);Service to report the value of PID $31 computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} == DEM_OBD_MASTER_ECU)
Std_ReturnType Dem_DcmReadDataOfPID31 (uint8* PID31value);Service to report the value of PID $41 computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmReadDataOfPID41 (uint8* PID41value);Service to report the value of PID $4D computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} == DEM_OBD_MASTER_ECU)
Std_ReturnType Dem_DcmReadDataOfPID4D (uint8* PID4Dvalue);Service to report the value of PID $4E computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} == DEM_OBD_MASTER_ECU)
Std_ReturnType Dem_DcmReadDataOfPID4E (uint8* PID4Evalue);Service to report the value of PID $91 computed by the DEM. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_DcmReadDataOfPID91 (uint8* PID91value);Disables the event memory update of a specific DTC (only one at one time).
Std_ReturnType Dem_DisableDTCRecordUpdate (uint8 ClientId);Disables the DTC setting for all DTCs assigned to the DemEventMemorySet of the addressed client.
Std_ReturnType Dem_DisableDTCSetting (uint8 ClientId);Enables the event memory update of the DTC disabled by Dem_DisableDTCRecordUpdate() before. Note: As the call to Dem_EnableDTCRecordUpdate is the last action in the sequence of disabling/enabling a DTC, the caller is not interested in the return value. Therefore E_OK should be returned even if the DTC is enabled asynchronously.
Std_ReturnType Dem_EnableDTCRecordUpdate (uint8 ClientId);(Re)-Enables the DTC setting for all DTCs assigned to the DemEventMemorySet of the addressed client.
Std_ReturnType Dem_EnableDTCSetting (uint8 ClientId);Service to report the value of the B1 counter computed by the DEM. API is needed in WWH-OBD relevant ECUs only
Std_ReturnType Dem_GetB1Counter (uint16* B1Counter);Gets the failed status of a DemComponent.
Std_ReturnType Dem_GetComponentFailed (Dem_ComponentIdType ComponentId, boolean* ComponentFailed);Returns the qualification state of the dependent operation cycle. API Availability: This API will be available only if any of the ({ecuc(DEM/DemGeneral/DEM OperationCycle.DemLeadingCycleRef)} != NULL)
Std_ReturnType Dem_GetCycleQualified (uint8 OperationCycleId, boolean* isQualified);Service to get the value of PID $21 from the DEM by a software component. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral/DemGeneral OBD.DemOBDCentralizedPID21Handling)} == true) && ({ecuc(DEM/DemGeneral.Dem OBDSupport)} == DEM_OBD_MASTER_ECU)
Std_ReturnType Dem_GetDataOfPID21 (uint8* PID21value);Gets the debouncing status of an event. This function shall not be used for EventId with native debouncing within their functions. It is rather for EventIds using debouncing within the DEM.
Std_ReturnType Dem_GetDebouncingOfEvent (Dem_EventIdType EventId, Dem_DebouncingStateType* DebouncingState);Gets the DTC by occurrence time. There is no explicit parameter for the DTC-origin as the origin always is DEM_DTC_ORIGIN_PRIMARY_MEMORY.
Std_ReturnType Dem_GetDTCByOccurrenceTime (uint8 ClientId, Dem_DTCRequestType DTCRequest, uint32* DTC);Gets the DTC of an event.
Std_ReturnType Dem_GetDTCOfEvent (Dem_EventIdType EventId, Dem_DTCFormatType DTCFormat, uint32* DTCOfEvent);Provides information if the last call to Dem_SelectDTC has selected a valid DTC or group of DTCs.
Std_ReturnType Dem_GetDTCSelectionResult (uint8 ClientId);Provides information if the last call to Dem_SelectDTC has selected a valid DTC or group of DTCs, respecting the settings if the DEM shall clear only all DTCs.
Std_ReturnType Dem_GetDTCSelectionResultForClearDTC (uint8 ClientId);Gets the DTC Severity availability mask.
Std_ReturnType Dem_GetDTCSeverityAvailabilityMask (uint8 ClientId, Dem_DTCSeverityType* DTCSeverityMask);Gets the DTC Status availability mask of the selected fault memory.
Std_ReturnType Dem_GetDTCStatusAvailabilityMask (uint8 ClientId, Dem_UdsStatusByteType* DTCStatusMask, Dem_DTCOriginType DTCOrigin);Returns the suppression status of a specific DTC. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemSuppressionSupport)} == DEM_DTC_SUPPRESSION)
Std_ReturnType Dem_GetDTCSuppression (uint8 ClientId, boolean* SuppressionStatus);Get the Event's availability.
Std_ReturnType Dem_GetEventAvailable (Dem_EventIdType EventId, boolean* AvailableStatus);Gets the data of an extended data record by event.
Std_ReturnType Dem_GetEventExtendedDataRecordEx (Dem_EventIdType EventId, uint8 RecordNumber, uint8* DestBuffer, uint16* BufSize);Gets the data of a freeze frame by event.
Std_ReturnType Dem_GetEventFreezeFrameDataEx (Dem_EventIdType EventId, uint8 RecordNumber, uint16 DataId, uint8* DestBuffer, uint16* BufSize);Gets the event memory overflow indication status.
Std_ReturnType Dem_GetEventMemoryOverflow (uint8 ClientId, Dem_DTCOriginType DTCOrigin, boolean* OverflowIndication);Gets the current UDS status byte assigned to the DTC for the event
Std_ReturnType Dem_GetEventUdsStatus (Dem_EventIdType EventId, Dem_UdsStatusByteType* UDSStatusByte);Gets the fault detection counter of an event. This API can only be used through the RTE, and therefore no declaration is exported via Dem.h.
Std_ReturnType Dem_GetFaultDetectionCounter (Dem_EventIdType EventId, sint8* FaultDetectionCounter);Gets the functional unit of the requested DTC.
Std_ReturnType Dem_GetFunctionalUnitOfDTC (uint8 ClientId, uint8* DTCFunctionalUnit);Gets the indicator status derived from the UDS status. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral/DemEventMemory Set/DemIndicator)} != NULL)
Std_ReturnType Dem_GetIndicatorStatus (uint8 IndicatorId, Dem_IndicatorStatusType* IndicatorStatus);In order to communicate the status of the (additional) denominator conditions among the OBD relevant ECUs, the API is used to retrieve the condition status from the DEM of the ECU where the conditions are computed. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_GetIUMPRDenCondition (Dem_IumprDenomCondIdType ConditionId, Dem_IumprDenomCondStatusType* ConditionStatus);Gets the current monitor status for an event.
Std_ReturnType Dem_GetMonitorStatus (Dem_EventIdType EventID, Dem_MonitorStatusType* MonitorStatus);Gets extended data record for the DTC selected by Dem_SelectExtendedDataRecord. The function stores the data in the provided DestBuffer.
Std_ReturnType Dem_GetNextExtendedDataRecord (uint8 ClientId, uint8* DestBuffer, uint16* BufSize);Gets the next filtered DTC matching the filter criteria. For UDS services, the interface has an asynchronous behavior, because a large number of DTCs has to be processed.
Std_ReturnType Dem_GetNextFilteredDTC (uint8 ClientId, uint32* DTC, uint8* DTCStatus);Gets the next filtered DTC and its associated Fault Detection Counter (FDC) matching the filter criteria. The interface has an asynchronous behavior, because a large number of DTCs has to be processed and the FDC might be received asynchronously from a SW-C, too.
Std_ReturnType Dem_GetNextFilteredDTCAndFDC (uint8 ClientId, uint32* DTC, sint8* DTCFaultDetectionCounter);Gets the next filtered DTC and its associated Severity matching the filter criteria. The interface has an asynchronous behavior, because a large number of DTCs has to be processed.
Std_ReturnType Dem_GetNextFilteredDTCAndSeverity (uint8 ClientId, uint32* DTC, uint8* DTCStatus, Dem_DTCSeverityType* DTCSeverity, uint8* DTCFunctionalUnit);Gets the next freeze frame record number and its associated DTC stored in the event memory. The interface has an asynchronous behavior, because NvRAM access might be required.
Std_ReturnType Dem_GetNextFilteredRecord (uint8 ClientId, uint32* DTC, uint8* RecordNumber);Gets freeze frame data by the DTC selected by Dem_SelectFreezeFrameData. The function stores the data in the provided DestBuffer.
Std_ReturnType Dem_GetNextFreezeFrameData (uint8 ClientId, uint8* DestBuffer, uint16* BufSize);Returns the number of entries currently stored in the requested event memory.
Std_ReturnType Dem_GetNumberOfEventMemoryEntries (uint8 ClientId, Dem_DTCOriginType DTCOrigin, uint8* NumberOfEventMemoryEntries);Gets the number of a filtered DTC.
Std_ReturnType Dem_GetNumberOfFilteredDTC (uint8 ClientId, uint16* NumberOfFilteredDTC);This function returns the number of all freeze frame records currently stored in the primary event memory
Std_ReturnType Dem_GetNumberOfFreezeFrameRecords (uint8 ClientId, uint16* NumberOfFilteredRecords);Gets the severity of the requested DTC. For large configurations and DTC-calibration, the interface behavior can be asynchronous (splitting the DTC-search into segments).
Std_ReturnType Dem_GetSeverityOfDTC (Dem_DTCSeverityType* DTCSeverity, uint8 ClientId);Gets the size of Extended Data Record by DTC selected by the call of Dem_SelectExtended DataRecord.
Std_ReturnType Dem_GetSizeOfExtendedDataRecordSelection (uint8 ClientId, uint32* SizeOfExtendedDataRecord);Gets the size of freeze frame data by DTC selected by the call of Dem_SelectFreezeFrame Data.
Std_ReturnType Dem_GetSizeOfFreezeFrameSelection (uint8 ClientId, uint32* SizeOfFreezeFrame);Gets the status of a DTC. For large configurations and DTC-calibration, the interface behavior can be asynchronous (splitting the DTC-search into segments). The DTCs of OBD Events Suppression shall be reported as Dem_WRONG_DTC.
Std_ReturnType Dem_GetStatusOfDTC (uint8 ClientId, uint8* DTCStatus);Gets the supported DTC formats of the ECU.The supported formats are configured via DEM TypeOfDTCSupported.
Dem_DTCTranslationFormatType Dem_GetTranslationType (uint8 ClientId);Returns the version information of this module. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemVersionInfoApi)} == true)
void Dem_GetVersionInfo (Std_VersionInfoType* versioninfo);Initializes or reinitializes this module.
void Dem_Init (const Dem_ConfigType* ConfigPtr);Clears the status of all event(s) related to the specified DTC(s), as well as all associated event memory entries for these event(s).
Std_ReturnType Dem_J1939DcmClearDTC (Dem_J1939DcmSetClearFilterType DTCTypeFilter, Dem_DTCOriginType DTCOrigin, uint8 ClientId);The function sets the filter to the first applicable DTC for the DM31 response for a specific node.
void Dem_J1939DcmFirstDTCwithLampStatus (uint8 ClientId);Gets the next filtered J1939 DTC for DM31 including current LampStatus.
Std_ReturnType Dem_J1939DcmGetNextDTCwithLampStatus (Dem_J1939DcmLampStatusType* LampStatus, uint32* J1939DTC, uint8* OccurenceCounter, uint8 ClientId);Gets the next filtered J1939 DTC.
Std_ReturnType Dem_J1939DcmGetNextFilteredDTC (uint32* J1939DTC, uint8* OccurenceCounter, uint8 ClientId);Gets the next filtered Ratio.
Std_ReturnType Dem_J1939DcmGetNextFilteredRatio (uint32* SPN, uint16* Numerator, uint16* Denominator, uint8 ClientId);Gets next SPN.
Std_ReturnType Dem_J1939DcmGetNextSPNInFreezeFrame (uint32* SPNSupported, uint8* SPNDataLength, uint8 ClientId);Gets the number of currently filtered DTCs set by the function Dem_J1939DcmSetDTCFilter.
Std_ReturnType Dem_J1939DcmGetNumberOfFilteredDTC (uint16* NumberOfFilteredDTC, uint8 ClientId);Service to report the value of Diagnostic Readiness 1 (DM05) computed by the DEM.
Std_ReturnType Dem_J1939DcmReadDiagnosticReadiness1 (Dem_J1939DcmDiagnosticReadiness1Type* DataValue, uint8 ClientId);Service to report the value of Diagnostic Readiness 2 (DM21) computed by the DEM.
Std_ReturnType Dem_J1939DcmReadDiagnosticReadiness2 (Dem_J1939DcmDiagnosticReadiness2Type* DataValue, uint8 ClientId);Service to report the value of Diagnostic Readiness 3 (DM26) computed by the DEM.
Std_ReturnType Dem_J1939DcmReadDiagnosticReadiness3 (Dem_J1939DcmDiagnosticReadiness3Type* DataValue, uint8 ClientId);The function sets the DTC filter for a specific node and returns the composite lamp status of the filtered DTCs.
Std_ReturnType Dem_J1939DcmSetDTCFilter (Dem_J1939DcmDTCStatusFilterType DTCStatusFilter, Dem_DTCKindType DTCKind, Dem_DTCOriginType DTCOrigin, uint8 ClientId, Dem_J1939DcmLampStatusType* LampStatus);The function sets the FreezeFrame filter for a specific node.
Std_ReturnType Dem_J1939DcmSetFreezeFrameFilter (Dem_J1939DcmSetFreezeFrameFilterType FreezeFrameKind, uint8 ClientId);The function sets the Ratio filter for a specific node and returns the corresponding Ignition Cycle Counter and General Denominator.
Std_ReturnType Dem_J1939DcmSetRatioFilter (uint16* IgnitionCycleCounter, uint16* OBDMonitoringConditionsEncountered, uint8 ClientId);Processes all not event based DEM internal functions.
void Dem_MainFunction (void);Initializes the internal states necessary to process events reported by BSW-modules.
void Dem_PreInit (void);Captures the freeze frame data for a specific event. This API can only be used through the RTE and therefore no declaration is exported via Dem.h. API Availability: This API will be available only if ({ecuc(DEM/DemConfigSet/DemEvent Parameter.DemFFPrestorageSupported)} == true)
Std_ReturnType Dem_PrestoreFreezeFrame (Dem_EventIdType EventId);Service to report the value of PID $01 computed by the DEM. API is needed in OBD relevant ECUs only
Std_ReturnType Dem_ReadDataOfPID01 (uint8* PID01value);Service is used to release a denominator of a specific monitor. API is needed in OBD-relevant ECUs only API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_RepIUMPRDenRelease (Dem_RatioIdType RatioID);Service for reporting that faults are possibly found because all conditions are fullfilled. API is needed in OBD-relevant ECUs only API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_RepIUMPRFaultDetect (Dem_RatioIdType RatioID);Control the internal debounce counter/timer by BSW modules and SW-Cs. The event qualification will not be affected by these debounce state changes. This API is available for BSW modules as soon as Dem_PreInit has been completed (refer to SWS_Dem_00438 and SWS_Dem_00167).
Std_ReturnType Dem_ResetEventDebounceStatus (Dem_EventIdType EventId, Dem_DebounceResetStatusType DebounceResetStatus);Resets the event failed status. This API can only be used through the RTE and therefore no declaration is exported via Dem.h.
Std_ReturnType Dem_ResetEventStatus (Dem_EventIdType EventId);Sets an operation cycle state. This API can only be used through the RTE and therefore no declaration is exported via Dem.h. The interface has an asynchronous behavior to avoid exceeding of typical timing requirements on APIs if a large number of events has to be processed and during the re-initializations of the related monitors. The asynchronous acknowledgements are the related InitMonitorForEvent callbacks.
Std_ReturnType Dem_RestartOperationCycle (uint8 OperationCycleId);Selects a DTC or DTC group as target for further operations.
Std_ReturnType Dem_SelectDTC (uint8 ClientId, uint32 DTC, Dem_DTCFormatType DTCFormat, Dem_DTCOriginType DTCOrigin);Sets the filter to be used by Dem_GetNextExtendedDataRecord and Dem_GetSizeOfExtended DataRecordSelection.
Std_ReturnType Dem_SelectExtendedDataRecord (uint8 ClientId, uint8 ExtendedDataNumber);Sets the filter to be used by Dem_GetNextFreezeFrameData and Dem_GetSizeOfFreezeFrame Selection.
Std_ReturnType Dem_SelectFreezeFrameData (uint8 ClientId, uint8 RecordNumber);Set the availability of a specific DemComponent.
Std_ReturnType Dem_SetComponentAvailable (Dem_ComponentIdType ComponentId, boolean AvailableStatus);Sets a dependent operation cycle as qualified, so it may be processed along with its leading cycle.
Std_ReturnType Dem_SetCycleQualified (uint8 OperationCycleId);Service to set the value of PID $21 in the DEM by a software component. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_SetDataOfPID21 (const uint8* PID21value);Service to set the value of PID $31 in the DEM by a software component. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_SetDataOfPID31 (const uint8* PID31value);Service to set the value of PID $4D in the DEM by a software component. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_SetDataOfPID4D (const uint8* PID4Dvalue);Service to set the value of PID $4E in the DEM by a software component. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_SetDataOfPID4E (const uint8* PID4Evalue);Sets the DTC Filter. The server shall perform a bit-wise logical AND-ing operation between the parameter DTCStatusMask and the current UDS status in the server. In addition to the DTCStatus AvailabilityMask, the server shall return all DTCs for which the result of the AND-ing operation is non-zero [i.e. (statusOfDTC & DTCStatusMask) != 0]. The server shall process only the DTC Status bits that it is supporting. OBD Events Suppression shall be ignored for this computation. If no DTCs within the server match the masking criteria specified in the clients request, no DTC or status information shall be provided following the DTCStatusAvailabilityMask byte in the positive response message (((statusOfDTC & DTCStatusMask) != 0) && ((severity & DTCSeverityMask) != 0)) == TRUE
Std_ReturnType Dem_SetDTCFilter (uint8 ClientId, uint8 DTCStatusMask, Dem_DTCFormatType DTCFormat, Dem_DTCOriginType DTCOrigin, boolean FilterWithSeverity, Dem_DTCSeverityType DTCSeverityMask, boolean FilterForFaultDetectionCounter);Set the suppression status of a specific DTC. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemSuppression Support)} == DEM_DTC_SUPPRESSION)
Std_ReturnType Dem_SetDTCSuppression (uint8 ClientId, boolean SuppressionStatus);Reports a DTR result with lower and upper limit. The internal eventstatus serves as master whether the DTR values are forwarded or ignored, also taking the DTRUpdateKind into account. The EventId that is related to the DTR is assigned per configuration (and derived from ServiceNeeds). Processing takes enable/storage conditions into account. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_SetDTR (uint16 DTRId, sint32 TestResult, sint32 LowerLimit, sint32 UpperLimit, Dem_DTRControlType Ctrlval);Sets an enable condition. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral/DemEnable Condition)} != NULL)
Std_ReturnType Dem_SetEnableCondition (uint8 EnableConditionID, boolean ConditionFulfilled);Set the available status of a specific Event.
Std_ReturnType Dem_SetEventAvailable (Dem_EventIdType EventId, boolean AvailableStatus);Set the failure confirmation threshold of an event.
Std_ReturnType Dem_SetEventConfirmationThresholdCounter (Dem_EventIdType EventId, uint8 FailureCycleCounterThreshold);Service for reporting the event as disabled to the DEM for the PID $41 computation. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_SetEventDisabled (Dem_EventIdType EventId);If called the DEM sets the event to failed and this failed event requires that a snapshot record is captured, the DEM synchronously retrieves the data within the call of this API. Tags: atp.Status=draft
void Dem_SetEventFailedWithSyncFreezeFrame (Dem_EventIdType EventId);Called by SW-Cs or BSW modules to report monitor status information to the DEM. BSW modules calling Dem_SetEventStatus can safely ignore the return value. This API will be available only if ({DEM/DemConfigSet/DemEventParameter/DemEventReportingType} == STANDARD_REPORTING)
Std_ReturnType Dem_SetEventStatus (Dem_EventIdType EventId, Dem_EventStatusType EventStatus);This API will be available only if ({DEM/DemConfigSet/DemEventParameter/DemEvent ReportingType} == STANDARD_REPORTING_WITH_MONITOR_DATA)
Std_ReturnType Dem_SetEventStatusWithMonitorData (Dem_EventIdType EventId, Dem_EventStatusType EventStatus, Dem_MonitorDataType monitorData0, Dem_MonitorDataType monitorData1);Sets a freeze frame record filter.
Std_ReturnType Dem_SetFreezeFrameRecordFilter (uint8 ClientId, Dem_DTCFormatType DTCFormat);In order to communicate the status of the (additional) denominator conditions among the OBD relevant ECUs, the API is used to forward the condition status to a DEM of a particular ECU. API is needed in OBD-relevant ECUs only. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_SetIUMPRDenCondition (Dem_IumprDenomCondIdType ConditionId, Dem_IumprDenomCondStatusType ConditionStatus);API is needed in OBD-relevant ECUs only API Availability: This API will be available only if ({ecuc(DEM/DemGeneral.DemOBDSupport)} != DEM_OBD_NO_OBD_SUPPORT)
Std_ReturnType Dem_SetPtoStatus (boolean PtoStatus);Sets a storage condition. API Availability: This API will be available only if ({ecuc(DEM/DemGeneral/DemStorage Condition)} != NULL)
Std_ReturnType Dem_SetStorageCondition (uint8 StorageConditionID, boolean ConditionFulfilled);Sets the WIR status bit via failsafe SW-Cs. This API can only be used through the RTE and therefore no declaration is exported via Dem.h.
Std_ReturnType Dem_SetWIRStatus (Dem_EventIdType EventId, boolean WIRStatus);Shuts down this module.
void Dem_Shutdown (void);Identification of a DemComponent by assigned ComponentId. The ComponentId is automatically assigned by the DEM.
This type of the external data structure shall contain the post build initialization data for the DEM.
Array data type definition for external data elements
Data type definition for external data elements
This type contains all definitions to control an internal debounce counter/timer via the function Dem_ResetEventDebounceStatus().
This type is used to select the format of the DTC value.
This type is used to filter DTCs for their kind.
This enum is used to define the location of the events. The definition and use of the different memory types is OEM-specific.
This type is used to request a DTC with specific attributes.
DTC translation format as defined in ISO14229-1.
Control parameter for the interpretation of the reported test results.
Identification of an event by assigned EventId. The EventId is assigned by the DEM. Example: 1 refers to monitor x, 2 refers to monitor y, etc.
This type contains all monitor test result values, which can be reported via Dem_SetEventStatus().
Indicator mode used by Dem_GetIndicatorStatus().
(Re-)Initialization reason returned by the callback _DemInitMonitorFor().
This type contains all possible additional IUMPR denominator conditions to be broadcasted among OBD-relevant ECUs.
This type contains all possible states of an additional IUMPR denominator condition to be broadcasted among OBD-relevant ECUs.
This structure represents all data elemets of the DM05 message. The encoding shall be done acording SAE J1939-73
This structure represents all data elemets of the DM21 message. The encoding shall be done acording SAE J1939-73
This structure represents all data elemets of the DM26 message. The encoding shall be done acording SAE J1939-73
The type to distinguish which DTCs should be filtered.
For details refer SAE J1939-73
The type to distinguish which DTCs gets cleared
The type to distinguish which DTCs gets cleared
This type is used to pass monitoring data to the DEM.
OBD specific ratio Id (related to a specific event, a FID, and an IUMPR group). This type depends on the DEM configuration.
DET
-
Std_ReturnType <DetReportRuntimeErrorCallout> (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId);-
Std_ReturnType <DetReportTransientFaultCallout> (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 FaultId);-
Std_ReturnType <User_Error_Hooks> (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId);Returns the version information of this module.
void Det_GetVersionInfo (Std_VersionInfoType* versioninfo);Service to initialize the Default Error Tracer.
void Det_Init (const Det_ConfigType* ConfigPtr);Service to report development errors.
Std_ReturnType Det_ReportError (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId);Service to report runtime errors. If a callout has been configured then this callout shall be called.
Std_ReturnType Det_ReportRuntimeError (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, faultErrorTracer uint8 ErrorId);Service to report transient faults. If a callout has been configured than this callout shall be called and the returned value of the callout shall be returned. Otherwise it returns immediately with E_ OK.
Std_ReturnType Det_ReportTransientFault (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 FaultId);Service to start the Default Error Tracer.
void Det_Start (void);Configuration data structure of the DET module.
Dlt
Service Dlt_CopyRxData.
BufReq_ReturnType Dlt_CopyRxData (PduIdType id, const PduInfoType* info, PduLengthType* bufferSizePtr);Service Dlt_CopyTxData.
BufReq_ReturnType Dlt_CopyTxData (PduIdType id, const PduInfoType* info, const RetryInfoType* retry, PduLengthType* availableDataPtr);Returns the Default Log Level currently used by the Dlt module. The returned Log Level might differ from the one which is stored no n volatile.
Std_ReturnType Dlt_GetDefaultLogLevel (Dlt_MessageLogLevelType* defaultLogLevel);Called to request information about registered Application Ids, their Context Ids and the corresponding log level.
Std_ReturnType Dlt_GetLogInfo (uint8 options, Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, uint8* status, Dlt_LogInfoType* logInfo);Returns the current Trace Status for a given tuple Application Id/ Context Id.
Std_ReturnType Dlt_GetTraceStatus (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, boolean* traceStatus);Returns the version information of this module.
void Dlt_GetVersionInfo (Std_VersionInfoType* versioninfo);Dlt is using the NVRam Manager and is to be initialized very late in the ECU startup phase. The Dlt_ Init() function should be called after the NVRam Manager is initialized.
void Dlt_Init (const Dlt_ConfigType* config);The service Dlt_ Reset To Factory Default sets the Log Level and Trace Status back to the pers istently stored default values. If the feature Nv MRAM support is enabled, all stored Dlt values in the Nv M are deleted.
Std_ReturnType Dlt_ResetToFactoryDefault (void);Indication of a received PDU from a lower layer communication interface module.
void Dlt_RxIndication (PduIdType RxPduId, const PduInfoType* PduInfoPtr);The service represents the interface to be used by basic software modules or by software component to send Log Messages.
Std_ReturnType Dlt_SendLogMessage (Dlt_SessionIDType sessionId, const Dlt_MessageLogInfoType* logInfo, const uint8* logData, uint16 logDataLength);The service represents the interface to be used by basic software modules or by software components to trace parameters.
Std_ReturnType Dlt_SendTraceMessage (Dlt_SessionIDType sessionId, const Dlt_MessageTraceInfoType* traceInfo, const uint8* traceData, uint16 traceDataLength);Called to modify the pass through range for Log Messages for all not explicit set Context Ids.
Std_ReturnType Dlt_SetDefaultLogLevel (Dlt_MessageLogLevelType newLogLevel);This service is used to change the Log Level for the given tuple of Application ID/ Context ID.
Std_ReturnType Dlt_SetLogLevel (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, Dlt_MessageLogLevelType newLogLevel);Switches on/ off the mes sage filtering functionality of the Dlt module.
Std_ReturnType Dlt_SetMessageFiltering (boolean status);The service Dlt_ Set Trace Status sets the trace status for a specific tuple of Application ID and Context ID.
Std_ReturnType Dlt_SetTraceStatus (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, boolean newTraceStatus);This function is called at the start of receiving an N -
BufReq_ReturnType Dlt_StartOfReception (PduIdType id, const PduInfoType* info, PduLengthType TpSduLength, PduLengthType* bufferSizePtr);Copies the current Dlt configuration to Nv RAM by calling Nv M_ Write Block().
Std_ReturnType Dlt_StoreConfiguration (void);Called after an I - PDU has been received via the TP API, the result indicates whether the transmission was successful or not.
void Dlt_TpRxIndication (PduIdType id, Std_ReturnType result);This function is called after the I - PDU has been transmitted on its network, the result indicates whether the transmission was succe ssful or not.
void Dlt_TpTxConfirmation (PduIdType id, Std_ReturnType result);Within this API , the upper layer module (called module) shall check whether the available data fits into the buffer size reported by Pdu Info Ptr - >Sdu Length. If it fits, it shall copy its data into the buffer provided by Pdu Info Ptr - >Sdu Data Ptr and update the length of the actual copied data in Pdu Info Ptr - >Sdu Length. If not, it returns E_ NOT_ OK without changing Pdu Info Ptr.
Std_ReturnType Dlt_TriggerTransmit (PduIdType TxPduId, PduInfoType* PduInfoPtr);The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.
void Dlt_TxConfirmation (PduIdType TxPduId, Std_ReturnType result);-
void Dlt_TxFunction (void);The service has to be called when a software module is going to be stopped. Available vi a Dlt.h
Std_ReturnType Dlt_UnregisterContext (Dlt_SessionIDType sessionId, Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId);Information about Applications
This type describes the Application Id. 0x00000000 means the so - called wildcard.
Adding or removing a Log Channel assignment for the given tuple of Application Id/ Context Id.
This is the type of the data structure containing the initialization data for Dlt.
Context Information
This type describes the Context Id. 0x00000000 means the so - called wildcard.
-
This type describes the count of arguments provided to a message.
Contains the unique Message Id for a message. This is only relevant in non - verbose mode.
This type describes the log lev el for each log message.
This type describes transported type of a Dlt BUSMESSAGE.
Bitfield
This type describes labels for trace messages.
This type describes the type of the message.
This type identifies the session.
This type describes the Log Channel name.
FiM
Service CBFidStatusChanged.
Std_ReturnType CBFidStatusChanged(FiM_FidStatusChangeType Status, boolean Permission);This service re-initializes the FIM.
void FiM_DemInit(void);Triggers on changes of the component failed status.
void FiM_DemTriggerOnComponentStatus(Dem_ComponentIdType ComponentId, boolean ComponentFailedStatus);This service is provided to be called by the DEM in order to inform the Fim about monitor status changes.
void FiM_DemTriggerOnMonitorStatus(Dem_EventIdType EventId);This service reports the permission state to the functionality.
Std_ReturnType FiM_GetFunctionPermission(FiM_FunctionIdType FID, boolean* Permission);This service returns the version information of this module.
void FiM_GetVersionInfo(Std_VersionInfoType* versioninfo);This service initializes the FIM.
void FiM_Init(const FiM_ConfigType* FiMConfigPtr);Service FiM_MainFunction.
void FiM_MainFunction(void);This service sets the availability of a function. The function is only available if FiMAvailability Support is configured as True.
Std_ReturnType FiM_SetFunctionAvailable(FiM_FunctionIdType FID, boolean Availability);This type defines a data structure for the post build parameters of the FIM. At initialization the FIM gets a pointer to a structure of this type to get access to its configuration data, which is necessary for initializsation.
Type for the FunctionID Variation –
集群指南人工智能生成
用于处理 UDS 与 OBD 诊断服务、事件存储以及系统错误跟踪的核心群集。
用于处理 UDS 与 OBD 诊断服务、事件存储以及系统错误跟踪的核心群集。
Diagnostic Services 模块群集(DCM、DEM、DET、Dlt)汇总了 AUTOSAR Classic Platform 中 UDS 与 OBD 诊断服务的协议处理以及中央错误管理和跟踪 (SWS DiagnosticCommunicationManager 第56页)。DCM 通过 PduR 缓冲区处理传入的测试仪请求,并从 DEM 查询状态、快照以及冻结帧数据 ([SWS_Dcm_00094], [SWS_Dem_00215])。与此同时,DET 和 Dlt 采集开发错误以及用于故障诊断的运行时日志 ([SWS_Det_00181], [SWS_Dlt_00241])。
AUTOSAR Classic Platform 的 Diagnostic Services 模块群集由 DCM、DEM、DET 和 Dlt 四个模块组成。它构成了处理外部诊断会话(符合 ISO 14229 的 UDS、符合 ISO 15031-5 的 OBD)、ECU 内部错误管理以及开发与运行监控的核心基石 (SWS DiagnosticCommunicationManager 第56页, SWS DiagnosticEventManager 第247页)。
来自测试仪的诊断请求由 PduR 模块通过 Dcm_StartOfReception 发起,并在通过 Dcm_TpRxIndication 接收后移交给 DCM ([SWS_Dcm_00094], [SWS_Dcm_00093])。DCM 对协议进行解码,并直接访问 DEM 以进行状态查询、DTC 列表或冻结帧数据获取(例如通过 Dem_GetStatusOfDTC 或 Dem_GetNextFilteredDTC)([SWS_Dem_00212], [SWS_Dem_00215])。异步接口通过 DEM_PENDING 或 DCM_E_PENDING 发出信号,表明计算将在周期性 MainFunctions 的上下文中继续进行 ([SWS_Dem_00236], [SWS_Dcm_00539])。
上下文图:群集模块 DCM、DEM、DET 和 DLT 在 AUTOSAR 架构中的嵌入。来源:SWS DiagnosticEventManager 第247页, SWS DiagnosticCommunicationManager 第55页
DEM 通过基于时间或基于计数器的去抖动对错误进行定性 ([SWS_Dem_00426], [SWS_Dem_00683]),并管理具有可配置替换策略的主存储器和用户存储器 ([SWS_Dem_00400])。与此同时,DET 通过 Det_ReportError 接收开发错误 ([SWS_Det_00009]),而 Dlt 模块则通过 Dlt_SendLogMessage 过滤日志和跟踪消息,并通过配置的日志通道提供这些消息 ([SWS_Dlt_00241], [SWS_Dlt_00740])。
时序图:测试仪、DCM 与 DEM 之间 UDS DTC 状态查询的流程。来源:SWS DiagnosticCommunicationManager 第55页, [SWS_Dem_00215]
DCM 的运行模式主要由 ComM 通过诸如 Dcm_ComM_FullComModeEntered 和 Dcm_ComM_NoComModeEntered 等回调进行同步 ([SWS_Dcm_00356], [SWS_Dcm_00360])。非易失性状态由 DEM 和 Dlt 通过 NvM 模块进行保护存储 ([SWS_Dem_00181], [SWS_Dlt_00453])。
1. 系统架构与模块群集的作用
AUTOSAR Classic Platform 的 Diagnostic Services 模块群集汇集了系统服务(System Services)层中用于车载和非车载诊断、错误记录以及系统监控的所有核心功能。它由四个基础软件模块组成:DCM(Diagnostic Communication Manager)、DEM(Diagnostic Event Manager)、DET(Default Error Tracer)和 Dlt(Diagnostic Log and Trace)。这些模块共同构成了车辆外部诊断测试仪、内部功能软件以及符合 ISO 14229 (UDS) 和 ISO 15031-5 或 SAE J1979 (OBD) 标准协议之间的标准化纽带 (SWS DiagnosticCommunicationManager 第56页, SWS DiagnosticEventManager 第186页)。
DCM 充当来自测试仪的诊断请求的协议管理器。其内部划分为 Diagnostic Session Layer (DSL)、Diagnostic Service Dispatcher (DSD) 和 Diagnostic Service Processing (DSP) 子模块。DCM 处理会话控制和安全级别 ([SWS_Dcm_00338], [SWS_Dcm_00339]),通过 PduR 模块接收诊断 PDU ([SWS_Dcm_00094]),并将与服务相关的请求转发给应用 SW-C 或 DEM ([SWS_Dcm_00111])。DEM 充当中央诊断存储器:它处理来自监控器的错误报告,执行去抖动算法 ([SWS_Dem_00426], [SWS_Dem_00683]),管理诊断故障代码(DTC)、状态掩码 ([SWS_Dem_00213]) 以及相关的快照和扩展数据记录 ([SWS_Dem_00039], [SWS_Dem_00239])。
作为补充,DET 负责采集基础软件的开发错误、运行时错误和瞬态错误 ([SWS_Det_00181], [SWS_Det_01003]),而 Dlt 模块则聚合、过滤来自应用程序和 BSW 模块的标准化日志与跟踪消息,并将其传输给外部工具 ([SWS_Dlt_00224], [SWS_Dlt_00241], [SWS_Dlt_00243])。
上下文图:群集模块 DCM、DEM、DET 和 DLT 在 AUTOSAR 架构中的嵌入。来源:SWS DiagnosticEventManager 第247页, SWS DiagnosticCommunicationManager 第55页, SWS DiagnosticLogAndTrace 第46页
2. 模块间的相互协作与交互路径
主要的外部交互路径由来自测试仪的传入诊断消息发起。当传输协议通过 PduR 指示有新的诊断数据时,PduR 会调用 Dcm_StartOfReception ([SWS_Dcm_00094], [SWS_Dcm_01672])。在缓冲区容量充足的情况下,DCM 保留资源并通过 BUFREQ_OK 进行确认;否则,传输将被 BUFREQ_E_OVFL 或 BUFREQ_E_NOT_OK 拒绝 ([SWS_Dcm_00444], [SWS_Dcm_00642])。在完全接收 I-PDU 后,PduR 调用 Dcm_TpRxIndication,随后有效负载从 DSL 移交给 DSD ([SWS_Dcm_00093], [SWS_Dcm_00111])。
对于诸如 UDS 服务 0x19 (ReadDTCInformation) 或 OBD 服务($01、$02、$03、$06)等诊断请求,DCM 会同步和异步访问标准化的 DEM 接口 (AUTOSAR SWS DiagnosticEventManager 第370页, AUTOSAR SWS DCM 第87页)。例如,DCM 通过 Dem_GetStatusOfDTC 读取状态信息 ([SWS_Dem_00212]),或者使用 Dem_GetNextFilteredDTC ([SWS_Dem_00215]) 或 Dem_GetNextFilteredDTCAndFDC ([SWS_Dem_00227]) 逐次过滤 DTC。冻结帧数据和扩展记录通过 Dem_GetSizeOfFreezeFrameSelection、Dem_GetNextFreezeFrameData 以及 Dem_GetNextExtendedDataRecord 进行查询 ([SWS_Dem_00071], [SWS_Dem_00074], [SWS_Dem_00236], [SWS_Dem_00239])。对于与排放相关的 PID,DEM 提供特定的数据缓冲区,例如通过 Dem_DcmReadDataOfPID01 提供 PID $01 的数据 ([SWS_Dem_00318]),或者通过 Dem_DcmGetAvailableOBDMIDs 和 Dem_DcmGetDTRData 提供 OBDMID 测试结果 ([SWS_Dem_00766], [SWS_Dem_00768])。
与此同时,SW-C 和 BSW 模块通过 Dem_SetEventStatus 将事件报告输入 DEM ([SWS_Dem_00183]),或使用 Dem_ResetEventDebounceStatus 重置去抖动状态 ([SWS_Dem_00683])。群集内的参数检查错误或非法 API 调用由所有相关模块通过 Det_ReportError 报告给 DET ([SWS_Det_00009], [SWS_Det_00501])。为了进行深入跟踪,应用程序通过 Dlt_SendLogMessage ([SWS_Dlt_00241], [SWS_Dlt_00236]) 或 Dlt_SendTraceMessage ([SWS_Dlt_00243], [SWS_Dlt_00237]) 将结构化消息传递给 Dlt。
时序图:测试仪、DCM 与 DEM 之间 UDS DTC 状态查询的流程。来源:SWS DiagnosticCommunicationManager 第55页, AUTOSAR SWS DiagnosticEventManager 第370页, [SWS_Dem_00215]
3. 同步、可重入性与任务上下文
该群集结合了用于快速状态查询的同步接口调用与用于资源密集型处理的异步模式。PduR 的底层回调(例如 Dcm_TpRxIndication 或 Dlt_TxConfirmation)可能从中断上下文中执行 ([SWS_Dcm_00093], [SWS_Dlt_00273])。它们不得包含阻塞式计算,而应向相应模块发送事件信号。
周期性处理是在任务层级通过经由 SchM 定时的主要功能(如 Dem_MainFunction)来执行的 (SWS DiagnosticEventManager 第247页)。基于时间的去抖动 ([SWS_Dem_00426])、NvM 写入访问和存储清理均在其中处理。为了避免异步冲突,诸如 Dem_GetStatusOfDTC 或 Dem_GetNextFilteredDTC 等 API 针对不同的 ClientId 实例被设计为可重入的,但对于相同的 ClientId 则是严格不可重入的 ([SWS_Dem_00212], [SWS_Dem_00215])。Dem_SetEventStatus 的行为类似,对于不同的 EventId 它可以被重入调用 ([SWS_Dem_00183])。
在执行耗时较长的操作(例如读取大容量快照数据记录或存储器操作,如 Dcm_ReadMemory、Dcm_WriteMemory)时,诸如 DEM_PENDING 或 DCM_E_PENDING 之类的返回值指示处理仍在进行中,并且必须在周期性任务上下文中通过后续调用来完成 ([SWS_Dem_00215], [SWS_Dem_00236], [SWS_Dcm_00539], [SWS_Dcm_00540])。
4. 典型生命周期与运行模式
群集模块的生命周期遵循固定的初始化和反初始化顺序。在早期启动阶段,Det_Start 启动错误跟踪器 ([SWS_Det_00010])。DEM 经历两阶段初始化:在 Dem_PreInit 之后,基础监控和去抖动被启用 ([SWS_Dem_00683]);完全初始化 Dem_Init 在 NvM 启动后进行 ([SWS_Dem_00181])。Dlt_Init 在 NvM 之后被调用,以便通过 NvM_ReadBlock 恢复持久化的过滤器和通道状态 ([SWS_Dlt_00239], [SWS_Dlt_00453])。在系统关机时,DEM 通过 Dem_Shutdown 保存其错误存储器内容 ([SWS_Dem_00182])。
在运行期间,Communication Manager (ComM) 通过回调函数控制 DCM 的通信模式:Dcm_ComM_FullComModeEntered 激活常规发送和接收就绪状态以及周期性 ID ([SWS_Dcm_00360], SWS DiagnosticCommunicationManager 第479页)。Dcm_ComM_SilentComModeEntered 停用常规传输 ([SWS_Dcm_00358]),而 Dcm_ComM_NoComModeEntered 则禁止任何通信 ([SWS_Dcm_00356])。在重新编程或 ECU 复位时,通过 Dcm_SetProgConditions 和 Dcm_GetProgConditions 交换引导加载程序(Bootloader)传递参数 ([SWS_Dcm_00543], [SWS_Dcm_00544])。随时可以通过 Dcm_ResetToDefaultSession 强制复位到默认会话 ([SWS_Dcm_00520])。
状态图:由 ComM 控制的 DCM 通信状态。来源:AUTOSAR CP SWS DiagnosticCommunicationManager 第478页, [SWS_Dcm_00356], [SWS_Dcm_00358], [SWS_Dcm_00360]
5. 错误处理、DET 跟踪与降级
诊断和错误处理架构严格区分开发错误(DET)与操作性系统故障(DEM)。运行时错误和开发错误由 DET 通过配置的用户 callout 捕获 ([SWS_Det_00181], [SWS_Det_00501])。瞬态错误通过 Det_ReportTransientFault 进行指示 ([SWS_Det_01003])。在 DCM 中,传输错误通过 Dcm_TxConfirmation 捕获确认失败,随后释放发送缓冲区并清除超时 ([SWS_Dcm_00351], ErrorDescription 第26页)。
在 DEM 中,功能错误通过去抖动过滤器进行定性 ([SWS_Dem_00427], [SWS_Dem_00683])。可以通过启用条件和存储条件针对性地抑制存储或去抖动 (Dem_SetEnableCondition, Dem_SetStorageCondition) ([SWS_Dem_00201], [SWS_Dem_00556])。当事件存储器面临存满风险时,替换策略(Displacement)将生效,其中较低优先级或被动的现有条目将被替换 ([SWS_Dem_00400], [SWS_Dem_00401], AUTOSAR SWS DiagnosticEventManager 第98页)。存储溢出通过 Dem_GetEventMemoryOverflow 报告给客户端 ([SWS_Dem_00559])。为了停用跛行模式程序,Dem_ResetEventStatus 允许提前重置 Failed 状态 ([SWS_Dem_00185], SWS DiagnosticEventManager 第79页)。
Dlt 模块通过动态过滤日志级别 (Dlt_SetDefaultLogLevel) 和跟踪状态 (Dlt_SetTraceStatus, Dlt_SetMessageFiltering) 来支持错误分析 ([SWS_Dlt_00254], [SWS_Dlt_00740], [SWS_Dlt_00770])。配置可以被持久保存 (Dlt_StoreConfiguration),或通过 Dlt_ResetToFactoryDefault 恢复为出厂状态 ([SWS_Dlt_00736], [SWS_Dlt_00739])。解释:在 Release R20-11 中,用于自动转发错误消息的 DET 与 Dlt 之间的直接耦合可能是通过标准化 callout 钩子或应用程序跟踪实现的 (SWS DefaultErrorTracer 第1页)。 问题 Q-c1cf364915fb6635 (未决)
本指南根据 AUTOSAR 规范 R20-11 规范性地总结了 Diagnostic Services(DCM、DEM、DET、Dlt)的核心架构与功能协作。
用于提供符合标准的整车UDS与OBD诊断通信、故障事件存储管理以及全系统运行日志与错误追踪服务。
诊断服务集群由 DCM、DEM、DET 及 Dlt 构成,是 AUTOSAR Classic 架构中负责整车诊断通信协议解析、故障事件存储持久化与系统日志追踪的核心组件 [SWS_Dcm_01671]。集群协同处理来自 PduR 的 UDS/OBD 请求,通过 DEM 的消抖与置换算法管理 DTC 及冻结帧,并配合 DET 和 Dlt 提供全方位的异常捕获与动态日志追踪机制 [SWS_Dem_00400]。在运行过程中,各模块严格遵循分阶段初始化、异步数据读取与通道状态联动约束,确保诊断作业在多任务并发下高可靠执行。
诊断服务集群(Diagnostic Services Cluster)是 AUTOSAR Classic Platform 系统服务层的核心枢纽,整合了 DCM、DEM、DET 及 Dlt 四大模块,为整车电子控制单元提供符合 ISO 14229(UDS)和 ISO 15765 规范的协议解析、故障存储、实时日志与错误诊断能力 [SWS_Dcm_01671]、[SWS_Dem_00039]。该集群不仅向上为应用软件组件提供标准的监控与故障事件报告接口,还向下对接 PduR 与 NvM,实现诊断数据的高效通信传输与非易失性持久化存储 DEM S. 247。
在诊断通信流程中,DCM 作为对外交互门户,通过 Dcm_StartOfReception 与 Dcm_TpRxIndication 校验并接收来自 PduR 的诊断请求报文 [SWS_Dcm_00094]、[SWS_Dcm_00111]。随后,DCM 内部的 DSL、DSD 与 DSP 子模块协同将请求分发至应用端口或直接访问 DEM,通过 Dem_GetNextFilteredDTC 与 Dem_GetNextFreezeFrameData 异步遍历故障码及关联冻结帧信息 [SWS_Dem_00215]、[SWS_Dem_00236],并在完成响应发送后通过 Dcm_TxConfirmation 回调释放协议传输资源 [SWS_Dcm_00351]。
架构图: 诊断服务集群内部核心模块与外部基础软件模块的拓扑与接口交互关系。数据来源: Dem S. 247, [SWS_Dcm_00111]。
在系统健康监控与追踪维度,各应用模块通过可重入接口 Dem_SetEventStatus 向 DEM 汇报故障监控结果,DEM 借助基于时间或计数器的消抖算法以及置换机制维护故障存储器 [SWS_Dem_00183]、[SWS_Dem_00400]。与此同时,DET 利用 Det_ReportError 快速捕获开发期错误并执行钩子函数 [SWS_Det_00181],而 Dlt 则借助多通道日志分发与动态过滤策略实现结构化运行轨迹追踪 [SWS_Dlt_00241]、[SWS_Dlt_00740]。
系统架构与诊断模块集群定位
在 AUTOSAR Classic Platform 架构中,诊断服务集群(Diagnostic Services Cluster)位于系统服务层(System Services Layer),是整车电子电气架构与外界交互以及实现系统可观测性与可靠性的核心枢纽。该集群由四个基础软件(BSW)模块构成:诊断通信管理器 [SWS_Dcm_00065](DCM)、诊断事件管理器 [SWS_Dem_00177](DEM)、默认错误追踪器 [SWS_Det_00011](DET)以及诊断日志与追踪模块 [SWS_Dlt_00271](Dlt)。这些模块紧密配合,协同支持 ISO 14229(UDS)统一诊断服务规范与 ISO 15765-2 传输协议,同时向下对接 PDU Router(PduR)与非易失性存储管理器(NvM),向上为应用层软件组件(SW-C)提供标准接口 DEM S. 247。
集群内部各模块分工明确且互相补充:DCM 负责诊断协议栈的会话层与应用层处理,直接对接测试仪(Tester)并解释 UDS 或 OBD 诊断请求 [SWS_Dcm_01671];DEM 作为核心的故障与状态数据库,负责收集、滤波、判定及持久化各类故障事件(Diagnostic Event)与故障码(DTC),并维护冻结帧和扩展数据 [SWS_Dem_00039];DET 专用于在开发与集成阶段捕获软件模块的断言失败、开发错误及运行时异常 [SWS_Det_00009];Dlt 则建立起结构化的日志与总线追踪通道,允许在不同的日志级别和网络通道下灵活输出运行轨迹信息 [SWS_Dlt_00241]。
架构图: 诊断服务集群内部核心模块与外部基础软件模块的拓扑与接口交互关系。数据来源: Dem S. 247, [SWS_Dcm_00111]。
跨模块交互路径与数据流机制
诊断报文的端到端处理构成了 DCM 与下层总线及 DEM 之间的主交互链条。当下层传输层通过 PduR 接收到新的诊断请求时,首先调用 Dcm_StartOfReception 为接收分配并校验诊断缓冲区 [SWS_Dcm_00094];若请求的数据长度超出可用缓冲区,DCM 将返回 BUFREQ_E_OVFL 予以拒绝 [SWS_Dcm_00444]。在接收完成并获得 Dcm_TpRxIndication 的成功指示后,诊断会话层(DSL)将报文无缝转交给诊断服务分发器(DSD)与诊断服务处理子模块(DSP) [SWS_Dcm_00111]。若诊断请求涉及读取故障信息(如 UDS 服务 0x19 或 OBD 服务 0x03),DCM 会通过专用内部接口向 DEM 发起查询,例如调用 Dem_GetNextFilteredDTC 遍历故障码,或调用 Dem_GetNextFreezeFrameData 提取对应故障的冻结帧详细数据 [SWS_Dem_00215]、[SWS_Dem_00236]。
对于读写数据标识符(DID)或内存寻址类服务,DCM 既可以通过端口调用应用层接口(如 Xxx_ReadData 或 Xxx_WriteData) [SWS_Dcm_00793]、[SWS_Dcm_00794],也可以通过 Dcm_ReadMemory 和 Dcm_WriteMemory 访问底层存储空间 [SWS_Dcm_00539]、[SWS_Dcm_00540]。在底层异步操作执行期间,DCM 支持响应暂挂机制(Response Pending, NRC 0x78),并在传输确认回调 Dcm_TxConfirmation 触发后及时解锁发送缓冲区并释放协议通道资源 [SWS_Dcm_00351]。
时序图: 诊断测试仪通过 PduR、DCM 与 DEM 读取故障码和冻结帧数据的交互流程。数据来源: Dem S. 370, [SWS_Dem_00215], [SWS_Dem_00236]。
同步机制、重入性与任务调度上下文
诊断集群中的 API 设计严格区分了调用上下文、可重入性(Reentrancy)与执行同步模式。监控器或软件组件频繁调用的事件状态上报函数 Dem_SetEventStatus 以及去抖状态复位函数 Dem_ResetEventDebounceStatus 具备对不同 EventId 可重入但对相同 EventId 不可重入的特性,确保了跨多核与多任务并发上报时的线程安全性 [SWS_Dem_00183]、[SWS_Dem_00683]。相比之下,面向外部通信与大容量数据处理的接口(如 Dem_GetNextFilteredDTC 和 Dem_GetNextFreezeFrameData)采用异步执行模式,通过返回 DEM_PENDING 状态让调用方分片轮询,避免在单次调度周期内长时间阻塞系统主任务 [SWS_Dem_00215]、[SWS_Dem_00236]。
在操作系统调度层面,各模块依赖周期性调度的 MainFunction 处理繁重的状态转移与异步队列操作。诸如 Dcm_TpRxIndication 等底层接口可能直接由中断上下文触发,因而仅执行简单的状态标记与入队动作,实际的诊断协议解析、安全等级变更以及大块内存操作均延迟在任务级上下文中完成 [SWS_Dcm_00093]。DET 提供的错误报告接口 Det_ReportError 则具备完全的可重入性,允许所有 BSW 模块与应用软件在任意中断或任务上下文中同步记录异常并执行预设的错误钩子函数 <User_Error_Hooks> [SWS_Det_00181]。
典型生命周期与运行模式协同
诊断集群各模块的生命周期与通信管理模块(ComM)以及 ECU 状态管理器(EcuM)的运行模式保持严密的联动。在系统启动早期阶段,DEM 依赖 Dem_PreInit 完成基础去抖与事件缓存初始化,待操作系统和 NvM 准备就绪后再由 EcuM 调用 Dem_Init [SWS_Dem_00438]、[SWS_Dem_00181]。类似地,DET 通过 Det_Start 较早启动以具备全局检错能力 [SWS_Det_00010];而 Dlt 由于需利用 NvM 恢复持久化的过滤配置,通常被安排在启动阶段偏晚的节点调用 Dlt_Init 进行初始化 [SWS_Dlt_00239]、[SWS_Dlt_00453]。
在网络运行模式切换期间,ComM 负责向 DCM 广播通道状态变更通知:当通道切入 COMM_FULL_COMMUNICATION 时,DCM 启用常规诊断收发及周期性传输机制(ROE) [SWS_Dcm_00360];切入 COMM_SILENT_COMMUNICATION 时,DCM 抑制发送但保留静默监听 [SWS_Dcm_00358];切入 COMM_NO_COMMUNICATION 时,DCM 则完全禁止该通道的诊断传输 [SWS_Dcm_00356]。在诊断会话控制中,除超时自动回退外,应用层也可通过 Dcm_ResetToDefaultSession 主动重置至默认会话(例如检测到车辆超速时关闭扩展诊断功能) [SWS_Dcm_00520];在系统关机前,EcuM 将触发 Dem_Shutdown,确保易失性故障状态与统计数据安全回写至非易失性存储块 [SWS_Dem_00182]。
故障消抖、存储置换与DET/Dlt跟踪降级
故障从感知到最终存储经历严格的消抖滤波与存储管理。DEM 支持基于计数器或基于时间的消抖算法,通过将内部消抖计时器线性映射至 UDS 定义的故障检测计数器(FDC, -128 到 +127),实现事件从未确认到已确认的平滑判定 [SWS_Dem_00427]、[SWS_Dem_00203]。在此过程中,系统可通过使能条件 Dem_SetEnableCondition 或存储条件 Dem_SetStorageCondition 临时挂起特定事件的处理(例如在欠压或特定工况下抑制误报) [SWS_Dem_00201]、[SWS_Dem_00556]。当故障存储空间饱和且新故障发生时,DEM 触发事件置换算法(Displacement),根据配置参数 DemEventDisplacementStrategy 与事件优先级筛选最不重要的陈旧记录予以覆盖 [SWS_Dem_00400]、[SWS_Dem_00401]。
针对运行时异常追踪与生产线调试,DET 与 Dlt 构成了互补的双轨追踪体系。BSW 模块发生严重逻辑缺陷时立即向 DET 报告,并通过预配置的钩子触发断点或故障计数 [SWS_Det_00180]。而对于应用业务的调试与黑盒分析,Dlt 支持通过 Dlt_SendLogMessage 发送携带丰富等级标签(如 FATAL、ERROR、WARN、INFO)的格式化日志 [SWS_Dlt_00241]、[SWS_Dlt_00230]。推测:为了防止大量日志在总线负载过高时引起网络拥堵,系统可能在运行时通过 Dlt_SetDefaultLogLevel 或 Dlt_SetMessageFiltering 动态提升过滤阈值,从而对调试流量实施降级限流 [SWS_Dlt_00740]、[SWS_Dlt_00770],并在调测完成后调用 Dlt_StoreConfiguration 将更新的过滤规则持久化至 NvM [SWS_Dlt_00736]。 问题 (未决)
本指南由 autodocs 依据 AUTOSAR Classic Platform R20-11 诊断服务集群规范生成,涵盖 DCM、DEM、DET 及 Dlt 模块的架构定位、通信协同、任务调度与故障诊断策略。
Module im Cluster
Debugging (Dbg)
AUTOSAR Classic System Services-Modul Debugging (Dbg, Spezifikation: AUTOSAR_SWS_Debugging.pdf).
Diagnostic Communication Manager (DCM)
The DCM implements unified diagnostic services according to ISO 14229-1 (UDS) and ISO 15765-4 (OBD). It manages diagnostic sessions, security levels, and service routing.
Diagnostic Event Manager (DEM)
The DEM is responsible for processing and storing diagnostic events, fault memories, DTC statuses, and associated freeze frame data.
Default Error Tracer (DET)
The DET handles development errors, runtime errors, and transient faults across all BSW modules and SW-Cs.
Diagnostic Log and Trace (DLT)
The DLT module collects log messages and trace points and formats them into standardized DLT frames for external tooling.
Function Inhibition Manager (FiM)
AUTOSAR Classic System Services-Modul Function Inhibition Manager (FiM, Spezifikation: AUTOSAR_CP_SWS_FunctionInhibitionManager.pdf, AUTOSAR_SWS_FIM.pdf, AUTOSAR_SWS_FunctionInhibitionManager.pdf).
gemini-3.8-flash-low· 2026-10-13 · 德文原文