1. About this document¶
This chapter includes information about the documentation itself, including purpose, terminology used throughout the document, and technical information about the document structure.
1.1. Introduction¶
The Classic Diagnostics Adapters purpose is to provide an SOVD API for legacy ECUs. Communication with legacy ECUs is facilitated by utilizing UDS. It must support DoIP, and may support additional transports in the future.
This documentation also utilizes sphinx-needs for traceability between requirements, architecture, design, implementation and tests.
1.1.1. DoIP Discovery and Connection Establishment¶
DoIP (Diagnostics over IP, ISO 13400) is the transport protocol used by the CDA to communicate with vehicle ECUs. Before diagnostic messages can be exchanged, two phases must complete: discovery and connection establishment.
1.1.1.1. Discovery¶
Discovery uses UDP broadcast to locate DoIP entities (gateways) on the network. The CDA sends a Vehicle Identification Request (VIR) to the broadcast address on the DoIP port (13400). Each DoIP entity that receives the request responds with a Vehicle Announcement Message (VAM) containing its IP address, logical address, and vehicle identification data (VIN, EID, GID). Responses are filtered to only accept entities within the same subnet as the CDA. After initial discovery, a background listener continues to receive spontaneous VAMs so that gateways coming online later are detected automatically.
DoIP Discovery (simplified)¶
1.1.1.2. Connection Establishment¶
Once a DoIP entity is discovered, the CDA establishes a TCP connection to it and performs routing activation to register itself as a diagnostic tester. Only after successful routing activation can UDS diagnostic messages be exchanged. If the entity requires an encrypted connection, the CDA transparently falls back to TLS on port 3496 and repeats the routing activation over the secured channel.
DoIP Connection Establishment (simplified)¶
For a detailed description of the DoIP communication layer including message framing, communication parameters, error handling, and alive-check behaviour, see the DoIP Communication section in the Architecture.
1.1.2. UDS Diagnostic Communication¶
UDS (Unified Diagnostic Services, ISO 14229) is the application-layer protocol used to interact with ECUs. It defines a set of services, each identified by a Service Identifier (SID), that allow a tester to read data, write configuration, control ECU functions, and manage diagnostic sessions. The CDA acts as the tester, translating SOVD API calls into UDS requests and forwarding them over the DoIP transport.
1.1.2.1. Data-Driven Approach via MDD¶
The CDA uses a data-driven approach: all knowledge about ECUs – their logical addresses, supported services, data identifiers, routines, communication timing parameters, and session configuration – is loaded at runtime from MDD (Marvelous Diagnostic Description) files. These files are the diagnostic description database for the vehicle and contain the full definition of what each ECU supports.
This means the CDA itself contains no hard-coded ECU knowledge. Instead it reads the MDD files on startup and configures all communication parameters (timeouts, retry counts, tester present behavior, addressing) per ECU from those files. Adding support for a new ECU or updating its diagnostic description requires only a new or updated MDD file – no code changes.
A client (e.g. a diagnostic tool or test script) communicates with the CDA exclusively through the SOVD REST API using JSON over HTTP. The CDA uses the MDD data to translate each incoming JSON request into the appropriate UDS service call and returns the ECU’s response as a JSON reply – the client never deals with raw UDS bytes directly.
MDD-driven ECU configuration (simplified)¶
1.1.2.2. Essential UDS Service Identifiers¶
The table below lists the UDS services most relevant to the CDA’s operation. Each service is
invoked by sending a request frame whose first byte is the SID; a positive response carries
SID + 0x40 as its first byte.
SID |
Service |
Purpose |
|---|---|---|
|
DiagnosticSessionControl |
Switch the ECU into a specific diagnostic session (e.g., default, extended, programming). Many services are only available in non-default sessions. |
|
ECUReset |
Trigger a hard or soft reset of the ECU. |
|
ClearDiagnosticInformation |
Erase stored Diagnostic Trouble Codes (DTCs) from ECU memory. |
|
ReadDTCInformation |
Read Diagnostic Trouble Codes and their associated status from the ECU. |
|
ReadDataByIdentifier |
Read one or more data values referenced by a 2-byte Data Identifier (DID), such as sensor readings, calibration values, or version strings. |
|
SecurityAccess |
Authenticate the tester to unlock ECU functions that require elevated access (seed/key challenge-response). |
|
WriteDataByIdentifier |
Write a value to a DID, such as updating configuration data or calibration parameters. |
|
RoutineControl |
Start, stop, or request the result of a named routine on the ECU (identified by a 2-byte Routine Identifier, RID). |
|
RequestDownload |
Initiate a data download (flash programming) transfer from the tester to the ECU. |
|
RequestUpload |
Initiate a data upload transfer from the ECU to the tester. |
|
TransferData |
Transfer a data block as part of an ongoing download or upload sequence. |
|
RequestTransferExit |
Conclude a data transfer sequence. |
|
TesterPresent |
Keep the current non-default diagnostic session alive. The CDA sends this periodically while a diagnostic lock is held so the ECU does not time out the session. |
1.1.2.3. UDS Request-Response Flow¶
Every UDS exchange follows the same basic pattern: the CDA sends a request frame (SID + payload),
the DoIP gateway acknowledges receipt at the transport layer, and the ECU eventually replies with
either a positive response (SID + 0x40) or a negative response (0x7F + SID + NRC).
Certain Negative Response Codes (NRCs) signal transient conditions – for example, NRC 0x78
(Response Pending) means the ECU needs more time – and the CDA handles these automatically
according to configurable policies sourced from the MDD files.
UDS request-response (simplified)¶
For a detailed description of the UDS communication layer including NRC handling policies, tester present behavior, functional group communication, and all communication parameters, see the UDS Communication section in the Architecture.
1.2. Terminology¶
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
1.3. Conventions¶
1.3.1. Sections¶
Section headers (ref) are created by underlining (and optionally overlining) the section title with a punctuation character, at least as long as the text:
#with overline, for components (e.g. classic diagnostic adapter, odx-converter)*with overline, for parts (about, requirements, architecture, design, implementation, tests)=for chapters within parts-for sections within chapters^for subsections"for subsubsections~for subsubsubsections
1.4. Traceability¶
Traceability in software development refers to the ability to link various artifacts and components of a software project throughout its lifecycle. This includes requirements, architecture, design documents, code and tests.
In this project, traceability is achieved through the use of sphinx-needs tools.
1.5. Conventions¶
1.5.1. Types¶
Need Type |
Description |
ID Pattern |
|---|---|---|
req |
Software Requirement |
|
arch |
Software Architecture |
|
impl |
Implementation |
|
dimpl |
Detailed Design & Implementation |
|
dsgn |
Detailed Design |
|
test |
Unit Test |
|
itest |
Integration Test |
|
Short description must only contain letters, numbers, and hyphens.
Generally speaking every requirement should be traced through architecture, design, implementation and tests. The design and implementation can be combined if desired. In trivial cases, it is acceptable to skip architecture and/or design.
Rationale
Combining design and implementation reduces overhead, and is acceptable when the design is straightforward, and it’s easier to show the design in code comments than in separate documents.
1.5.2. Properties¶
This section documents the metadata properties used on sphinx-needs items to support Automotive SPICE (ASPICE) process compliance. These properties enable consistent classification, maturity tracking, and review workflows across all documentation artifacts.
1.5.2.1. Status¶
The :status: option tracks the maturity of each documentation item through its lifecycle.
It applies to all need types (req, arch, dsgn, impl, dimpl, test, itest).
Status |
Description |
Applies To |
|---|---|---|
|
Item is being written or is incomplete. Content may change significantly. This is the default status for newly created items. |
All need types |
|
Item has been reviewed and is considered correct and complete. Content accurately reflects the intended behavior or design. |
All need types |
|
Item has been formally approved by a reviewer or stakeholder. Content is frozen and may only change through a formal change request. |
All need types |
|
Item has been reviewed and rejected. The item needs rework before it can be accepted. |
All need types |
|
Item is no longer applicable. It is retained for historical reference but should not be relied upon. |
All need types |
Items without an explicit :status: should be treated as draft.
1.5.2.2. Lifecycle¶
The typical status progression for an item is:
draft --> valid --> approved
Items may transition to rejected from draft or valid during review.
Items may transition to obsolete from any status when they are superseded or no longer needed.
Usage Example
.. req:: Example Requirement
:id: req~example
:status: draft
The system must do something.
1.5.3. Requirement Type¶
The :type: option classifies requirements by their nature. This is primarily relevant
for req needs, but may optionally be applied to arch and dsgn items for
additional classification.
Type |
Description |
|---|---|
|
Describes a behavior or capability the system must provide. Functional requirements define what the system does in response to inputs or conditions. |
|
Describes a quality attribute such as performance, reliability, availability, security, or maintainability. Non-functional requirements define how well the system performs. |
|
Describes an external interface or API contract. Interface requirements define the boundaries and communication protocols between the system and external entities. |
|
Describes a design or implementation constraint imposed by the environment, standards, or organizational policies. Constraints limit the solution space without describing system behavior. |
Usage Example
.. req:: HTTP-Server
:id: req~sovd-api-http-server
:status: valid
:type: functional
The CDA must provide an HTTP- or HTTPS-server.
1.5.3.1. Code¶
Code can be added to the traceability by utilizing sphinx-codelinks. The short format in a comment is as follows:
[[ <ID of the need>, <title>, <type>, <links> ]]
One-Line Example:
/// [[ dimpl~sovd.api.https.certificates, Handle HTTPS Certificates, dimpl, test~sovd.api.https.certificates ]]
/// description of the function
fn test {
...
}
Note
type and links are optional, if left empty, type will be dimpl
multi-line definitions are not supported at the time of writing by the src-trace directive.
1.5.4. Overviews¶
Software Requirements
ID |
Title |
Status |
|---|---|---|
Alive Check |
draft |
|
DoIP Communication Parameters |
draft |
|
DoIP Connection Management |
draft |
|
Diagnostic Message Exchange |
draft |
|
DoIP Error Handling |
draft |
|
DoIP Message Framing |
draft |
|
DoIP Protocol Version Support |
draft |
|
Routing Activation |
draft |
|
DoIP TLS Communication |
draft |
|
Vehicle Identification |
draft |
|
Database Loading |
draft |
|
Deferred Initialization |
draft |
|
DoIP Gateway Initialization |
draft |
|
ECU Discovery |
draft |
|
ECU States |
draft |
|
Startup Error Handling |
draft |
|
Startup Sequence |
draft |
|
Variant Detection |
draft |
|
Diagnostic Database Update Plugin |
draft |
|
Diagnostic Database Update Plugin - Authentication |
draft |
|
Diagnostic Database Update Plugin - Downgrade Protection |
draft |
|
Diagnostic Database Update Plugin - Safety |
draft |
|
Diagnostic Database Update Plugin - Verification |
draft |
|
DLT Logging |
draft |
|
DLT Logging - Context Identification |
draft |
|
DLT Logging - Compile-Time Feature Gate |
draft |
|
DLT Logging - Log Level Mapping |
draft |
|
DLT Logging - Runtime Configuration |
draft |
|
Data Type A_BYTEFIELD as Hex |
draft |
|
Communication Parameters API |
draft |
|
Component SDG/SDs |
draft |
|
Components Entity Collection |
draft |
|
Entity Data Types |
draft |
|
Explicit ECU Variant Detection |
draft |
|
Faults Endpoint |
draft |
|
Flash API |
draft |
|
Flash API - Data Source Restriction |
draft |
|
Functional Communication |
draft |
|
Health Monitoring Endpoint |
draft |
|
HTTP-Server |
draft |
|
HTTP-Server-Port |
draft |
|
HTTPS-Server configuration |
draft |
|
MDD Embedded files |
draft |
|
Support for mimetype application/octet-stream |
draft |
|
OpenAPI Documentation |
draft |
|
OpenAPI Schema |
draft |
|
Operations Handling |
draft |
|
Support for non-standard operation order |
draft |
|
Standalone OpenAPI Generator |
draft |
|
Standardized Resource Collection Mapping |
draft |
|
Vehicle Level Operations |
draft |
|
Version Data Endpoint |
draft |
|
Version Info Endpoint |
draft |
|
Version Registration Function |
draft |
|
Local File System Storage Access Implementation |
draft |
|
Default redb Persistence Provider |
draft |
|
Persistence API |
draft |
|
Systemd Watchdog Integration |
draft |
|
Storage Access Abstraction |
draft |
|
The CDA must support configuration of UDS communication as defined in the following table. |
draft |
|
UDS Functional Communication |
draft |
|
UDS Negative Response Code Handling |
draft |
|
UDS Request-Response Flow |
draft |
|
UDS Tester Present |
draft |
Software Architecture
ID |
Title |
Status |
|---|---|---|
Alive Check |
draft |
|
DoIP Communication Parameters |
draft |
|
DoIP Connection Establishment |
draft |
|
DoIP Connection Management |
draft |
|
Diagnostic Message Exchange |
draft |
|
DoIP Error Handling |
draft |
|
DoIP Message Framing |
draft |
|
DoIP Protocol Version Support |
draft |
|
Routing Activation |
draft |
|
TLS Connection Support |
draft |
|
Vehicle Identification |
draft |
|
Database Loading |
draft |
|
Deferred Initialization |
draft |
|
DoIP Gateway Initialization |
draft |
|
ECU Discovery |
draft |
|
ECU States |
draft |
|
Startup Error Handling |
draft |
|
Health Monitoring |
draft |
|
Startup Sequence |
draft |
|
Variant Detection |
draft |
|
Functional Communication API |
draft |
|
Functional Communication - Data |
draft |
|
Diagnostic description & Configuration |
draft |
|
Functional Communication ECU-Lock behavior |
draft |
|
Functional Communication - Modes |
draft |
|
Functional Communication - Operations |
draft |
|
Diagnostic Database Update Plugin |
draft |
|
DLT Logging |
draft |
|
DLT Logging - Configuration |
draft |
|
DLT Logging - Context Annotation |
draft |
|
Authentication Endpoints |
draft |
|
Bulk-Data Endpoints |
draft |
|
Communication Control Endpoints |
draft |
|
Communication Parameters API |
draft |
|
Retrieve Communication Parameters without Lock |
draft |
|
Component SDG/SDs |
draft |
|
Components Entity Collection |
draft |
|
Configuration Resources |
draft |
|
Data Identifier Categories |
draft |
|
Data Resources |
draft |
|
ODX to JSON data type mapping |
draft |
|
DTC Setting Endpoints |
draft |
|
ECU Resource Collection |
draft |
|
ECU Variant Detection via SOVD-API |
draft |
|
Faults endpoint |
draft |
|
Flash data transfer |
draft |
|
Management of flash files |
draft |
|
Flash folder configuration |
draft |
|
SOVD-API over HTTP |
draft |
|
MDD Embedded Files API |
draft |
|
Synchronous and Asynchronous Operations |
draft |
|
Security Access Endpoints |
draft |
|
Session Endpoints |
draft |
|
Single ECU Jobs Extension |
draft |
|
Standardized Resource Collection Mapping |
draft |
|
API Version Endpoint Registration Function |
draft |
|
Default redb Persistence Provider |
draft |
|
Persistence API |
draft |
|
Systemd Watchdog Integration |
draft |
|
Storage Access API |
draft |
|
UDS Communication Parameters |
draft |
|
UDS Functional Communication |
draft |
|
UDS NRC Handling |
draft |
|
UDS Request-Response Flow |
draft |
|
UDS Tester Present |
draft |
Detailed Design
ID |
Title |
Status |
|---|---|---|
Starts HTTP Server |
||
Register Version Endpoint |
||
Systemd Watchdog Integration |
||
Version Endpoint Integration Test |
||
Systemd Watchdog Health Aggregation Tests |
Implementation
ID |
Title |
Status |
|---|---|---|
Starts HTTP Server |
||
Register Version Endpoint |
||
Systemd Watchdog Integration |
||
Version Endpoint Integration Test |
||
Systemd Watchdog Health Aggregation Tests |
Unit Tests
No needs passed the filters
Integration Tests
No needs passed the filters