You are on page 1of 28

订阅DeepL Pro以翻译大型文件。

欲了解更多信息,请访问www.DeepL.com/pro。
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版

此 API 可处理 DCM 内部请求的一个周期性 ID 事件。调用此函数的频率取决于原始


ReadDataByPeriodicID 请求(参数 transmissionMode)中给出的速率。

8.10.6 DsdInternal_StartPagedProcessing

1 空白
2 DsdInternal_StartPagedProcessing(const Dcm_MsgContextType* pMsgContext)

通过该 API,DSP 子模块向 Dcm 模块提供完整的响应长度,并开始处理分页缓冲区。


此 API 不启动任何传输!

8.10.7 DspInternal_CancelPagedBufferProcessing

1 空白
2 DspInternal_CancelPagedBufferProcessing()

Dcm 通知 DSP,由于错误,已取消对分页缓冲区的处理。调用该命令后,DSP 将无
法继续处理分页缓冲区。

8.10.8 DsdInternal_ProcessPage

1 空白
2 DsdInternal_ProcessPage(Dcm_MsgLenType FilledPageLen)

DSP 请求传输已填充的页面。

9 顺序图

9.1 概述

为说明起见,以下序列图并不代表 Dcm 模块和 PduR 模块之间的全部通信机制。这是


为了保持序列图的简洁。在调用 Dcm_TpRxIndication 之前,PduR 模块将通过调
用 Dcm_StartOfReception 和 Dcm_CopyRxData 向 Dcm 模块请求缓冲区。这
种 交 换 不 会 显 示 在 下 一 个 序 列 图 中 。 在 Dcm 模 块 向 PduR 模 块 发 出
PduR_DcmTransmit()请求后,与 Dcm_CopyTxData 服务的数据交换未显示在序列
图中。第一个诊断请求应调用函数 Xxx_StartProtocol()。

428的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2 DSL(诊断会话层)

9.2.1 启动协议

"模块" "模块 "DSL 模块 Dcm 用户 外部模块

PduR

Dcm_TpRxIndication(PduIdType, Std_ReturnType)

Xxx_StartProtocol(Std_ReturnType, Dcm_ProtocolType,
uint16, uint16)

Dcm_StartProtocol()

允许使用其他协议吗?
数据指示功能() <Module>_<DiagnosticService>(Std_ReturnType,
[确定]
Dcm_ExtendedOpStatusType、
Dcm_MsgContextType**、
Dcm_NegativeResponseCodeType**)

数据指示功能()

[e_protocol_not_allowed](不允许)。

Dcm_TpRxIndication()

图 9.1

429的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.2 流程繁忙行为

"模块" "模块" "模块" 外部模块 "模块"


PduR Dsl Dsd Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

<Module>_<DiagnosticService>(Std_ReturnType、
Dcm_ExtendedOpStatusType,
Data_Indication_functionality() Dcm_MsgContextType**、
Dcm_NegativeResponseCodeType**)

数据指示功能()

Dcm_TpRxIndication()

如何回应?

[否定回答:RC=0x78]

PduR_DcmTransmit(Std_ReturnType, PduIdType,
const PduInfoType*):Std_ReturnType

PduR_DcmTransmit()

PduR_DcmTransmit(Std_ReturnType, PduIdType,
const PduInfoType*):Std_ReturnType

PduR_DcmTransmit()

[积极回应]
Dcm_TpTxConfirmation(PduIdType,
NotifResultType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

数据确认功能()

Dcm_TpTxConfirmation()

图 9.2

在内部,DSL 子模块会计算响应测试人员的时间。如果处理请求的外部模块没有通过
向 <Module>_<DiagnosticService>() 或 <Mod-
ule>_<DiagnosticService>_<SubService>() API 调用(在正常响应处理的情况下)或
DsdInternal_ProcessPage() 返 回 E_OK 或 E_NOT_OK 来 关 闭 请 求 。 ( 在
P2ServerMax 和 / 或 P2*ServerMax 期 间 调 用 ( 正 常 响 应 处 理 情 况 下 ) 或
DsdInternal_ProcessPage()(分页缓冲区处理情况下)API 时,DSL 子模块会独立发

430的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
送否定响应(requestCorectlyReceived-ResponsePending)。

431的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.3 超时时更新诊断会话控制

"模块" "模块" "模块" 外部模块 "模块"


PduR Dsl Dsd Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能() <Module>_<DiagnosticService>(Std_ReturnType,
Dcm_ExtendedOpStatusType、
Dcm_MsgContextType**、
Dcm_NegativeResponseCodeType**)

数据指示功能()

Dcm_TpRxIndication()

Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

Data_Confimation_functionality()

Dcm_TpTxConfirmation()

图 9.3

如果在非默认会话中发生 S3server 超时,DSL 子模块会将会话控制值重置为默认值


。S3server 超时计时器将在 PduR 模块每次确认数据时启动。

432的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.4 处理 ReadDataByPeriodicIdentifier 的单个响应

"模块" PduR "模块 "DSL "模块" "模块" Dcm 用户


Dsd Dsp


号 接收请求信息 ...- 同步


号 接收请求消息 ...- 异步

DslInternal_ResponseOnOneDataByPeriodicId(uint8)

Data_Indication_functionality()

ReadDataByIdentifier 服务解释器()

读取数据(特定类型):
Std_ReturnType

DspInternal_DcmReadDataByIdentifier()

数据指示功能()

DslInternal_ResponseOnOneDataByPeriodicId()

Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

数据确认功能()

Dcm_TpTxConfirmation()

图 9.4

当周期标识符事件发生(即给定时间段结束)时,DSP 子模块请求采样和传输周期标
识符数据。DSP 子模块调用 DSL 子模块提供的 ResponseOnOneDataByPeriodicId()
函数,启动一个周期标识符的发送。

在此函数中,DSL 子模块会针对给定的 PeriodicId 模拟 "ReadDataByIdentifier "请求


。DataIdentifier 的高字节应设置为 [18] 中规定的 0xF2),低字节设置为 PeriodicId
的值。

433的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器

调用 DID 中相应 Datas 的 ReadData 接口可获取 AUTOSAR CP 4.4.0 版


DID 值。Dcm 模块无法接收相同的周期性标识符。

434的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
除非收到当前传输的确认,否则 DSP 子模块将发出另一个事件请求。

9.2.5 处理 ResponseOnEvent 的单一事件触发响应

"模块" "模块 "DSL "模块" "模块" Dcm 用户

PduR Dsd Dsp


号 接收请求信息 ...- 同步


号 接收请求消息 ...- 异步

DslInternal_ResponseOnOneEvent(const Dcm_MsgType, Dcm_MsgLenType, uint16)

数据指示功能()

ReadDataByIdentifier 服务解释器()

读取数据(特定类型):
Std_ReturnType

DspInternal_DcmReadDataByIdentifier()

数据指示功能()

Dsl Internal_ResponseOnOneEvent()

Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)

数据确认功能()
DspInternal_DcmConfirmation(Dcm_IdContextType, PduIdType,
Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

数据确认功能()

Dcm_TpTxConfirmation()

图 9.5

此 序 列 图 显 示 了 ResponseOnEvent 的 示 例 。 ResponseOnEvent 为
onDTCStatusChange 设置并启动。事件更改会报告给 Dcm,Dcm 会触发服务响应。

435的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.6 处理并发请求

"模块" "模块" "模块" 外部模块 "模块" Dcm 用户


PduR Dsl Dsd Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

<Module>_<DiagnosticService>(Std_ReturnType,
Dcm_ExtendedOpStatusType、

Dcm_MsgContextType**、
Dcm_NegativeResponseCodeType**)

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

停止协议功能()
Xxx_StopProtocol
(Std_ReturnType、
Dcm_ProtocolType, uint16、
uint16) Dcm_StopProtocol()
停止协议功能()
数据指示功能()

PduR_DcmCancelTransmitRequest()

PduR_DcmTransmit(Std_ReturnType,
PduIdType, const PduInfoType*):
Std_ReturnType

PduR_DcmTransmit()

Dcm_TpRxIndication()

<Module>_<DiagnosticService>()

数据指示功能()

Dcm_TpRxIndication()

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

图 9.6

在处理正常诊断请求(如增强诊断协议、客户诊断协议)的同时接收 OBD 请求时,将


抢先处理正在运行的诊断请求。这是因为配置的 OBD 协议优先级更高(参见配置参数
DcmDslProtocolPriority)。

接收到第一个 OBD 请求时,将处理以下信息:

• 应用程序会收到协议停止的通知(通过 Xxx_StopProtocol()完成),并重置为稳

436的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
定状态(如切换数字 Ios 等)。

437的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
• 请 求 下 层 取 消 同 一 N-PDU 正 在 进 行 的 传 输 ( 使 用
PduR_DcmCancelTransmitRequest())。

• 如果 Dcm 无法快速从非 OBD 协议切换到 OBD 协议,则 DSL 子模块会向 OBD


测试仪发出 "BusyRepeatRequest"(NRC 0x21)负响应。系统设计人员有责任
确保符合法定时限。

只 要 处 理 请 求 的 外 部 模 块 未 完 成 ( 通 过 向 <Mod-
ule>_<DiagnosticService>()/<Module>_<DiagnosticService>_<SubService>() API
调 用 返 回 E_OK 或 E_NOT_OK 表 示 完 成 ) 或 未 发 生 超 时 , DSL 子 模 块 就 会 以
"BusyRepeatRequest"(忙重复请求)负响应进行响应。

当 外 部 模 块 向 <Mod-
ule>_<DiagnosticService>()/<Module>_<DiagnosticService>_<SubService>() API
调用发送 E_OK 或 E_NOT_OK 时,DSL 子模块将不发送对旧请求的响应。也不会给
出任何负面响应,通知第一测试人员诊断请求被抢占。

如 果 处 理 请 求 的 外 部 模 块 从 未 向
<Module>_<DiagnosticService>()/<Module>_<DiagnosticService>_<SubService>()
API 调用返回 E_OK 或 E_NOT_OK,DSL 子模块就会超时,并直接切换到抢占式协
议的进一步处理。

438的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.7 连接 ComManager 的接口

9.2.7.1 默认会话中的处理

"模块" PduR 模块 "模块" ComM 外部模块 模块

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

ComM_DCM_ActiveDiagnostic(NetworkHandleType)

ComM_DCM_ActiveDiagnostic()

<Module>_<DiagnosticService>(Std_ReturnType,
Dcm_ExtendedOpStatusType、

Dcm_MsgContextType**、
Dcm_NegativeResponseCodeType**)

Dcm_TpRxIndication()

Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)

DspInternal_DcmConfirmation(Dcm_IdContextType, PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

ComM_DCM_InactiveDiagnostic(NetworkHandleType)

ComM_DCM_InactiveDiagnostic()

Dcm_TpTxConfirmation()

图 9.7

439的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.7.2 在非默认会话中的处理

"模块" "模块" "模块" 外部模块 "模块"


PduR Dcm ComM Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

<Module>_<DiagnosticService>(Std_ReturnType,
Dcm_ExtendedOpStatusType、
Dcm_MsgContextType**,
Dcm_NegativeResponseCodeType**)

Dcm_TpRxIndication()

Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)

DspInternal_DcmConfirmation(Dcm_IdContextType, PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

Dcm_TpTxConfirmation()

图 9.8

9.2.7.3 会议过渡

"模块 "DSL "模块"

ComM

会话过渡:默认到非默认()

ComM_DCM_ActiveDiagnostic(NetworkHandleType)

ComM_DCM_ActiveDiagnostic()

会话过渡:非默认值改为

默认值()

ComM_DCM_InactiveDiagnostic(NetworkHandleType)

ComM_DCM_InactiveDiagnostic()

图 9.9

440的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.7.4 通信国

"模块" 模块

ComM

Dcm_ComM_NoComModeEntered (

uint8)
禁用 ROE 和 PeriodicID() 的传

禁用正常传输(接收和发送)(
Dcm_ComMNoComModeEntered ()
PduR_DcmTransmit)

Dcm_ComM_SilentComModeEntered
(uint8)

禁用 ROE 和 PeriodicID() 的传输

禁用正常传输(发送)
(PduR_DcmTransmit)
Dcm_ComMSilentComModeEntered ( )

Dcm_ComM_Full ComModeEntered(

uint8)
启用 ROE 和 PeriodicID() 传输

功能

Dcm_ComMFullComModeEntered 启用正常传输
( ) (PduR_DcmTransmit)

图 9.10

DSD(诊断服务调度程序) 接收请求报文并发送积极响应报文 - 同步传输

441的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
"模块" PduR "模块 "DSL 模块 外部模块 模块

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能() <Module>_<DiagnosticService>(Std_ReturnType,
Dcm_ExtendedOpStatusType、
Dcm_MsgContextType**、
Dcm_NegativeResponseCodeType**)

数据指示功能()

Dcm_TpRxIndication()

Dcm_TpTxConfirmation(PduIdType,
NotifResultType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

数据确认功能 ()

Dcm_TpTxConfirmation()

图 9.11

接收请求报文并发送肯定响应报文--异步传输
"模块" "模块" "模块" 外部模块 "模块"
PduR Dsl Dsd Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能() <Module>_<DiagnosticService>(Std_ReturnType,
Dcm_ExtendedOpStatusType、
Dcm_MsgContextType**,
Dcm_NegativeResponseCodeType**)

数据指示功能()

Dcm_TpRxIndication()

Dcm_TpTxConfirmation(PduIdType,
NotifResultType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

数据确认功能()

Dcm_TpTxConfirmation()

图 9.12

442的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
接收请求信息并抑制积极回应

"模块" PduR "模块 "DSL 模块 外部模块 "模块"

Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

Data_Indication_functionality() <Module>_<DiagnosticService>(Std_ReturnType、

Dcm_ExtendedOpStatusType,
Dcm_MsgContextType**、
Dcm_NegativeResponseCodeType**)

数据指示功能()

Dcm_TpRxIndication()

图 9.13

9.2.8 接收请求信息并发送否定响应信息

"模块" PduR "模块 "DSL 模块 外部模块 模块

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

Data_Indication_functionality()<Module>_<DiagnosticService>(Std_ReturnType、

Dcm_ExtendedOpStatusType,
Dcm_MsgContextType**、
Dcm_NegativeResponseCodeType**)

<模块>_<诊断服务>()

数据指示功能( )

Dcm_RxIndication()

Dcm_TpTxConfirmation(PduIdType,
NotifResultType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

大 ta_Confirmation_functionality( )

Dcm_TpTxConfirmation()

图 9.14

443的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.9 使用分页缓冲区处理服务请求

"模块" "模块" "模块" "模块"


PduR Dsl Dsd Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()
服务解释器调用()

DsdInternal_StartPagedProcessing(const
Dcm_MsgContextType*)

DspInternal_DcmUpdatePage(Dcm_MsgType, Dcm_MsgLenType)

DspInternal_DcmUpdatePage()

DspInternal_StartPagedProcessing() 服务

解释器调用()

DsdInternal_ProcessPage(Dcm_MsgLenType)

PduR_DcmTransmit(Std_ReturnType,
传输功能()
PduIdType, const PduInfoType*):
Std_ReturnType

Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
PduInfoType*, RetryInfoType*, PduLengthType*)

Dcm_CopyTxData=BUFREQ_E_BUSY()

环路传输
Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
PduInfoType*, RetryInfoType*, PduLengthType*)

数据确认功能()

DspInternal_DcmUpdatePage(Dcm_MsgType,
Dcm_MsgLenType)

DsdInternal_ProcessPage(Dcm_MsgLenType)

传输功能()

Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
PduInfoType*, RetryInfoType*, PduLengthType*)

Dcm_CopyTxData=BUFREQ_OK()

Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

图 9.15

在应用程序端未发生错误的情况下,处理流程如下:

444的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
流程开始:
4) DsdInternal_StartPagedProcessing():通过该 API,DSP 子模块将完整的响应长度
提供给 Dcm 模块,并开始分页缓冲处理。此 API 不会启动任何传输!
5) UpdatePage():Dcm 模块请求传输数据。
6) DsdInternal_ProcessPage():通过该 API,DSP 子模块请求传输当前页面。
8) PduR_DcmTransmit():Dcm 模块请求向下层传输数据。
9) Dcm_CopyTxData:缓冲区已填满,Dcm 模块将返回 "BUFREQ_OK"(10)。

循环开始
11)Dcm_CopyTxData:PduR 模块请求缓冲区,但 DSP 子模块未填满缓冲区。
12 + 13) 更新页面:Dcm 模块请求 DSP 子模块填充下一页。
14) 通过返回 "BUFREQ_E_BUSY",Dcm 模块表示缓冲区必须由 DSP 子模块填满。
15) DsdInternal_ProcessPage():通过该 API,DSP 子模块请求传输当前页面。
17) 然后,在下一次调用 Dcm_CopyTxData 时,缓冲区将被填满,Dcm 模块将返回
"BUFREQ_OK" (18)。

循环:只要能发送数据,就重复流程 10 至 18。循环结束:
n-2 -> n) Dcm_TpTxConfirmation 当所有数据发送完毕后,PduR 模块将向 DSP 子
模块发送一个确认信息,以表示发送完毕。
只有在传输分页缓冲区时才需要使用 API 4、5 和 6。页面缓冲区超时处
理:

当 DSP 子模块开始处理分页缓冲区,但无法进一步处理填充响应数据时,Dcm 模块
的反应如下所述。
例 如 , 从 EEPROM 设 备 访 问 数 据 时 会 出 现 问 题 。 当 向 DSP 子 模 块 ( 13 :
UpdatePage())提供页面缓冲区,并从底层传输层得到否定的 Tx 确认时,Dcm 模块
将执行以下错误处理:

• Dcm 模块停止进一步处理分页缓冲区(第 15 项)、

• Dcm 模块请求 Dcm 模块 要求 子模块 DSP 子模块 (14


: DspInter-nal_CancelPagedBufferProcessing())来停止对 PagedBuffer 的

445的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
进一步处理。

446的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
"模块" "模块" "模块" "模块"
PduR Dsl Dsd Dsp

Dcm_TpRxIndication
(PduIdType, Std_ReturnType)
数据指示功能()

DspInternal_Dcm<DiagnosticService>(Dcm_MsgContextType)

DsdInternal_StartPagedProcessing(const Dcm_MsgContextType*)

DspInternal_DcmUpdatePage(Dcm_MsgType, Dcm_MsgLenType)

DspInternal_DcmUpdatePage()

DsdInternal_StartPagedProcessing()

DspInternal_Dcm<DiagnosticServices>()

DsdInternal_ProcessPage(Dcm_MsgLenType)
PduR_DcmTransmit(Std_ReturnType,
传输功能()
PduIdType, const PduInfoType*):
Std_ReturnType

Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
PduInfoType*, RetryInfoType*, PduLengthType*)

Dcm_CopyTxData=BUFREQ_OK()

环路传输
Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
PduInfoType*, RetryInfoType*, PduLengthType*)

数据确认功能() DspInternal_DcmUpdatePage(Dcm_MsgType,
Dcm_MsgLenType)

Dcm_CopyTxData=BUFREQ_E_BUSY()

DspInternal_DcmCancel PagedBufferProcessing()

Data_Failed_Functionality()

Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
PduInfoType*, RetryInfoType*, PduLengthType*)

Dcm_CopyTxData=BUFREQ_E_NOT_OK()

Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)

数据确认功能() DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

图 9.16

9.2.10 处理接收的副本数据

请参阅 [11, SWS PduR] 中的图 9 "CanTp I-PDU 接收"。


447的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager
- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.2.11 处理传输中的复制数据

请参阅 [11, SWS PduR] 中的图 14 "CanTp I-PDU 传输"。

9.3 DSP(诊断服务处理)

9.3.1 接口 DSP - DEM(服务 0x19、0x14、0x85)

请参阅 [13, SWS Dem] 第 9 节。

9.3.2 接口特别服务

9.3.2.1 过程诊断会话控制
模块
"模块" "模块 "DSL "模块"

PduR Dsd

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

DiagnosticSessionControl 服务解

释器()

数据指示功能()

Dcm_TpRxIndication()

Dcm_TpTxConfirmation(PduIdType,
Std_ReturnType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType,
PduIdType, Dcm_ConfirmationStatusType)

DspInternal_DcmConfirmation()

数据确认功能()

Dcm_TpTxConfirmation()

图 9.17

上图显示了测试仪发出的诊断会话控制请求的处理过程。请注意,新的诊断会话和定
时参数只有在服务器正响应的传输确认后才会应用。

448的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.3.2.2 工艺测试员

"模块" "模块" "模块" "模块"


PduR Dsl Dsd Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

TesterPresent 服务解

释器()

TesterPresent 服务解

释器()
数据指示功能()

Dcm_TpRxIndication()

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

TesterPresent 服务解

释器()

TesterPresent 服务解

数据指示功能() 释器()

Dcm_TpRxIndication()

图 9.18

上面的序列图显示了 TesterPresent 命令的处理过程,这些命令不属于子函数 0x80 寻


址的功能类型。这些 TesterPresent 命令在 DSL 子模块中进行解释(更多详情请参见
第 7.3.4.3 节并行 "TesterPresent 保持逻辑")。

所有其他 TesterPresent 命令的处理方式如下:在发出 TesterPresent 命令时,DSD


子模块会调用 DSP 子模块的 TesterPresent() 函数。序列图还显示了发生错误和发送
否定响应的情况。

449的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.3.2.3 流程安全访问

"模块" "模块" "模块" "模块" Dcm 用户


PduR Dsl Dsd Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

SecurityAccess 服务解释器()

GetSeed(Std_ReturnType, uint8*, Dcm_OpStatusType, uint8*,


Dcm_NegativeResponseCodeType*)

GetSeed()

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

SecurityAccess 服务解

释器()
CompareKey(Std_ReturnType,
uint8*, Dcm_OpStatusType)

Dcm_CompareKey()

Dcm_SetSecurityLevel(Dcm_SecLevelType)

Dcm_SetSecurityLevel()

图 9.19

要获得安全访问权限,DSD 子模块必须调用 DSP 子模块从应用程序中获取种子值。


如果没有检测到错误,种子值将在正响应中发送。

第二步,DSP 子模块获取测试仪计算出的密钥,并要求应用程序将该密钥与内部计算
出的密钥进行比较。如果没有错误发生,则在 DSL 子模块中设置新的访问类型,并发
送肯定响应。

450的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.3.2.4 处理响应事件 OnDtcChange

"模块" "模块" "模块" "模块" Dcm 用户


PduR Dsl Dsd Dsp

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

ResponseOnEvent 服务解

释器()

ResponseOnEvent 服务解
数据指示功能() 释器()
Dcm_TpRxIndication()
配置事件()

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()
ResponseOnEvent 服务解

释器()

ResponseOnEvent 服务解
数据指示功能() 释器()
内部激活 DTC 状态监控()
Dcm_TpRxIndication()

Dcm_DemTriggerOnDTCStatus()

检查 DTC 和状态()

备选 如果 DTC 和状态符合 ROE 配置


Dsl Internal_ResponseOnOneEvent(MsgPtr,MsgLen,DcmRxPduId)
[真]

数据指示功能()

ReadDTCInformation 服务

解释器()
Dcm_DemTriggerOnDTCStatus()

[错误]

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能() ResponseOnEvent 服务解

释器()

数据指示功能() ResponseOnEvent 服务解


Dcm_TpRxIndication()
释器()

内部停用 DTC 状态监控()

图 9.20

以上序列图显示了子服务 OnDtcChange 的 ResponseOnEvent 服务处理过程。

通 过 ResponseOnEvent 服 务 配 置 和 激 活 事 件 后 , Dcm 会 在 每 次 调 用 接 口
Dcm_DemTriggerOnDTCStatus 时检查已配置的 DTC 的状态,以确定是否应触发
事件。这
451的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager
- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
在任何 DTC 状态变化时,DEM 都会调用该接口,与 ResponseOnEvent 的激活/未激
活无关。

9.3.2.5 进程 ResponseOnEvent OnChangeOfDataIdentifier

"模块" "模块" 模块 模块 Dcm 用户

PduR Dsl

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
ResponseOnEvent 服务解

释器()

ResponseOnEvent 服务解
数据指示功能() 释器()
Dcm_TpRxIndication()
配置事件()

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()
ResponseOnEvent 服务解

释器()

ResponseOnEvent 服务解

数据指示功能() 释器()
Dcm_TpRxIndication()

Dcm_TriggerOnEvent(Eventid)

Dsl Internal_ResponseOnOneEvent(MsgPtr, MsgLen, DcmRxPduId)

Data_Indication_functionality()

DspInternal_DcmReadDataByIdentifier(pMsgContext)

Xxx_ReadData()

Xxx_ReadData()

Dcm_TriggerOnEvent()
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()
ResponseOnEvent 服务解

释器()

数据指示功能() ResponseOnEvent 服务解


Dcm_TpRxIndication()
释器()

图 9.21

上 图 显 示 了 在 事 件 由 外 部 管 理 的 情 况 下 , 子 服 务 OnChangeOfDataIdentifier 的
ResponseOnEvent 服务的处理过程(事件可以由内部管理,但不在本图中描述)。

通过 ResponseOn- Event 服务配置和外部激活事件后,Dcm 将等待管理该 DID 的外

452的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
部模块触发。

453的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
9.3.2.6 进程跳转到启动加载程序

"模块" "模块" "模块" "模块" "模块"


PduR Dsl Dsd Dsp Dcm_Callouts

Dcm_TpRxIndication(PduIdType,
Std_ReturnType)

数据指示功能()

DiagnosticSessionControl 服务解释

器()

DiagnosticSessionControl 服务解

释器()

数据指示功能()

Dcm_TpRxIndication()
允许重置时的备选 [TRUE

Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)

数据确认功能()

DspInternal_DcmConfirmation(Dcm_IdContextType, PduIdType,
Dcm_ConfirmationStatusType)

Dcm_SetProgConditions()

Dcm_SetProgConditions()

DspInternal_DcmConfirmation()

Data_Confirmation_functionality()

Dcm_TpTxConfirmation()

[错误]

图 9.22

以上序列图显示了接收到 DiagnosticSessionControl 时跳转到引导加载器的处理过程


。收到诊断会话控制(DiagnosticSessionControl)后,Dcm 会检查所请求的会话是
否配置为触发跳转到引导加载器。如果是,则 Dcm 启动跳转到引导加载程序进程:

• 传送 NRC 0x78(ResponsePending)

• 确认 NRC 0x78 发送后,Dcm 调用调用 DcmSet- ProgConditions 以存储引导加


载程序所需的所有信息。

10 配置规格

454的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
总体而言,本章定义了配置参数及其在连接器中的分组。为了支持规范,第 10.1 章介
绍了基本原理。

455的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager


- autosar confidential -

You might also like