DEENESPTFRRUARHIKOZHNL

namespace apext::diag::uds_transport

User GuideAI-GENERATED

Serves the standardized integration and management of external UDS transport protocols in diagnostic management.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: ce8b113ec3f5 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves the standardized integration and management of external UDS transport protocols in diagnostic management.

The namespace apext::diag::uds_transport provides the C++ transport interface for decoupling generic diagnostic management from specific UDS transport protocols AUTOSAR_AP_SWS_Diagnostics §7.1 “UDS Transport Layer”. Protocol plugins derive from the base class UdsTransportProtocolHandler and pass through a strict lifecycle consisting of construction, initialization, start, and orderly stopping [SWS_DM_00329]. Incoming messages are reported via IndicateMessage and receive a memory-managed UdsMessagePtr for payload acquisition if capacity is available. A central constraint is that after stopping, no further calls to diagnostic management are permitted other than the confirmation message.

Context

The namespace apext::diag::uds_transport defines the standardized C++ transport interface (Transport Protocol API) for Diagnostic Management (DM) in the AUTOSAR Adaptive Platform AUTOSAR_AP_SWS_Diagnostics §7.1 “UDS Transport Layer”. The architecture functionally separates the generic core of Diagnostic Management from concrete network and transport layers. In this way, standardized protocols such as DoIP as well as future or vendor-specific transport protocols (for example for CAN, CAN-FD, or FlexRay) can be integrated as modular plugins AUTOSAR_AP_SWS_Diagnostics §7.1 “UDS Transport Layer”.

The central mediating instance is the class UdsTransportProtocolMgr, which coordinates the interaction between the instances of the Diagnostic Server and the attached transport protocols. Concrete protocol plugins derive from the abstract base class UdsTransportProtocolHandler AUTOSAR_AP_SWS_Diagnostics §7.1.1 “Support of UDS Transport Layer” [SWS_DM_00315]. Individual handler instances are addressed via UdsTransportProtocolHandlerID [SWS_DM_00336], while communication channels are identified via the type ChannelID [SWS_DM_00337]. To support periodic data queries according to ISO service 0x2A, the interface additionally incorporates the class UdsTransportProtocolPeriodicHandler.

Lifecycle

Diagnostic Management controls the lifecycle of each UdsTransportProtocolHandler instance in a strictly specified sequence [SWS_DM_00329]:

  1. Creation: The DM instantiates the protocol plugin via the constructor UdsTransportProtocolHandler::UdsTransportProtocolHandler [SWS_DM_00329].
  2. Initialization: The DM calls UdsTransportProtocolHandler::Initialize [SWS_DM_00329]. Except for querying GetPeriodicHandler, the DM must not call any further methods on the handler prior to the successful return of kInitializeOk [SWS_DM_01746].
  3. Start and operation: Following successful initialization, the handler is activated using UdsTransportProtocolHandler::Start. Only after this call does the DM process notifications about reactivated channels via UdsTransportProtocolMgr::ChannelReestablished [SWS_DM_01744].
  4. Termination: If the DM transitions to the state ApplicationState.kTerminating, it calls UdsTransportProtocolHandler::Stop for all active plugins [SWS_DM_00333]. After this call returns, the plugin may exclusively call UdsTransportProtocolMgr::HandlerStopped [SWS_DM_01741]. The DM actively waits for this confirmation [SWS_DM_00340].
handler_lifecycle NichtInitialisiert NichtInitialisiert Initialisierend Initialisierend NichtInitialisiert->Initialisierend Konstruktor Initialisiert Initialisiert Initialisierend->Initialisiert Initialize() -> kInitializeOk Fehlgeschlagen Fehlgeschlagen Initialisierend->Fehlgeschlagen Initialize() -> kInitializeFailed Gestartet Gestartet Initialisiert->Gestartet Start() Stoppend Stoppend Gestartet->Stoppend Stop() upon kTerminating Gestoppt Gestoppt Stoppend->Gestoppt HandlerStopped()

State diagram: Lifecycle phases and transition conditions of a transport protocol handler implementation. Sources: [SWS_DM_00329], [SWS_DM_00333], [SWS_DM_00340], [SWS_DM_01741], [SWS_DM_01744], [SWS_DM_01745], [SWS_DM_01746]

Usage Path

During ongoing operation, incoming diagnostic messages are forwarded via a coordinated interplay of handler and manager:

  1. Message indication: If the handler receives data on a channel (ChannelID [SWS_DM_00337]), it calls UdsTransportProtocolMgr::IndicateMessage. In doing so, it can pass advance payload in payloadInfo; at least the first two bytes are recommended for early detection of functional requests AUTOSAR_AP_SWS_Diagnostics §7.1 “UDS Transport Layer”.
  2. Buffer allocation: If the DM is ready to receive, IndicateMessage responds with a std::pair from IndicationResult::kIndicationOk and a valid smart pointer UdsMessagePtr [SWS_DM_00309] [SWS_DM_00385]. The referenced UdsMessage object has a minimum capacity of one byte [SWS_DM_00385]. The buffer is managed as a std::unique_ptr with a specific deleter of the DM core and is not thread-safe [SWS_DM_00303]. For read access, the constant equivalent UdsMessageConstPtr exists [SWS_DM_00304].
  3. Data handoff: The handler writes the received diagnostic data into the provided buffer, whose byte sequence is typed via the type ByteSpan (alias for ara::core::Span<ara::core::Byte> [SWS_DM_00338]). Presumably, providing the separate class UdsTransportProtocolPeriodicHandler via GetPeriodicHandler serves to decouple the periodic transmission service 0x2A from the regular UDS message path. Question Q-230ef0b7c384c594 (open)
Sequence of UDS message indicationHandlerUdsTransportProtocolMgrDM-KernIndicateMessage(channelId, payloadInfo)Check server state & resourcesaltDM bereitAllokiere UdsMessagereturn pair(kIndicationOk, UdsMessagePtr)Kopiere Nutzdaten in ByteSpanDM belegtreturn pair(kIndicationOccupied, nullptr)

Sequence diagram: Sequence of message indication and buffer allocation between handler, manager, and DM core. Sources: AUTOSAR_AP_SWS_Diagnostics §7.1 “UDS Transport Layer”, [SWS_DM_00303], [SWS_DM_00309], [SWS_DM_00385], [SWS_DM_00386]

Error Scenarios

The specification defines concrete error states and preconditions for the transport attachment:

  • Failed initialization: If UdsTransportProtocolHandler::Initialize returns the result kInitializeFailed, the DM immediately aborts the initialization process for this handler and calls no further methods on it [SWS_DM_01745].
  • Rejection when diagnostic core is busy: If the DM is blocked by ongoing service processing of the same Tester Present conversation and this is not a functional Tester Present with payloadInfo 0x3E 0x80, IndicateMessage returns the result kIndicationOccupied together with a nullptr instead of a message buffer [SWS_DM_00386].
  • Disallowed calls after termination: If a plugin calls a method of UdsTransportProtocolMgr other than HandlerStopped after Stop returns, this violates the protocol requirements [SWS_DM_01741]. Likewise, the DM ignores signals such as ChannelReestablished if they arrive prior to the successful call to Start [SWS_DM_01744].

This guide is based exclusively on the specifications of AUTOSAR Adaptive Platform Release R25-11.

Topic map

KI-gestützte Gruppierung auf Basis der Records und Spezifikationsauszüge; keine Gliederung aus der AUTOSAR-Spezifikation.

Class diagram

Abgerundete Rahmen = Namespace- bzw. Klassen-Scopes; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = namespace-fremde bzw. externe Basisklassen. Klicken öffnet die jeweilige Klassen- bzw. cppreference-Seite.

G cluster_ns apext::diag::uds_transport napext__diag__uds_transport__UdsMessage UdsMessage napext__diag__uds_transport__UdsTransportProtocolHandler UdsTransportProtocolHandler napext__diag__uds_transport__UdsTransportProtocolMgr UdsTransportProtocolMgr napext__diag__uds_transport__UdsTransportProtocolPeriodicHandler UdsTransportProtocolPeriodicHandler

Detail view

Select an entry in the outline.

Nachrichtendaten

class represents an UDS message exchanged between DM generic core (UdsTransport ProtocolMgr) and a specific implementation of UdsTransportPr

ByteSpan type alias

This is the type of ByteSpan.

using ByteSpan = ara::core::Span<ara::core::Byte>;

This is the unique_ptr for constant UdsMessages containing a custom deleter as provided by the generic/core DM part towards the UdsTransportLayer-Plugin.

using UdsMessageConstPtr = std::unique_ptr<const UdsMessage, std::function<void(const UdsMessage*)>>;
UdsMessagePtr type alias

This is the unique_ptr for UdsMessages containing a custom deleter as provided by the generic/ core DM part towards the UdsTransportLayer-Plugin.

using UdsMessagePtr = std::unique_ptr<UdsMessage, std::function<void(UdsMessage*)>>;

Protokoll-Plugins

Abstract Class, which a specific UDS Transport Protocol (plugin) shall subclass.

UdsTransportProtocolPeriodicHandler class to support 0x2A service from ISO.

UdsTransportProtocolHandler are flexible "plugins", which need an identification.

using UdsTransportProtocolHandlerID = std::uint8_t;

Protokollverwaltung

The UdsTransportProtocolMgr class manages the interaction between the Diagnostic Server instance(s) and various UDS Transport Protocols (e.g

ChannelID type alias

This is the identification of channel on which to transmit.

using ChannelID = std::uint32_t;

Type aliases

type alias ByteSpan [SWS_DM_00338] Upstream: RS_Diag_04147

using ByteSpan = ara::core::Span<ara::core::Byte>;

This is the type of ByteSpan.

Header-Datei#include "apext/diag/uds_transport/protocol_types.h"
Scopenamespace apext::diag::uds_transport
SymbolByteSpan

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

Record
AUTOSAR/AP/record/SWS_DM_00338
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00338@rel:R25-11#3f6b4b55
Content hash
3f6b4b55
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00338
Status: valid/unmigrated Version: rel:R25-11#1a041728 Versionshistorie & Revisions (1 transition, 8 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_00338@rel:R25-11#1a041728
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#3f6b4b552026-09-30
  • R19-11rel:R19-11#87b9aa052026-10-14
  • R20-11rel:R20-11#280ab9cb2026-10-14
  • R21-11rel:R21-11#280ab9cb2026-10-14
  • R22-11rel:R22-11#21aad9862026-10-14
  • R23-11rel:R23-11#a3af51d32026-10-14
  • R24-11rel:R24-11#1a0417282026-10-14
  • R25-11rel:R25-11#1a0417282026-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

type alias ChannelID [SWS_DM_00337] Upstream: RS_Diag_04147

using ChannelID = std::uint32_t;

This is the identification of channel on which to transmit.

Header-Datei#include "apext/diag/uds_transport/protocol_types.h"
Scopenamespace apext::diag::uds_transport
SymbolChannelID

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

Record
AUTOSAR/AP/record/SWS_DM_00337
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00337@rel:R25-11#a8972619
Content hash
a8972619
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00337
Status: valid/unmigrated Version: rel:R25-11#1d8116d5 Versionshistorie & Revisions (1 transition, 8 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_00337@rel:R25-11#1d8116d5
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#a89726192026-09-30
  • R19-11rel:R19-11#a09308352026-10-14
  • R20-11rel:R20-11#6bf394982026-10-14
  • R21-11rel:R21-11#6bf394982026-10-14
  • R22-11rel:R22-11#1855826a2026-10-14
  • R23-11rel:R23-11#3d08977c2026-10-14
  • R24-11rel:R24-11#1d8116d52026-10-14
  • R25-11rel:R25-11#1d8116d52026-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

type alias UdsMessageConstPtr [SWS_DM_00304] Upstream: RS_Diag_04147

using UdsMessageConstPtr = std::unique_ptr<const UdsMessage, std::function<void(const UdsMessage*)>>;

This is the unique_ptr for constant UdsMessages containing a custom deleter as provided by the generic/core DM part towards the UdsTransportLayer-Plugin.

Header-Datei#include "apext/diag/uds_transport/uds_message.h"
Scopenamespace apext::diag::uds_transport
SymbolUdsMessageConstPtr
Thread-Sicherheitnot thread-safe
Hinweise: How the exact typedef for UdsMessageConstPtr looks like, is up to the DM product vendor. I.e. how f.i. the deleter signature looks like ... basically the minimal agreement is: UdsMessage ConstPtr shall behave like a std::unique_ptr<const UdsMessage>!

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

Record
AUTOSAR/AP/record/SWS_DM_00304
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00304@rel:R25-11#8e407528
Content hash
8e407528
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00304
Status: valid/unmigrated Version: rel:R25-11#cbe7d8ab Versionshistorie & Revisions (1 transition, 8 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_00304@rel:R25-11#cbe7d8ab
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#8e4075282026-09-30
  • R19-11rel:R19-11#f70a6f152026-10-14
  • R20-11rel:R20-11#70977a452026-10-14
  • R21-11rel:R21-11#70977a452026-10-14
  • R22-11rel:R22-11#3632365b2026-10-14
  • R23-11rel:R23-11#ee76163c2026-10-14
  • R24-11rel:R24-11#6389682c2026-10-14
  • R25-11rel:R25-11#cbe7d8ab2026-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

type alias UdsMessagePtr [SWS_DM_00303] Upstream: RS_Diag_04147

using UdsMessagePtr = std::unique_ptr<UdsMessage, std::function<void(UdsMessage*)>>;

This is the unique_ptr for UdsMessages containing a custom deleter as provided by the generic/ core DM part towards the UdsTransportLayer-Plugin.

Header-Datei#include "apext/diag/uds_transport/uds_message.h"
Scopenamespace apext::diag::uds_transport
SymbolUdsMessagePtr
Thread-Sicherheitnot thread-safe
Hinweise: How the exact typedef for UdsMessagePtr looks like, is up to the DM product vendor. I.e. how f.i. the deleter signature looks like ... basically the minimal agreement is: UdsMessagePtr shall behave like a std::unique_ptr<UdsMessage>!

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

Record
AUTOSAR/AP/record/SWS_DM_00303
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00303@rel:R25-11#b75a0d13
Content hash
b75a0d13
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00303
Status: valid/unmigrated Version: rel:R25-11#6be645e6 Versionshistorie & Revisions (1 transition, 8 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_00303@rel:R25-11#6be645e6
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#b75a0d132026-09-30
  • R19-11rel:R19-11#401203282026-10-14
  • R20-11rel:R20-11#a5dd04072026-10-14
  • R21-11rel:R21-11#a5dd04072026-10-14
  • R22-11rel:R22-11#812335462026-10-14
  • R23-11rel:R23-11#057e29102026-10-14
  • R24-11rel:R24-11#fb6c8d462026-10-14
  • R25-11rel:R25-11#6be645e62026-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

type alias UdsTransportProtocolHandlerID [SWS_DM_00336] Upstream: RS_Diag_04147, RS_Diag_04168

using UdsTransportProtocolHandlerID = std::uint8_t;

UdsTransportProtocolHandler are flexible "plugins", which need an identification.

Header-Datei#include "apext/diag/uds_transport/protocol_types.h"
Scopenamespace apext::diag::uds_transport
SymbolUdsTransportProtocolHandlerID

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

Record
AUTOSAR/AP/record/SWS_DM_00336
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_DM_00336@rel:R25-11#44559d54
Content hash
44559d54
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Diagnostics.pdf#nameddest=SWS_DM_00336
Status: valid/unmigrated Version: rel:R25-11#dbbb3100 Versionshistorie & Revisions (1 transition, 8 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_00336@rel:R25-11#dbbb3100
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#44559d542026-09-30
  • R19-11rel:R19-11#d727dd482026-10-14
  • R20-11rel:R20-11#7d7439fe2026-10-14
  • R21-11rel:R21-11#7d7439fe2026-10-14
  • R22-11rel:R22-11#c079e14d2026-10-14
  • R23-11rel:R23-11#d98d683b2026-10-14
  • R24-11rel:R24-11#dbbb31002026-10-14
  • R25-11rel:R25-11#dbbb31002026-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