Diagnostic Log and Trace (DLT)
The DLT module collects log messages and trace points and formats them into standardized DLT frames for external tooling.
Funktionen — Übersicht
void Dlt_Init (const Dlt_ConfigType* config);Dlt is using the NVRam Manager and is to be initialized very late in the ECU startup phase.void Dlt_GetVersionInfo (Std_VersionInfoType* versioninfo);Returns the version information of this module.Std_ReturnType Dlt_SendTraceMessage (Dlt_SessionIDType sessionId, const Dlt_MessageTraceInfoType* traceInfo, const uint8* traceData, uint16 traceDataLength);The service represents the interface to be used by basic software modules or by software components to trace parameters.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 component to send Log Messages.Std_ReturnType Dlt_UnregisterContext (Dlt_SessionIDType sessionId, Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId);The service has to be called when a software module is going to be stopped.void Dlt_DetForwardErrorTrace (uint16 moduleId, uint8 instanceId, uint8 apiId, uint8 errorId);Service to fo rward error reports from Det to Dlt.Std_ReturnType Dlt_SetLogLevel (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, Dlt_MessageLogLevelType newLogLevel);This service is used to change the Log Level for the given tuple of Application ID/ Context ID.Std_ReturnType Dlt_SetTraceStatus (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, boolean newTraceStatus);The service Dlt_ Set Trace Status sets the trace status for a specific tuple of Application ID and Context ID.Std_ReturnType Dlt_GetLogInfo (uint8 options, Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, uint8* status, Dlt_LogInfoType* logInfo);Called to request information about registered Application Ids, their Context Ids and the corresponding log level.Std_ReturnType Dlt_GetDefaultLogLevel (Dlt_MessageLogLevelType* defaultLogLevel);Returns the Default Log Level currently used by the Dlt module.Std_ReturnType Dlt_StoreConfiguration (void);Copies the current Dlt configuration to Nv RAM by calling Nv M_ Write Block().Std_ReturnType Dlt_ResetToFactoryDefault (void);The service Dlt_ Reset To Factory Default sets the Log Level and Trace Status back to the pers istently stored default values.Std_ReturnType Dlt_SetMessageFiltering (boolean status);Switches on/ off the mes sage filtering functionality of the Dlt module.Std_ReturnType Dlt_SetDefaultLogLevel (Dlt_MessageLogLevelType newLogLevel);Called to modify the pass through range for Log Messages for all not explicit set Context Ids.Std_ReturnType Dlt_GetTraceStatus (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, boolean* traceStatus);Returns the current Trace Status for a given tuple Application Id/ Context Id.void Dlt_RxIndication (PduIdType RxPduId, const PduInfoType* PduInfoPtr);Indication of a received PDU from a lower layer communication interface module.Std_ReturnType Dlt_TriggerTransmit (PduIdType TxPduId, PduInfoType* PduInfoPtr);Within this API , the upper layer module (called module) shall check whether the available data fits into the buffer size...void Dlt_TxConfirmation (PduIdType TxPduId, Std_ReturnType result);The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.void Dlt_TpTxConfirmation (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...BufReq_ReturnType Dlt_CopyTxData (PduIdType id, const PduInfoType* info, const RetryInfoType* retry, PduLengthType* availableDataPtr);Service Dlt_CopyTxData.BufReq_ReturnType Dlt_StartOf Dlt_StartReception (PduIdType id, const PduInfoType* info, PduLengthType TpSduLength, PduLengthType* bufferSizePtr); ⚠️This function is called at the start of receiving an N -void Dlt_TpRxIndication (PduIdType id, Std_ReturnType result);Called after an I - PDU has been received via the TP API, the result indicates whether the transmission was successful or not.BufReq_ReturnType Dlt_CopyRxData (PduIdType id, const PduInfoType* info, PduLengthType* bufferSizePtr);Service Dlt_CopyRxData.void Dlt_TxFunction (void);-
Typen — Übersicht
struct Dlt_ConfigTypeThis is the type of the data structure containing the initialization data for Dlt.Dlt_MessageTypeThis type describes the type of the message.Dlt_MessageIDTypeContains the unique Message Id for a message.Dlt_MessageNetworkTraceInfoTypeThis type describes transported type of a Dlt BUSMESSAGE.Dlt_ApplicationIDTypeThis type describes the Application Id.Dlt_ContextIDTypeThis type describes the Context Id.Dlt_SessionIDTypeThis type identifies the session.Dlt_LogInfoType-Dlt_ContextIdInfoTypeContext InformationDlt_ApplicationIdInfoTypeInformation about ApplicationsDlt_MessageOptionsTypeBitfieldDlt_MessageLogInfoType-Dlt_MessageLogLevelTypeThis type describes the log lev el for each log message.Dlt_MessageTraceTypeThis type describes labels for trace messages.Dlt_MessageArgumentCountThis type describes the count of arguments provided to a message.Dlt_MessageTraceInfoType-TypeThis type describes the Log Channel name.Dlt_AssignmentOperationAdding or removing a Log Channel assignment for the given tuple of Application Id/ Context Id.
Funktionen & Typen — Detailansicht
函数 Dlt_Init [SWS_Dlt_00239] 📄 PDF
void Dlt_Init (const Dlt_ConfigType* config);
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.
同步且不可重入的函数Dlt_Init(服务ID 0x01,可通过头文件Dlt.h获取)初始化Classic平台中的Diagnostic Log and Trace(DLT)模块[SWS_Dlt_00239]。它通过参数config接收一个指向类型为Dlt_ConfigType的模块特定配置结构的指针,且不返回任何返回值[SWS_Dlt_00239]。
对于调用上下文以及与其他BSW模块的时间协同,适用特定的边界条件:
- 初始化顺序:DLT模块使用NVRam Manager,必须在ECU启动阶段的极晚期进行初始化[SWS_Dlt_00239]。函数
Dlt_Init的调用必须强制在NVRam Manager完全初始化之后进行[SWS_Dlt_00239]。 - 持久性数据:当配置参数
DltGeneralNvRAMSupport设置为TRUE时,DLT模块在Dlt_Init中使用NVRAM-Manager的接口NvM_ReadBlock来恢复所需变量的持久值[SWS_Dlt_00453]。 - 缓冲区处理:一旦模块通过
Dlt_Init初始化且可选定时器DltGeneralStartUpDelayTimer超时,所有在此期间缓冲的日志和跟踪数据都将被处理并按规范发送[SWS_Dlt_00005]。
由于该函数被指定为不可重入,因此调用上下文必须确保在执行期间不会并行或以中断方式重新进入Dlt_Init[SWS_Dlt_00239]。
该文本由AI系统基于AUTOSAR R20-11规范生成。
实现者指南即将推出(复杂度 I1)
函数 Dlt_GetVersionInfo [SWS_Dlt_00271] 📄 PDF
void Dlt_GetVersionInfo (Std_VersionInfoType* versioninfo);
Returns the version information of this module.
函数 Dlt_SendTraceMessage [SWS_Dlt_00243] 📄 PDF
Std_ReturnType Dlt_SendTraceMessage (Dlt_SessionIDType sessionId, const Dlt_MessageTraceInfoType* traceInfo, const uint8* traceData, uint16 traceDataLength);
The service represents the interface to be used by basic software modules or by software components to trace parameters.
同步且可重入的函数 Dlt_SendTraceMessage 用于基础软件模块(BSW)以及软件组件(SW-C)向 Dlt 模块传输跟踪参数 [SWS_Dlt_00243]。
参数与调用上下文
调用时,通过 sessionId 传递模块或端口标识符,通过 traceInfo 传递用于消息过滤的元数据,并通过 traceData 传递有效数据缓冲区连同长度规范 traceDataLength [SWS_Dlt_00243]。即使 Dlt 尚未初始化,该模块也可以预先缓冲跟踪消息 [SWS_Dlt_00003]。
返回值与错误处理
该服务通过特定返回值指示状态 [SWS_Dlt_00243]:
E_OK:操作已成功执行。DLT_E_MSG_TOO_LARGE:消息超出了所有已分配日志通道的允许大小。DLT_E_NO_BUFFER:缓冲区空间不足;消息无法针对至少一个日志通道进行暂存。DLT_E_UNKNOWN_SESSION_ID:传递的sessionId对模块未知。
与 Hook 函数的交互
由于 Dlt_SendTraceMessage 被指定为用于 SW-C 的接口,因此对于生成的 Hook 函数存在等效的内部实现 [SWS_Dlt_00285],该实现以非详细模式(Non-Verbose 模式)发送跟踪消息 [SWS_Dlt_00277]。
本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。
实现者指南即将推出(复杂度 I1)
函数 Dlt_SendLogMessage [SWS_Dlt_00241] 📄 PDF
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 component to send Log Messages.
同步且可重入的函数 Dlt_SendLogMessage(服务 ID 0x03)用作基础软件模块(BSW)以及软件组件(SW-C)发送日志消息的标准化接口 [SWS_Dlt_00241]。该调用通过头文件 Dlt.h 进行,并且由于具有可重入性,该函数设计用于并发场景 [SWS_Dlt_00241]。
调用该函数时需要四个输入参数,且不使用任何输出参数 [SWS_Dlt_00241]:
sessionId:代表会话标识符。对于 SW-C,该参数作为端口相关参数值不可见,而 BSW 模块则直接传递其模块编号。logInfo:指向常量结构的指针,该结构包含用于过滤日志消息的相关元数据。logData:指向待记录数据字节数组的指针,该数组构成消息的实际有效负载(Payload)。logDataLength:数据缓冲区的数值长度logData。
错误处理直接通过类型为 Std_ReturnType 的返回值进行,该返回值指示操作成功或特定错误状态 [SWS_Dlt_00241]:
DLT_OK:日志消息已被成功接收并处理。DLT_E_MSG_TOO_LARGE:消息超出了所有已分配日志通道的最大允许缓冲区大小。DLT_E_NO_BUFFER:消息无法在任何已分配的日志通道上进行暂存。DLT_E_UNKNOWN_SESSION_ID:传递的会话 ID 无效或对模块未知。
本使用提示由 AI 基于 AUTOSAR 规范生成。
函数 Dlt_UnregisterContext [SWS_Dlt_00769] 📄 PDF
Std_ReturnType Dlt_UnregisterContext (Dlt_SessionIDType sessionId, Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId);
The service has to be called when a software module is going to be stopped. Available vi a Dlt.h
使用
同步函数 Dlt_UnregisterContext(服务 ID 0x16)通过头文件 Dlt.h 提供,且必须在停止软件模块时调用 [SWS_Dlt_00769]。它用于注销应用程序先前注册的上下文。
该函数需要三个输入参数 [SWS_Dlt_00769]:
sessionId:模块编号;对应于 BSW 内部的模块 ID 或软件组件(SW-C)内特定于端口定义的实参值 [SWS_Dlt_00769]。appId:上级应用程序的标识符(Application ID)[SWS_Dlt_00769]。contextId:要注销的上下文的标识符(Context ID)[SWS_Dlt_00769]。
返回值与错误处理
类型为 Std_ReturnType 的返回值提供有关执行结果的信息 [SWS_Dlt_00769]:
E_OK:请求的操作已成功完成 [SWS_Dlt_00769]。DLT_E_CONTEXT_NOT_YET_REG:该软件模块的上下文事先未注册 [SWS_Dlt_00769]。DLT_E_UNKNOWN_SESSION_ID:传入的会话 ID 未知 [SWS_Dlt_00769]。
并发性与限制
该函数被指定为可重入的,且表现为同步 [SWS_Dlt_00769]。调用模块必须确保传入的会话 ID 有效,并且上下文在终止之前确实已注册,以避免注销时出错 [SWS_Dlt_00769]。
此使用说明基于 AUTOSAR CP R20-11 规范自动生成。
函数 Dlt_DetForwardErrorTrace [SWS_Dlt_00432] 📄 PDF
void Dlt_DetForwardErrorTrace (uint16 moduleId, uint8 instanceId, uint8 apiId, uint8 errorId);
Service to fo rward error reports from Det to Dlt.
用法与调用上下文
具有服务 ID 0x07 的同步接口 Dlt_DetForwardErrorTrace 用于将来自 Default Error Tracer (DET) 的已报告开发错误转发到 Dlt 模块 [SWS_Dlt_00432]。Dlt 模块提供此服务,以确保 DET 针对错误报告所要求的扇出能力 [SWS_Dlt_00430]。此 C 函数的声明通过头文件 Dlt_Det.h 包含 [SWS_Dlt_00432]。
参数与接口规范
该函数接收四个必选输入参数,既未定义返回值也未定义输出参数 [SWS_Dlt_00432]:
moduleId:发生错误的调用方软件模块的模块 ID。instanceId:基于索引的模块实例的标识符(计数从 0 开始;单实例模块传递 0)。apiId:受影响 API 服务的标识符(在调用模块的规范中定义)。errorId:检测到的开发错误的标识符(在调用模块的规范中定义)。
并发与错误处理
执行与调用方错误记录同步进行。作为非可重入函数 (Non Reentrant),该接口强制要求调用方避免并发执行 [SWS_Dlt_00432]。规范中未为该服务规定特定的错误代码、错误反馈或单独的 DET 或 DEM 报告 [SWS_Dlt_00432]。
此使用说明基于 AUTOSAR CP R20-11 规范自动生成。
实现者指南即将推出(复杂度 I1)
函数 Dlt_SetLogLevel [SWS_Dlt_00252] 📄 PDF
Std_ReturnType Dlt_SetLogLevel (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, Dlt_MessageLogLevelType newLogLevel);
This service is used to change the Log Level for the given tuple of Application ID/ Context ID.
函数 Dlt_SetTraceStatus [SWS_Dlt_00254] 📄 PDF
Std_ReturnType Dlt_SetTraceStatus (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, boolean newTraceStatus);
The service Dlt_ Set Trace Status sets the trace status for a specific tuple of Application ID and Context ID.
同步函数 Dlt_SetTraceStatus 用于为特定的 Application-ID 和 Context-ID 元组设置跟踪状态 [SWS_Dlt_00254]。它通过头文件 Dlt.h 定义,且其 Service-ID 为 0x09 [SWS_Dlt_00254]。
使用
调用该函数需要三个输入参数 [SWS_Dlt_00254]:
appId:软件组件的 ID(类型为Dlt_ApplicationIDType)。contextId:上下文的 ID(类型为Dlt_ContextIDType)。newTraceStatus:要新设置的跟踪状态,表现为布尔值(类型为boolean)。
错误处理与返回值
该函数同步返回一个类型为 Std_ReturnType 的状态 [SWS_Dlt_00254]:
E_OK:未发生错误,且状态已成功应用。E_NOT_OK:无法更改跟踪状态。函数规范中未指明具体的 DET 错误消息(解释:若出现标识符无效或模块状态错误,推测可能导致出错)。 问题 Q-77e190707462c8f1 (未决)
并发性与限制
该接口被指定为不可重入(Non Reentrant)[SWS_Dlt_00254]。因此,未经调用方适当同步,不得对其进行并发或中断式执行。
此使用说明是基于 AUTOSAR Release R20-11 自动生成的。
实现者指南即将推出(复杂度 I1)
函数 Dlt_GetLogInfo [SWS_Dlt_00732] 📄 PDF
Std_ReturnType Dlt_GetLogInfo (uint8 options, Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, uint8* status, Dlt_LogInfoType* logInfo);
Called to request information about registered Application Ids, their Context Ids and the corresponding log level.
函数 Dlt_GetDefaultLogLevel [SWS_Dlt_00733] 📄 PDF
Std_ReturnType Dlt_GetDefaultLogLevel (Dlt_MessageLogLevelType* defaultLogLevel);
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.
函数 Dlt_StoreConfiguration [SWS_Dlt_00736] 📄 PDF
Std_ReturnType Dlt_StoreConfiguration (void);
Copies the current Dlt configuration to Nv RAM by calling Nv M_ Write Block().
使用
函数 Dlt_StoreConfiguration([SWS_Dlt_00736])用于将当前 Dlt 配置保存到非易失性存储器(NvRAM)中。存储操作在内部通过同步调用 NVRAM 管理器([SWS_Dlt_00736])的接口 NvM_WriteBlock() 进行。该 API 通过头文件 Dlt.h 提供,其 Service-ID 为 0x1a。
该函数的签名形式为 Std_ReturnType Dlt_StoreConfiguration(void),不处理输入、输出或输入/输出参数([SWS_Dlt_00736])。
错误处理与返回值
作为同步服务,该函数直接向调用方返回一个类型为 Std_ReturnType 的状态码([SWS_Dlt_00736]):
E_OK:配置已无差错地传递至 NvRAM([SWS_Dlt_00736])。E_NOT_OK:保存 Dlt 配置时发生错误([SWS_Dlt_00736])。DLT_E_NOT_SUPPORTED:模块不支持用于保存配置的服务([SWS_Dlt_00736])。
并发性与限制
根据 [SWS_Dlt_00736],Dlt_StoreConfiguration 被指定为不可重入(Non Reentrant)。因此,该函数不得从不同任务或上下文中并发执行,调用方必须确保顺序执行。
该使用说明基于 AUTOSAR 规范自动生成。
函数 Dlt_ResetToFactoryDefault [SWS_Dlt_00739] 📄 PDF
Std_ReturnType Dlt_ResetToFactoryDefault (void);
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.
使用
同步函数 Dlt_ResetToFactoryDefault 通过头文件 Dlt.h 提供,并且不接受任何传入参数 [SWS_Dlt_00739]。其主要目的是重置 Dlt 运行时配置:它将日志级别以及跟踪状态重置为持久化存储的默认值 [SWS_Dlt_00739]。若 Dlt 模块中还激活了 NvRAM 支持,则该调用会彻底删除 NvM 中存储的所有 Dlt 值 [SWS_Dlt_00739]。
返回值与错误处理
操作结果通过类型为 Std_ReturnType 的返回值同步指示 [SWS_Dlt_00739]:
E_OK:配置已成功重置为默认值 [SWS_Dlt_00739]。E_NOT_OK:重置配置失败 [SWS_Dlt_00739]。
在当前的规范范围内,未为该服务定义具体的 DET 或 DEM 错误消息。
并发性与限制
该函数被指定为不可重入(Non Reentrant)(Service-ID 0x06)[SWS_Dlt_00739]。因此,禁止从不同的任务或上下文中进行并发或中断式调用,必须由调用方予以防止。
此使用说明完全基于 AUTOSAR Classic Release R20-11 的规范数据。
实现者指南即将推出(复杂度 I1)
函数 Dlt_SetMessageFiltering [SWS_Dlt_00770] 📄 PDF
Std_ReturnType Dlt_SetMessageFiltering (boolean status);
Switches on/ off the mes sage filtering functionality of the Dlt module.
函数 Dlt_SetDefaultLogLevel [SWS_Dlt_00740] 📄 PDF
Std_ReturnType Dlt_SetDefaultLogLevel (Dlt_MessageLogLevelType newLogLevel);
Called to modify the pass through range for Log Messages for all not explicit set Context Ids.
函数 Dlt_GetTraceStatus [SWS_Dlt_00750] 📄 PDF
Std_ReturnType Dlt_GetTraceStatus (Dlt_ApplicationIDType appId, Dlt_ContextIDType contextId, boolean* traceStatus);
Returns the current Trace Status for a given tuple Application Id/ Context Id.
函数 Dlt_RxIndication [SWS_Dlt_00272] 📄 PDF
void Dlt_RxIndication (PduIdType RxPduId, const PduInfoType* PduInfoPtr);
Indication of a received PDU from a lower layer communication interface module.
函数 Dlt_RxIndication 用于将来自下层通信接口模块的已接收 PDU 指示给 DLT 模块 [SWS_Dlt_00272]。它可通过头文件 Dlt.h 获取,并具有服务 ID 0x42 [SWS_Dlt_00272]。
调用采用同步语义进行,且不提供返回值 (void) [SWS_Dlt_00272]。向该函数传递两个输入参数:
RxPduId:已接收 PDU 的标识符(类型为PduIdType)[SWS_Dlt_00272]。PduInfoPtr:指向类型为PduInfoType的结构的指针。该结构包含已接收 PDU 的长度 (SduLength)、指向包含 PDU 有效负载数据的缓冲区的指针 (SduDataPtr) 以及 PDU 的关联元数据 [SWS_Dlt_00272]。
在并发性和执行上下文方面,该函数对于不同的 PDU-ID 是可重入的,但对于相同的 PDU-ID 是不可重入的 [SWS_Dlt_00272]。因此,调用的下层模块不得并发处理相同的 RxPduId,而允许使用不同 PDU-ID 进行并行调用 [SWS_Dlt_00272]。
本文本由 AI 基于规范生成。
函数 Dlt_TriggerTransmit [SWS_Dlt_00754] 📄 PDF
Std_ReturnType Dlt_TriggerTransmit (PduIdType TxPduId, PduInfoType* PduInfoPtr);
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.
同步函数 Dlt_TriggerTransmit 根据 [SWS_Dlt_00754] 用于在下层请求时将 SDU 数据复制到提供的缓冲区中。它在 Dlt.h 中声明,服务 ID 为 0x41。
调用时传入以下参数:
TxPduId:请求传输的 SDU 的标识符。PduInfoPtr:指向PduInfoType类型结构的指针。调用者通过SduDataPtr传递目标缓冲区,并通过SduLength传递最大可用缓冲区大小。
在函数内部,模块根据 [SWS_Dlt_00754] 检查可用数据是否适合传入的缓冲区大小:
- 如果数据适合,函数将有效负载数据复制到
SduDataPtr中,使用实际复制的字节数更新SduLength,并返回E_OK。 - 如果缓冲区不足,函数返回
E_NOT_OK,且不修改PduInfoPtr。
若返回 E_NOT_OK,则未复制任何 SDU 数据。在这种情况下,调用者不得继续使用 PduInfoPtr,因为它可能指向无效数据或是 NULL 指针 [SWS_Dlt_00754]。
在并发性方面,Dlt_TriggerTransmit 对于不同的 PDU ID 是可重入的,但对于相同的 TxPduId 是不可重入的 [SWS_Dlt_00754]。
本文本由自动生成。所有陈述均基于所引用的 AUTOSAR 规范。
实现者指南即将推出(复杂度 I1)
函数 Dlt_TxConfirmation [SWS_Dlt_00273] 📄 PDF
void Dlt_TxConfirmation (PduIdType TxPduId, Std_ReturnType result);
The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.
用法与调用上下文
函数 Dlt_TxConfirmation 用作底层通信接口模块(lower layer communication interface module)向 Diagnostic Log and Trace (DLT) 模块报告的确认接口 [SWS_Dlt_00273]。它同步通知 DLT 模块先前请求的 PDU 是否已成功传输,或者传输是否失败 [SWS_Dlt_00273]。该函数的 Service-ID 为 0x40,并通过头文件 Dlt.h 提供 [SWS_Dlt_00273]。
该接口没有返回值(void),并需要两个传入参数 [SWS_Dlt_00273]:
TxPduId:所传输 PDU 的标识符,类型为PduIdType。result:传输状态,类型为Std_ReturnType;其中E_OK表示传输成功,E_NOT_OK表示 PDU 传输失败。
错误处理与并发
该调用未规定包含错误返回值或特定 DET/DEM 消息的显式错误处理;发送过程的失败纯粹通过参数值 result = E_NOT_OK 传递给 DLT 模块 [SWS_Dlt_00273]。
其执行适用有区分的重入条件:Dlt_TxConfirmation 针对不同的 PDU-ID 是可重入的,但针对相同的 PDU-ID 是不可重入的 [SWS_Dlt_00273]。因此,调用驱动程序或接口必须确保排除使用相同 TxPduId 进行的并发调用,而不同 PDU 的确认则允许并发到达。
此使用说明基于 AUTOSAR CP R20-11 规范自动生成。
实现者指南即将推出(复杂度 I1)
函数 Dlt_TpTxConfirmation [SWS_Dlt_00756] 📄 PDF
void Dlt_TpTxConfirmation (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.
函数 Dlt_TpTxConfirmation 用作 Dlt 模块在发送传输 I-PDU 后的同步确认函数 [SWS_Dlt_00756]。它可通过头文件 Dlt.h 获取,服务 ID 为 0x48 [SWS_Dlt_00756]。
用法与语义
该调用在 I-PDU 于相应网络上传输后进行 [SWS_Dlt_00756]。该函数的签名为 void Dlt_TpTxConfirmation (PduIdType id, Std_ReturnType result),且不返回任何返回值 [SWS_Dlt_00756]:
id(输入参数,类型PduIdType):所传输 I-PDU 的唯一标识 [SWS_Dlt_00756]。result(输入参数,类型Std_ReturnType):指示传输状态,并表明 I-PDU 的发送是成功还是失败 [SWS_Dlt_00756]。
并发与错误处理
规范将 Dlt_TpTxConfirmation 标识为同步且可重入(Reentrant)[SWS_Dlt_00756]。尚未为该服务定义特定的 DET 或 DEM 错误代码;关于发送过程的错误处理基于对参数 result 的评估 [SWS_Dlt_00756]。在系统上下文中,该调用通常应由下层传输层在 PDU 传输完成后发起。 问题 Q-0e5ab7c285316701 (未决)
该文本由AI系统基于AUTOSAR R20-11规范生成。
实现者指南即将推出(复杂度 I1)
函数 Dlt_CopyTxData [SWS_Dlt_00516] 📄 PDF
BufReq_ReturnType Dlt_CopyTxData (PduIdType id, const PduInfoType* info, const RetryInfoType* retry, PduLengthType* availableDataPtr);
Service Dlt_CopyTxData.
用法与语义
同步且可重入的函数 Dlt_CopyTxData 用于从 Dlt 模块检索 I-PDU 段 (N-PDU) 的发送数据 [SWS_Dlt_00516]。通过 id 指定要发送的 I-PDU,而 info 提供目标缓冲区 (SduDataPtr) 以及所需的字节长度 (SduLength) [SWS_Dlt_00516]。传递 SduLength = 0(其中 SduDataPtr 允许作为 NULL_PTR 传递)允许通过 retry 传输纯状态变更,或查询发送缓冲区中的剩余数据量 [SWS_Dlt_00516]。通过输出参数 availableDataPtr,该函数返回 Tx 缓冲区中仍然可用的数据量,这例如允许具有动态有效负载长度的 TP 模块(如 FrIsoTp)对后续段进行尺寸确定 [SWS_Dlt_00516]。
确认与错误恢复
通过指针 retry 控制确认或重复传输 [SWS_Dlt_00516]:
- 如果
retry为NULL_PTR,则允许在复制过程之后立即从缓冲区中丢弃已复制的数据 [SWS_Dlt_00516]。 - 如果
TpDataState指示值TP_CONFPENDING,则先前复制的数据必须保留在缓冲区中,以便进行可能的错误恢复 [SWS_Dlt_00516]。 - 在
TP_DATACONF的情况下,在调用之前传输的所有数据均视为已确认并可被释放 [SWS_Dlt_00516]。 - 在
TP_DATARETRY的情况下,模块从TxTpDataCnt中传递的字节偏移量处重新开始复制 [SWS_Dlt_00516]。
返回值与边界条件
请求的结果报告为 BufReq_ReturnType [SWS_Dlt_00516]:
BUFREQ_OK:数据已按要求完全复制到目标缓冲区 [SWS_Dlt_00516]。BUFREQ_E_BUSY:所需的数据量不可用;未复制任何数据,允许稍后重试 [SWS_Dlt_00516]。BUFREQ_E_NOT_OK:请求失败;未复制任何数据 [SWS_Dlt_00516]。
该接口可通过 Dlt.h 获取,并设计为可重入的 [SWS_Dlt_00516]。调用上下文通常可能位于分段传输期间的下层传输协议模块中。 问题 Q-a81c439e73e0acc0 (未决)
此使用说明基于 AUTOSAR Classic R20-11 规范自动生成。
实现者指南即将推出(复杂度 I1)
函数 Dlt_StartReception [SWS_Dlt_91006] 📄 PDF
BufReq_ReturnType Dlt_StartOfReception (PduIdType id, const PduInfoType* info, PduLengthType TpSduLength, PduLengthType* bufferSizePtr);
This function is called at the start of receiving an N -
同步且可重入的函数 Dlt_StartReception 在开始接收 N-SDU 时被调用,N-SDU 可以作为单帧(SF)接收,也可以分段通过多个 N-PDU 接收 [SWS_Dlt_91006]。它用于在 Dlt 模块中启动传输连接并提供可用的接收缓冲区 [SWS_Dlt_91006]。
通过参数 id 标识接收到的 I-PDU,而 info 传输首帧的有效负载数据和元数据,或者在既无数据也无元数据的情况下设置为 NULL_PTR [SWS_Dlt_91006]。通过 TpSduLength 传递 N-SDU 的总长度;如果以长度 0 调用该函数,它将通过 bufferSizePtr 返回当前最大可用缓冲区大小 [SWS_Dlt_91006]。传输协议使用 bufferSizePtr 中的值来计算块大小(BS)[SWS_Dlt_91006]。
若连接被接受,函数返回 BUFREQ_OK;若没有足够的缓冲区可用于所请求的大小,bufferSizePtr 则指示缓冲区大小为 0 以继续接收 [SWS_Dlt_91006]。在连接被拒绝时,BUFREQ_E_NOT_OK 中止接收,而在总内存不足时,将报告 BUFREQ_E_OVFL;在这两种错误情况下,bufferSizePtr 保持不变 [SWS_Dlt_91006]。
本使用说明基于 AUTOSAR Classic R20-11 规范。
实现者指南即将推出(复杂度 I1)
函数 Dlt_TpRxIndication [SWS_Dlt_91007] 📄 PDF
void Dlt_TpRxIndication (PduIdType id, Std_ReturnType result);
Called after an I - PDU has been received via the TP API, the result indicates whether the transmission was successful or not.
函数 Dlt_TpRxIndication 用作通过 TP-API 接收到 I-PDU 后的同步接收指示 [SWS_Dlt_91007]。它在头文件 Dlt.h 中声明,服务 ID 为 0x45 [SWS_Dlt_91007]。
用法与参数
向 DLT 模块的传递通过两个输入参数进行,该函数不返回任何返回值 [SWS_Dlt_91007]:
id(类型PduIdType):标识接收到的 I-PDU [SWS_Dlt_91007]。result(类型Std_ReturnType):指示接收结果,并表明传输是否成功 [SWS_Dlt_91007]。
并发性与限制
该接口被定义为同步且可重入 [SWS_Dlt_91007]。既不存在输入/输出参数,也不存在纯输出参数 [SWS_Dlt_91007]。
错误处理与交互
传输结果仅通过实参 result 通知给 DLT 模块;未指定特定的错误代码、DET 或 DEM 消息 [SWS_Dlt_91007]。
解读:一旦 DLT 消息完全到达或传输中断,该调用可能由下层传输协议组件执行 [SWS_Dlt_91007]。 问题 Q-7d9c8564a2404acf (未决)
本使用说明由 AI 基于 AUTOSAR 规范 R20-11 生成。
实现者指南即将推出(复杂度 I1)
函数 Dlt_CopyRxData [SWS_Dlt_91008] 📄 PDF
BufReq_ReturnType Dlt_CopyRxData (PduIdType id, const PduInfoType* info, PduLengthType* bufferSizePtr);
Service Dlt_CopyRxData.
用法与语义
调用同步函数 Dlt_CopyRxData 以将 I-PDU 段(N-PDU)的已接收数据传递给上层 [SWS_Dlt_91008]。每次调用都会提供 I-PDU 数据的相应下一部分,剩余缓冲区大小将写入通过 bufferSizePtr 引用的存储位置 [SWS_Dlt_91008]。该声明可通过头文件 Dlt.h 获取 [SWS_Dlt_91008]。
参数与缓冲区查询
通过输入参数 id 标识接收到的 I-PDU [SWS_Dlt_91008]。指针 info 通过 SduDataPtr 提供源缓冲区,并通过 SduLength 提供要复制的字节数 [SWS_Dlt_91008]。如果传入的 SduLength 值为 0,则该调用仅用于查询上层模块中当前可用的缓冲区;在这种情况下,SduDataPtr 可以是 NULL_PTR [SWS_Dlt_91008]。输出参数 bufferSizePtr 返回复制过程后仍然空闲的接收缓冲区大小 [SWS_Dlt_91008]。
并发性与返回值
该函数设计为可重入的,服务 ID 为 0x44 [SWS_Dlt_91008]。类型为 BufReq_ReturnType 的返回值指示复制过程的结果:在成功接收数据时,该服务返回 BUFREQ_OK,而在出错时报告 BUFREQ_E_NOT_OK [SWS_Dlt_91008]。
注意:此使用说明由 AI 基于 AUTOSAR 规范 R20-11 生成。
实现者指南即将推出(复杂度 I1)
函数 Dlt_TxFunction [SWS_Dlt_91005] 📄 PDF
void Dlt_TxFunction (void);
-
用法与调用上下文
根据规范 [SWS_Dlt_91005],函数 Dlt_TxFunction 被定义为服务,服务 ID 为 0x80,可通过头文件 SchM_Dlt.h 获取。其接口签名为 void Dlt_TxFunction (void) [SWS_Dlt_91005]。SchM_Dlt.h 中的声明作为一种解读表明,该调用由 BSW 调度器在周期性任务的上下文中执行,而不应直接由应用程序软件组件调用。
参数与返回值
根据 [SWS_Dlt_91005],该函数不接受任何传入参数,并且不返回任何返回值(void)。从名称来看,该函数可能负责周期性处理和传输待发送的 Dlt 发送消息。 问题 (未决)由于未指定返回值,错误处理推测完全在模块或状态内部进行。
限制
由于有效负载不包含有关重入性或特殊开发错误的信息,因此调用间隔和任务分配需通过调度管理器配置进行协调。[SWS_Dlt_91005] 中未列出其他错误代码或 DET 条目。
本文本由 AI 生成;不能替代对官方 AUTOSAR 规范的研读。
类型 Dlt_ConfigType [SWS_Dlt_00437] 📄 PDF
This is the type of the data structure containing the initialization data for Dlt.
类型 Dlt_MessageType [SWS_Dlt_00224] 📄 PDF
This type describes the type of the message.
类型 Dlt_MessageIDType [SWS_Dlt_00228] 📄 PDF
Contains the unique Message Id for a message. This is only relevant in non - verbose mode.
类型 Dlt_MessageNetworkTraceInfoType [SWS_Dlt_00233] 📄 PDF
This type describes transported type of a Dlt BUSMESSAGE.
类型 Dlt_ApplicationIDType [SWS_Dlt_00226] 📄 PDF
This type describes the Application Id. 0x00000000 means the so - called wildcard.
类型 Dlt_ContextIDType [SWS_Dlt_00227] 📄 PDF
This type describes the Context Id. 0x00000000 means the so - called wildcard.
类型 Dlt_SessionIDType [SWS_Dlt_00225] 📄 PDF
This type identifies the session.
类型 Dlt_LogInfoType [SWS_Dlt_91002] 📄 PDF
-
类型 Dlt_ContextIdInfoType [SWS_Dlt_91003] 📄 PDF
Context Information
类型 Dlt_ApplicationIdInfoType [SWS_Dlt_91004] 📄 PDF
Information about Applications
类型 Dlt_MessageOptionsType [SWS_Dlt_00229] 📄 PDF
Bitfield
类型 Dlt_MessageLogInfoType [SWS_Dlt_00236] 📄 PDF
-
类型 Dlt_MessageLogLevelType [SWS_Dlt_00230] 📄 PDF
This type describes the log lev el for each log message.
类型 Dlt_MessageTraceType [SWS_Dlt_00231] 📄 PDF
This type describes labels for trace messages.
类型 Dlt_MessageArgumentCount [SWS_Dlt_00235] 📄 PDF
This type describes the count of arguments provided to a message.
类型 Dlt_MessageTraceInfoType [SWS_Dlt_00237] 📄 PDF
-
类型 Type [SWS_Dlt_00232] 📄 PDF
This type describes the Log Channel name.
类型 Dlt_AssignmentOperation [SWS_Dlt_00730] 📄 PDF
Adding or removing a Log Channel assignment for the given tuple of Application Id/ Context Id.
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_Dlt- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_Dlt@rel:R20-11#3b0fef65- Content hash
3b0fef65- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_DiagnosticLogAndTrace.pdf#nameddest=SWS_Dlt_00239
gemini-3.8-flash-low· 2026-10-13 · 德文原文