AUTOSARのClassic PlatformとAdaptive PlatformにおけるDiagnosticsの違いを整理

# はじめに
AUTOSARのClassic PlatformとAdaptive Platformにおける、Diagnosticsの違いについて、参考動画や参考記事の情報をちょっと整理する。

# Classic PlatformとAdaptive Platformの関係
eSOLの記事「AUTOSAR Classic PlatformとAUTOSAR Adaptive Platformの違いを解説」に、非常に大切な以下の一文があった。

> APはCPの上位バージョンではないので、APが出たからと言ってCPがなくなるわけではありません。
CPとAPは、適材適所で共存し、相互に連携しあい、統合システムを形成するものです。

https://blog.esol.co.jp/autosar_explanation_2

# Classic ECUとAdaptive ECUにおけるDiagnosticsの違い
Vectorの動画「AUTOSAR Adaptive: Diagnostics - Vector Virtual Sessions 2020」で、Classic ECUとAdaptive ECUにおけるDiagnosticsの違いが述べられている。
動画の中の表では、タイトルが”Classic Autosar”と”Adaptive ECU”の比較となっていた。意図的なのかは理解できていない。

||Classic Autosar|Adaptive ECU|
|:--|:--|:--|
|Diagnostics Kind|Actor / Sensor|Apps|
|Fault Pass|Known|Partly known|
|DTC|Repair Instruction|?|

https://www.youtube.com/watch?v=lokz7Wdnrv4

# Classic PlatformとAdaptive PlatformのDiagnosticsに関する構造の違い

## Classic Platform
* Dcm（Diagnostic Communication Manager）
* Dem（Diagnostic Event Manager）
* FiM（Function Inhibition Manager）

https://assets.vector.com/cms/content/know-how/_technical-articles/diagnostics/Diagnostics_Autosar_ODX_Part1_HanserAutomotive_201110_PressArticle_JP.pdf

https://www.aubass.co.jp/products/cp.html

## Adaptive Platform
* ara::diag
* DM（Diagnostic Management）

https://monoist.itmedia.co.jp/mn/articles/1903/04/news012_3.html

https://www.youtube.com/watch?v=lokz7Wdnrv4

# Classic PlatformとAdaptive PlatformのRequirements Specificationの違い
R21-11のRequirements on Diagnosticsから、Classic PlatformとAdaptive PlatformのRequirements Specificationの違いを整理してみた。

https://www.autosar.org/fileadmin/user_upload/standards/foundation/21-11/AUTOSAR_RS_Diagnostics.pdf

| |Classic Platform|Adaptive Platform|
|:----|:----|:----|
|ECU|OBD Master ECU (Master or Primary ECU)<br>OBD Slave ECU (Dependent /Secondary ECU)<br>non-OBD ECU|-|
|参照法規・規格|ISO 14229-1 v.2013<br>ISO 14229-2<br>ISO 15031-5<br>ISO 15765-2<br>ISO 15765-3<br>ISO 13400-2（DoIP）<br>CCR section 1968.2.（OBD II）<br>SAE J1979-2（OBDonUDS）<br>SAE J1939-73（HD-OBD）<br>ISO 27145（WWH-OBD）|ISO 14229-1 v.2013<br>ISO 15031-5<br>ISO 13400-2（DoIP） |
|UDSのサポートサービス|service 0x19 subfunction 0x42<br>service 0x19 subfunction 0x1A<br>service 0x19 subfunction 0x56<br>service 0x29<br>service 0x2C subfunction 0x02|service 0x29|
|代表的な機能|ASMIP algorithm (AlternativeStatistical MIL Illumination Protocol)<br>FIM<br>IUMPR<br>DTCs suppression<br>Snapshot Records data pre-storage<br>DynamicallyDefineDataIdentifier<br>Lamp status（SAE J1939-73）<br>Expanded-FreezeFrame（SAE J1939-73）<br>DM-messages（SAE J1939-73）|-|

## その他詳細な機能
### Classic Platform
#### Fault Memory Management
* The Diagnostic event (fault) management shall be establishedas Basic SW Module
* Classification of events for series production, OBD and expertusage
* Harmonized Driving/WarmUp cycles
* Configurable suppression of events
* Definition of replacement failure
* Notify applications and BSW modules about updates of eventrelated data
* Triggering of multiple events upon a master event is reported
* Independent CP Software Cluster development"

#### DTC and event-related data
* Parallel fault memory access
* Independent event memories for multiple diagnostic server in-stances (virtual ECUs)

#### Diagnostic Communication
* Generic connections
* Parallel OBD and UDS processing
* Handling of different diagnostic sessions in parallel
* Different diagnostic addresses shall be supported by multiple(physical) channels
* Access and handle specific data elements and data elementgroups if requested by an external scan tool
* Provide confirmation after transmit diagnostic responses tothe application
* Provide diagnostic state information to applications
* Network independent design
* Update of constant parameters through diagnostics

### Adaptive Platform
#### Diagnostic Communication
* Several tester conversations in parallel with assigned priorities
* Pseudo parallel client interaction according to ISO
* Conversation preemption/abortion
* Adding of user-defined transport layers
* Provide an interface for external UDS service processors
* Provide connection specific meta information to external service processors
* Synchronous and asynchronous interaction with external service processors
* Different signature types, when delegating processing of UDS service to the application
* Provide SA and TA to external service processors
* Support for multiple Diagnostic Server Instances

# その他参考記事
https://qiita.com/kaizen_nagoya/items/fce079cfd7ce9f6ee4ca

https://qiita.com/kazuo_reve/items/f773b320dcbf2ab316da

https://qiita.com/kaizen_nagoya/items/0c6b8373f93ce52def33