DEENESPTFRRUARHIKOZHNL

结构体 ara::diag::DownloadService::OperationOutput

[SWS_DM_00785] Upstream: RS_Diag_04033

struct OperationOutput {...};

Response data of positive response message.

Header-Datei#include "ara/diag/download.h"
Forwarding-Header#include "ara/diag/diag_fwd.h"
Scopeclass ara::diag::DownloadService

用户指南人工智能生成

用于在下载操作中返回不带服务 ID 的肯定诊断响应的有效载荷数据。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: c06f480862f4 来源 未决问题(2)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用于在下载操作中返回不带服务 ID 的肯定诊断响应的有效载荷数据。

数据结构 ara::diag::DownloadService::OperationOutput 用作下载服务中肯定诊断响应有效载荷数据的传输容器([SWS_DM_00785])。在此过程中,自适应应用程序使用结果字节填充字段 responseData 并将该结构传递给 Diagnostic Management([SWS_DM_00786])。核心约束条件是 responseData 必须强制包含不带服务 ID 的有效载荷数据,并且根据操作(如 DownloadData 或 RequestDownloadExit)的不同,预期包含不同的内容([SWS_DM_00786])。

上下文

结构 ara::diag::DownloadService::OperationOutput 是 AUTOSAR Adaptive Platform 内诊断模块的专用数据类型,通过头文件 ara/diag/download.h 提供([SWS_DM_00785])。其主要作用是封装下载服务的肯定诊断响应消息的有效载荷数据(AUTOSAR_AP_SWS_Diagnostics §8.14.2 “Struct: OperationOutput”)。在诊断架构中,该结构充当自适应应用程序中的具体服务实现与底层诊断运行时环境(ara::diag)之间的数据传输容器,而运行时环境反过来与外部诊断客户端(测试仪)进行交互(AUTOSAR_AP_SWS_Diagnostics §7 “API Specification”)。

唯一包含的成员是类型为 ara::core::Vector<std::uint8_t> 的公共字段 responseData([SWS_DM_00786])。它传输在成功处理下载操作时需返回给诊断测试仪的纯有效数据和有效载荷字节。

生命周期

作为纯数据结构(struct),OperationOutput 没有内部状态机或自身的方法([SWS_DM_00785])。它的生命周期短暂,并直接与单个诊断请求的同步或异步处理绑定:

  • 生成:一旦下载操作成功完成并存在响应数据,该结构就会由应用程序实例化。生成通常可能在栈上或在回调链或 Future 链内进行。 问题 (未决)
  • 填充与传递:应用程序使用计算出的字节填充向量 responseData([SWS_DM_00786])。返回给 Diagnostic Management 后,数据的责任便转移到平台。
  • 销毁:一旦平台层对数据完成序列化并发送了 UDS 帧,该实例即被释放。

关于并发性,需要注意的是,OperationOutput 作为被动值对象并不是线程安全的。如果在应用程序的并发工作线程中处理操作,则必须确保在将对象传递给 ara::diag 之前,不会对 responseData 发生竞争访问。

使用路径

OperationOutput 的典型用法是在处理诊断下载请求的上下文中。外部诊断测试仪向车辆发送请求,该请求由平台接收并转发给自适应应用程序中 DownloadService 接口的相应方法(AUTOSAR_AP_SWS_Diagnostics §7 “API Specification”)。在内部处理成功后,应用程序创建 OperationOutput 的实例并传递响应数据。

通过 OperationOutput 提供响应数据的流程诊断客户端ara::diag (DCM)DownloadService (Anwendung)Download-Anfrage (UDS)调用下载操作Verarbeitet DatenblockErzeugt OperationOutput填充 responseData(不含 SID)返回 OperationOutput {responseData}添加 SID / 报头Positive UDS-Antwortnachricht

时序图:诊断客户端、平台运行时与应用程序通过 OperationOutput 提供肯定响应数据时的交互。来源:[SWS_DM_00785]、[SWS_DM_00786]、AUTOSAR_AP_SWS_Diagnostics §8.14.2 “Struct: OperationOutput”。

填充 responseData 时必须注意,必须提供不带服务 ID(SID)的有效载荷数据([SWS_DM_00786])。平台会自动补充协议特定的 SID 以及可能存在的头部信息。此外,确切的内容结构取决于被调用的操作:在 DownloadData 或 RequestDownloadExit 中,向量中响应数据的起始和结构的语义预期各不相同([SWS_DM_00786])。

错误场景

由于 OperationOutput 是显式为肯定响应消息指定的(AUTOSAR_AP_SWS_Diagnostics §8.14.2 “Struct: OperationOutput”),因此该数据结构内不存在用于错误代码或否定反馈的字段。如果在执行下载操作时发生错误(例如无效的地址范围、错误的块顺序或中止的传输),推测 OperationOutput 将不会被评估;相反,应用程序会通过平台的错误通道指示失败,随即生成否定响应代码(NRC)。 问题 (未决)

如果在 OperationOutput 的使用中意外将服务 ID 插入到 responseData 中,则属于应用程序端错误。这与规范 [SWS_DM_00786] 相违背,并可能导致帧格式错误。 问题 (未决)同样,根据具体操作的不同,错误的字节顺序或不完整的数据量会导致测试仪端的协议错误([SWS_DM_00786])。

本指南基于 AUTOSAR Adaptive Platform 规范版本 R25-11,由自动化工具生成。

UML 类图

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__diag__DownloadService__OperationOutput45 «struct» OperationOutput + responseData

常量

Content of positive response message (without SID) Depending on the operation (e.g.: DownloadData, RequestDownloadExit) the expectation, what responseData shall contain (where it starts in the positive response) might differ. See doc of corresponding operation.

常量 / 变量文档

变量 responseData [SWS_DM_00786] Upstream: RS_Diag_04033

ara::core::Vector<std::uint8_t> responseData;

Content of positive response message (without SID) Depending on the operation (e.g.: DownloadData, RequestDownloadExit) the expectation, what responseData shall contain (where it starts in the positive response) might differ. See doc of corresponding operation.

Header-Datei#include "ara/diag/download.h"
Scopestruct ara::diag::DownloadService::OperationOutput
SymbolresponseData
Typara::core::Vector< std::uint8_t >

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_DM_00786
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00786@rel:R25-11#4357139c
Content hash
4357139c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00786
Status: valid/unmigrated Version: rel:R25-11#9ee381a9 Versionshistorie & Revisions (1 transition, 7 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_DM_00786@rel:R25-11#9ee381a9
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#a830c82b2026-09-30
  • R20-11rel:R20-11#5fbb8d5c2026-10-14
  • R21-11rel:R21-11#bfa9d5ae2026-10-14
  • R22-11rel:R22-11#ef7d58082026-10-14
  • R23-11rel:R23-11#0f456ef02026-10-14
  • R24-11rel:R24-11#0f456ef02026-10-14
  • R25-11rel:R25-11#9ee381a92026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill