Professional Documents
Culture Documents
AUTOSAR SWS DiagnosticCommunicationManager 428-449 ZH
AUTOSAR SWS DiagnosticCommunicationManager 428-449 ZH
欲了解更多信息,请访问www.DeepL.com/pro。
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
8.10.6 DsdInternal_StartPagedProcessing
1 空白
2 DsdInternal_StartPagedProcessing(const Dcm_MsgContextType* pMsgContext)
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 概述
9.2.1 启动协议
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
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 子模块会独立发
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
档
号 接收请求信息 ...- 同步
档
号 接收请求消息 ...- 异步
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()
函数,启动一个周期标识符的发送。
档
号 接收请求信息 ...- 同步
档
号 接收请求消息 ...- 异步
数据指示功能()
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 会触发服务响应。
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
• 应用程序会收到协议停止的通知(通过 Xxx_StopProtocol()完成),并重置为稳
只 要 处 理 请 求 的 外 部 模 块 未 完 成 ( 通 过 向 <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 子模块就会超时,并直接切换到抢占式协
议的进一步处理。
9.2.7.1 默认会话中的处理
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()
ComM_DCM_InactiveDiagnostic(NetworkHandleType)
ComM_DCM_InactiveDiagnostic()
Dcm_TpTxConfirmation()
图 9.7
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_TpTxConfirmation()
图 9.8
9.2.7.3 会议过渡
ComM
会话过渡:默认到非默认()
ComM_DCM_ActiveDiagnostic(NetworkHandleType)
ComM_DCM_ActiveDiagnostic()
会话过渡:非默认值改为
默认值()
ComM_DCM_InactiveDiagnostic(NetworkHandleType)
ComM_DCM_InactiveDiagnostic()
图 9.9
"模块" 模块
ComM
Dcm_ComM_NoComModeEntered (
uint8)
禁用 ROE 和 PeriodicID() 的传
禁用正常传输(接收和发送)(
Dcm_ComMNoComModeEntered ()
PduR_DcmTransmit)
Dcm_ComM_SilentComModeEntered
(uint8)
禁用正常传输(发送)
(PduR_DcmTransmit)
Dcm_ComMSilentComModeEntered ( )
Dcm_ComM_Full ComModeEntered(
uint8)
启用 ROE 和 PeriodicID() 传输
功能
Dcm_ComMFullComModeEntered 启用正常传输
( ) (PduR_DcmTransmit)
图 9.10
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
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 接收请求信息并发送否定响应信息
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
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
在应用程序端未发生错误的情况下,处理流程如下:
循环开始
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_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 处理接收的副本数据
9.3 DSP(诊断服务处理)
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
上图显示了测试仪发出的诊断会话控制请求的处理过程。请注意,新的诊断会话和定
时参数只有在服务器正响应的传输确认后才会应用。
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
TesterPresent 服务解
释器()
TesterPresent 服务解
释器()
数据指示功能()
Dcm_TpRxIndication()
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
TesterPresent 服务解
释器()
TesterPresent 服务解
数据指示功能() 释器()
Dcm_TpRxIndication()
图 9.18
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
SecurityAccess 服务解释器()
GetSeed()
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
SecurityAccess 服务解
释器()
CompareKey(Std_ReturnType,
uint8*, Dcm_OpStatusType)
Dcm_CompareKey()
Dcm_SetSecurityLevel(Dcm_SecLevelType)
Dcm_SetSecurityLevel()
图 9.19
第二步,DSP 子模块获取测试仪计算出的密钥,并要求应用程序将该密钥与内部计算
出的密钥进行比较。如果没有错误发生,则在 DSL 子模块中设置新的访问类型,并发
送肯定响应。
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
ResponseOnEvent 服务解
释器()
ResponseOnEvent 服务解
数据指示功能() 释器()
Dcm_TpRxIndication()
配置事件()
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
ResponseOnEvent 服务解
释器()
ResponseOnEvent 服务解
数据指示功能() 释器()
内部激活 DTC 状态监控()
Dcm_TpRxIndication()
Dcm_DemTriggerOnDTCStatus()
检查 DTC 和状态()
数据指示功能()
ReadDTCInformation 服务
解释器()
Dcm_DemTriggerOnDTCStatus()
[错误]
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
释器()
图 9.20
通 过 ResponseOnEvent 服 务 配 置 和 激 活 事 件 后 , Dcm 会 在 每 次 调 用 接 口
Dcm_DemTriggerOnDTCStatus 时检查已配置的 DTC 的状态,以确定是否应触发
事件。这
451的 639 文件 ID 18:AUTOSAR_SWS_DiagnosticCommunicationManager
- autosar confidential -
诊断通信规格
管理器
AUTOSAR CP 4.4.0 版
在任何 DTC 状态变化时,DEM 都会调用该接口,与 ResponseOnEvent 的激活/未激
活无关。
PduR Dsl
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
ResponseOnEvent 服务解
释器()
ResponseOnEvent 服务解
数据指示功能() 释器()
Dcm_TpRxIndication()
配置事件()
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
ResponseOnEvent 服务解
释器()
ResponseOnEvent 服务解
数据指示功能() 释器()
Dcm_TpRxIndication()
Dcm_TriggerOnEvent(Eventid)
Data_Indication_functionality()
DspInternal_DcmReadDataByIdentifier(pMsgContext)
Xxx_ReadData()
Xxx_ReadData()
Dcm_TriggerOnEvent()
Dcm_TpRxIndication(PduIdType,
Std_ReturnType)
数据指示功能()
ResponseOnEvent 服务解
释器()
图 9.21
上 图 显 示 了 在 事 件 由 外 部 管 理 的 情 况 下 , 子 服 务 OnChangeOfDataIdentifier 的
ResponseOnEvent 服务的处理过程(事件可以由内部管理,但不在本图中描述)。
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
• 传送 NRC 0x78(ResponsePending)
10 配置规格