Enables applications to generically handle UDS read and write requests for diagnostic identifiers.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 02c252ff66d0ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables applications to generically handle UDS read and write requests for diagnostic identifiers.
The class ara::diag::GenericDataIdentifier serves as a generic interface for the asynchronous processing of UDS read and write requests for diagnostic identifiers in AUTOSAR Adaptive [SWS_DM_00636]. After binding to a port and enabling via Offer(), Diagnostic Management forwards requests to the implemented methods [SWS_DM_00638]. As a singular instance, the object can neither be copied nor moved, while the thread safety of request processing is controlled via the concurrency configuration selected during construction.
Context
The class ara::diag::GenericDataIdentifier represents a generic service interface within the functional cluster Diagnostic Management (DM) of the AUTOSAR Adaptive Platform SWS Diagnostics §8.2 “GenericDataIdentifier”. While type-specific interfaces are bound to firmly modeled data types, GenericDataIdentifier serves the flexible processing of diagnostic identifiers (Data Identifiers, DIDs), where the 16-bit identifier is passed dynamically as a parameter.
Diagnostic processing primarily involves three roles:
The external diagnostic tester, which directs standardized UDS services such as ReadDataByIdentifier (0x22) or WriteDataByIdentifier (0x2E) to the vehicle.
Diagnostic Management (DM), which accepts diagnostic requests, validates them, and forwards them to the corresponding application instance via defined port interfaces, provided it was previously activated via Offer[SWS_DM_00638].
The application-specific implementation of GenericDataIdentifier, which encapsulates the actual processing logic by providing the methods Read[SWS_DM_00636] and Write[SWS_DM_00637] and returning the data asynchronously.
Lifecycle
An instance of ara::diag::GenericDataIdentifier is explicitly instantiated via its constructor [SWS_DM_00634]. In doing so, the caller binds the object to an ara::core::InstanceSpecifier referencing an PortPrototype of a modeled DiagnosticDataIdentifierGenericInterface. Via the argument concurrencyType (of type DataIdentifierConcurrencyType), it is specified whether requests are passed concurrently (kConcurrent) or sequentially (kNotConcurrent) to the handler [SWS_DM_00634].
Regarding ownership and lifetime, GenericDataIdentifier is modeled as a singular, non-copyable, and non-movable instance:
After instantiation, the object is in the inactive state; Diagnostic Management does not yet forward requests. Forwarding is only activated by calling Offer()[SWS_DM_00638]. To deactivate the forwarding of diagnostic requests again, the application calls StopOffer()[SWS_DM_00639]. The object is destroyed via the virtual destructor [SWS_DM_00635].
In terms of concurrency, the constructor is thread-safe (thread-safe) [SWS_DM_00634]. In contrast, the administrative methods Offer()[SWS_DM_00638] and StopOffer()[SWS_DM_00639] as well as the destructor [SWS_DM_00635] are specified as not thread-safe. The thread safety of the methods Read and Write conditionally depends on the selected concurrencyType[SWS_DM_00636], [SWS_DM_00637].
A typical end-to-end flow for handling diagnostic requests is divided into the following steps:
Initialization: The application instantiates its derived handler class, specifying the InstanceSpecifier and the concurrency configuration [SWS_DM_00634]. Interpretation: In practice, this likely typically occurs during the initialization phase of the application process. Question Q-32596fba68253958 (open)
Service provision: The application calls Offer()[SWS_DM_00638]. Diagnostic Management activates the forwarding of incoming DID requests.
Request processing:
If a read request is received, the DM calls the method Read(dataIdentifier, metaInfo, cancellationHandler)[SWS_DM_00636]. The application checks the passed 16-bit identifier and asynchronously returns a ara::core::Future<OperationOutput>.
If a write request arrives, the DM calls Write(dataIdentifier, requestData, metaInfo, cancellationHandler)[SWS_DM_00637]. The payload data in requestData remains valid until the associated promise is fulfilled or processing is canceled.
Cancellation check: During lengthy operations, the handler can check via cancellationHandler.IsCanceled() whether the conversation was cancelled, or register a notification function via cancellationHandler.SetNotifier[SWS_DM_00636], [SWS_DM_00637].
Service de-registration: Before terminating the handler, the application calls StopOffer()[SWS_DM_00639], whereupon DM stops forwarding.
Sequence diagram: Interaction between external tester, Diagnostic Management, and GenericDataIdentifier during a UDS read request. Sources: [SWS_DM_00638], [SWS_DM_00636]
Error Scenarios
Errors can occur in different phases of the interaction:
Configuration and mapping violations: If InstanceSpecifier cannot be resolved in the model or does not reference a PortPrototype, a InstanceSpecifierMappingIntegrityViolation is present [SWS_DM_00634]. If the mapping to a DiagnosticDataPortMapping is missing, a PortInterfaceMappingViolation occurs [SWS_DM_00634]. A missing process mapping generates a ProcessMappingViolation, and an already used InstanceSpecifier leads to a InstanceSpecifierAlreadyInUseViolation[SWS_DM_00634].
Multiple offering: If Offer() is called even though the service is already actively offered, the method returns a ara::core::Result with the error code DiagOfferErrc::kAlreadyOffered[SWS_DM_00638].
Domain-specific diagnostic errors: If a read or write request cannot be served functionally, the application returns no success status in Future, but rather a standardized UDS NRC (Negative Response Code) via DiagUdsNrcErrc in accordance with ISO 14229-1 [SWS_DM_00636], [SWS_DM_00637].
This guide is based on the AUTOSAR specification R25-11 and was generated automatically.
InstanceSpeci- InstanceSpecifier either cannot be resolved in the model in the fierMappingIn- context of your executable, or it refers to a model element other tegrityViolation than a PortPrototype. PortInterfaceMap- A PortPrototype that is typed by a pingViolation DiagnosticDataIdentifierGenericInterface needs to be referenced by a DiagnosticDataPortMapping. ProcessMappingVio- Matching InstanceRef exists, but no matching (modelled) Process lation found that matches the (runtime) process. InstanceSpecifier- Violation message that is sent in case a constructor in the ara AlreadyInUseViola- framework was called with an InstanceSpecifier already in use in tion this process.
Parameter (in)
Parameter
Beschreibung
specifier
InstanceSpecifier to a PortPrototype of a DiagnosticDataIdentifierGenericInterface.
concurrencyType
Specifies if the interface is implemented as thread safe ( kConcurrent) or non-thread safe (kNotConcurrent)
Request a governed re-review of this record. The record is not changed immediately.
This Offer will enable the DM to forward request messages to this handler.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 860e6bd15d7fProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Usage: The synchronous method Offer of class ara::diag::GenericDataIdentifier ([SWS_DM_00638]) serves to register a generic data identifier handler with Diagnostic Management (DM). By this call, the DM is authorized to forward incoming diagnostic requests (request messages) for the respective data identifier to this handler ([SWS_DM_00638]). The function takes no input parameters and synchronously returns a ara::core::Result<void> ([SWS_DM_00638]) that provides information about success or error.
Error handling: The method is declared with noexcept and guarantees complete exception safety (exception safe) ([SWS_DM_00638]). Possible errors are reported via the ara::core::Result. If the handler was already offered previously, the function returns the error code DiagOfferErrc::kAlreadyOffered with rollback semantics ([SWS_DM_00638]). This corresponds to the general error enumeration DiagErrc::kAlreadyOffered ([SWS_DM_00514]).
Concurrency and limitations: The function is specified as not thread-safe (not thread-safe) ([SWS_DM_00638]). Consequently, calls on the same instance must be protected against access. Since no separate deregistration method is specified for GenericDataIdentifier, the service offer is presumably tied to the lifetime of the handler instance (interpretation). Question Q-7c64a5bd308464a8 (open)
Interplay: The procedure follows the consistent offering pattern of Diagnostic Management. Analogous interfaces are found for type-specific data identifiers ([SWS_DM_00599]), generic routines ([SWS_DM_00557]), and generic UDS services ([SWS_DM_00619]).
Called for ReadDataByIdentifier request for this DiagnosticDataIdentifier.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 7772a86b7791Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The method Read of class ara::diag::GenericDataIdentifier is called as soon as a diagnostic request for ReadDataByIdentifier (UDS 0x22) is received for the respective data identifier [SWS_DM_00636]. As parameters, the function accepts the numeric identifier dataIdentifier, the context metaInfo, and a cancellationHandler. Via the cancellationHandler, the application can query the cancellation status by means of IsCanceled or register a notification function for canceled conversations via SetNotifier[SWS_DM_00636]. The result is provided asynchronously via a ara::core::Future<OperationOutput>, which returns the payload (OperationOutput) in the case of success [SWS_DM_00636].
Error handling
In the event of an error, the Future returns a negative UDS return value (NRC) according to ISO 14229-1 via DiagUdsNrcErrc[SWS_DM_00636]. If the interface is not yet or no longer offered via offer(), Diagnostic Management (DM) responds autonomously with NRC 0x94 (ResourceTemporarilyNotAvailable) [SWS_DM_01257]. If the configured limit of Response Pending messages is reached, the server aborts processing and responds with NRC 0x10 (generalReject) [SWS_DM_00369].
Concurrency and Interaction
The method is declared as noexcept and exception safe [SWS_DM_00636]. Its thread safety is conditional: Whether the implementation must be thread-safe is controlled via the ConcurrencyType passed in the constructor [SWS_DM_00636]. If readWrite is set to kConcurrent, the DM may initiate read and write accesses concurrently; otherwise (kNotConcurrent), the call occurs sequentially [SWS_DM_00939]. In contrast to specific interfaces such as [SWS_DM_00640], GenericDataIdentifier covers generic DID ranges flexibly via the passed ID [SWS_DM_00636].
This usage note was generated automatically based on the AUTOSAR specification.
conditional whether the function has to be implemented thread safe or non-thread safe is determined by the ConcurrencyType given in the constructor
Parameter (in)
Parameter
Beschreibung
dataIdentifier
the corresponding DataIdentifier
metaInfo
MetaInfo of the request.
cancellationHandler
This parameter is used to • Query the current cancellation status by calling cancellationHandler.IsCanceled. Returns TRUE in case, the current conversation has been cancelled and FALSE otherwise. • Register a notifier function by calling cancellationHandler.SetNotifier. The registered notifier is called if the current conversation is cancelled.
This StopOffer will disable the forwarding of request messages from DM.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: bd73a88bfde2ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Usage and Call Context
The member function StopOffer of class ara::diag::GenericDataIdentifier serves to disable the forwarding of incoming request messages from Diagnostic Management (DM) to the respective instance [SWS_DM_00639]. The call is performed synchronously via the interface from the header file #include "ara/diag/generic_data_identifier.h"[SWS_DM_00639]. The function has the signature void StopOffer() noexcept;, takes no input parameters, and returns no return value [SWS_DM_00639].
Error Handling and Concurrency
The specification defines StopOffer as exception-safe (exception safe) and guarantees the absence of exceptions via the identifier noexcept[SWS_DM_00639]. Specific error codes, error reactions, or notifications to DET or DEM are not provided for this operation. With regard to concurrency, the method is classified as not thread-safe (not thread-safe) [SWS_DM_00639]. Parallel calls on the same instance must therefore be synchronized by the caller. Interpretation: Requests already started in Diagnostic Management are likely to still be processed regularly before forwarding is definitively stopped. Question Q-94a464dc832c055c (open)
Interplay in the Diagnostic Module
The pattern for revoking service provision is standardized and consistently used in the diagnostic module. Analogous StopOffer methods exist, among others, for:
type-specific data identifiers via DataIdentifierInterface::StopOffer[SWS_DM_00600] as well as data elements [SWS_DM_00617],
generic routines via GenericRoutine::StopOffer[SWS_DM_00558] and type-specific routine interfaces [SWS_DM_00595],
Called for WriteDataByIdentifier request for this DiagnosticDataIdentifier.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 7b195835c98cProvenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method Write of class ara::diag::GenericDataIdentifier is called by Diagnostic Management as soon as a UDS request of service WriteDataByIdentifier (0x2E) is received [SWS_DM_00637]. A prerequisite for the call is that the requested data identifier is supported and the respective diagnostic session as well as security level permit execution [SWS_DM_00186], [SWS_DM_00415], [SWS_DM_00416].
The call occurs with the following parameters [SWS_DM_00637]:
dataIdentifier: The 16-bit identifier of the data identifier to be written.
requestData: A ara::core::Span containing the raw data of the request without DID prefix. The buffer remains valid until the associated promise is fulfilled or processing is canceled.
metaInfo: Additional metadata for the diagnostic request.
cancellationHandler: Serves for monitoring an early cancellation of the conversation via IsCanceled as well as registering a cancellation notification via SetNotifier.
Execution is asynchronous and returns a ara::core::Future<void>[SWS_DM_00637]. Upon successful processing, the promise is fulfilled with void for a positive response message. If an error occurs, the future is to be completed with a matching negative UDS return value (NRC) according to ISO 14229-1 via DiagUdsNrcErrc[SWS_DM_00637]. The method is declared as noexcept and must be implemented exception safe [SWS_DM_00637].
Regarding concurrency, thread safety is conditional: Whether Write must be implemented thread-safe depends on the ConcurrencyType passed during instantiation in the constructor [SWS_DM_00637]. Parallel execution of read and write accesses is controlled via the flag readWrite[SWS_DM_00939].
This text was created by an AI. All statements are based exclusively on the specifications of Release R25-11.
conditional whether the function has to be implemented thread safe or non-thread safe is determined by the ConcurrencyType given in the constructor
Parameter (in)
Parameter
Beschreibung
dataIdentifier
the corresponding DataIdentifier
requestData
Content of request message (without DataIdentifier). Lifetime: Valid until Promise is fulfilled or the processing is cancelled by the cancellationHandler.
metaInfo
MetaInfo of the request.
cancellationHandler
This parameter is used to • Query the current cancellation status by calling cancellationHandler.IsCanceled. Returns TRUE in case, the current conversation has been cancelled and FALSE otherwise. • Register a notifier function by calling cancellationHandler.SetNotifier. The registered notifier is called if the current conversation is cancelled.
gemini-3.8-flash-low· 2026-10-13 · German original