Serves as a generic UDS interface for the asynchronous processing of incoming diagnostic requests in the Diagnostic Manager.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: d0d38c589b70Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Serves as a generic UDS interface for the asynchronous processing of incoming diagnostic requests in the Diagnostic Manager.
As a generic UDS service handler, the ara::diag::GenericUDSService class enables receiving and processing arbitrary UDS diagnostic requests via the AUTOSAR Diagnostic Manager [SWS_DM_00616]. After binding to a port prototype, the service is activated via Offer(), processes requests asynchronously in the HandleMessage() method, and is deregistered again with StopOffer()[SWS_DM_00618], [SWS_DM_00619], [SWS_DM_00620]. The instance is neither copyable nor movable and signals errors via NRCs from DiagUdsNrcErrc[SWS_DM_01657], [SWS_DM_00618].
Context
The ara::diag::GenericUDSService class provides a generic service interface for diagnostic communication according to UDS (Unified Diagnostic Services). It serves as a base class for applications that want to implement and process custom UDS services or UDS services not covered by dedicated interfaces. Interaction essentially takes place between the diagnosing application component, the AUTOSAR Diagnostic Manager (DM), and the underlying modeling context. Connecting to the Diagnostic Manager and the platform model takes place during instantiation via an ara::core::InstanceSpecifier that references a corresponding port prototype of an DiagnosticGenericUdsInterface[SWS_DM_00616]. As soon as registration via the interface is activated, the Diagnostic Manager forwards incoming UDS requests to the implemented instance [SWS_DM_00619].
An instance of ara::diag::GenericUDSService is bound to a fixed port prototype and designed as a single instance: copy constructor [SWS_DM_01657], move constructor [SWS_DM_01658], as well as assignment operators [SWS_DM_01655], [SWS_DM_01656] are deleted (delete). Creation takes place explicitly via the constructor specifying an InstanceSpecifier and the concurrency configuration ConcurrencyType (kConcurrent or kNotConcurrent) [SWS_DM_00616]. The lifecycle of service readiness is divided into two main phases:
Not offered (Stopped / Initial): After construction or after calling StopOffer(), the DM does not forward any requests to the instance [SWS_DM_00620].
Offered: After successfully calling Offer(), the handler is active and processes incoming diagnostic messages [SWS_DM_00619].
Destruction takes place via the virtual destructor ~GenericUDSService()[SWS_DM_00584]. With regard to thread safety, the constructor is specified as thread-safe, whereas Offer(), StopOffer(), and the destructor are not thread-safe and require external synchronization [SWS_DM_00616], [SWS_DM_00619], [SWS_DM_00620], [SWS_DM_00584].
The regular flow comprises instantiating the derived service class, enabling the handler, asynchronous request processing, and subsequent deactivation:
Instantiation: The application instantiates the specialized service class with the matching ara::core::InstanceSpecifier and the desired ConcurrencyType[SWS_DM_00616].
Offer service: Calling Offer() signals readiness to accept messages to the Diagnostic Manager [SWS_DM_00619].
Message processing: Incoming UDS requests lead to the DM calling the pure virtual method HandleMessage(). Passed parameters are service identifier (sid), payload (requestData), metadata (metaInfo), and a cancellationHandler[SWS_DM_00618]. The method returns a ara::core::Future<OperationOutput> through which the result or an error is provided asynchronously [SWS_DM_00618]. The handler can check via cancellationHandler.IsCanceled() whether the operation was canceled, or register a notification via cancellationHandler.SetNotifier()[SWS_DM_00618].
Stop service: By means of StopOffer(), the forwarding of requests is stopped before the instance is destroyed [SWS_DM_00620], [SWS_DM_00584].
Error situations can occur in various phases and require differentiated handling:
Instantiation violations: If mapping the InstanceSpecifier in the model fails, the framework reports defined violations: InstanceSpecifierMappingIntegrityViolation (specifier cannot be resolved in the model or does not reference an PortPrototype), PortInterfaceMappingViolation (port is not referenced via an DiagnosticServiceGenericMapping), ProcessMappingViolation (no matching process modeled), or InstanceSpecifierAlreadyInUseViolation (specifier is already used in the process) [SWS_DM_00616].
Duplicate offer call: If Offer() is called even though the service is already actively offered, the call fails and returns the error code DiagOfferErrc::kAlreadyOffered (rollback semantics) [SWS_DM_00619].
Diagnostic-related execution errors: If a UDS message cannot be answered positively from a domain perspective in HandleMessage(), the result in the Future must be set with an appropriate Negative Response Code (NRC) according to ISO 14229-1 via DiagUdsNrcErrc[SWS_DM_00618]. In addition, the implementation must react to cancellation signals of the cancellationHandler if the underlying diagnostic conversation was terminated prematurely [SWS_DM_00618].
This class guide was generated automatically based on the AUTOSAR standard.
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 DiagnosticGenericUdsInterface needs to be referenced by a DiagnosticServiceGenericMapping. 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 DiagnosticGenericUdsInterface.
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.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 38c6453769b1Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method HandleMessage from ara::diag::GenericUDSService serves for application-specific processing of incoming UDS diagnostic requests [SWS_DM_00618].
use
Diagnostic Management (DM) calls the method for each received diagnostic request message [SWS_DM_00618]. Based on the parameters, the service identifier (sid), the payload (requestData as ara::core::Span<const std::uint8_t>), connection information (metaInfo), and a cancellationHandler are passed. Processing occurs asynchronously via the return of a ara::core::Future<OperationOutput>[SWS_DM_00618]. The payload in requestData remains valid until the associated promise is fulfilled or the operation is canceled. Via cancellationHandler.IsCanceled(), the application can check the cancellation status or register a notification for session cancellations by means of cancellationHandler.SetNotifier()[SWS_DM_00618].
Error handling
If a request cannot be processed successfully, the application signals the error via the returned future by means of an appropriate negative response code (NRC according to ISO 14229-1) via DiagUdsNrcErrc[SWS_DM_00618].
Concurrency and Constraints
Lifetime of metaInfo: The validity of the metaInfo object is strictly limited to the active execution duration of the method call [SWS_DM_01345]. Storing or using it after return from HandleMessage results in undefined behavior.
Reentrancy and Concurrency: The ara::diag::ConcurrencyType defined in the constructor determines whether calls must be thread-safe SWS Diagnostics §7.3.1.2 “Concurrency of ara::diag interfaces”. In the case of kConcurrent, the DM may call subsequent requests in parallel; in the case of kNotConcurrent, the DM waits until the result of the ongoing request has been provided.
This usage note was generated automatically based on the AUTOSAR Adaptive R25-11 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
sid
Diagnostic Request Service Identifier.
requestData
Diagnostic request data (starting after SID). 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.
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: 19027d24302fProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The method Offer of class ara::diag::GenericUDSService enables the forwarding of diagnostic requests: it allows the Diagnostic Manager (DM) to forward incoming UDS request messages to this handler [SWS_DM_00619]. The synchronous call has no parameters, is non-blocking, and returns a ara::core::Result<void>[SWS_DM_00619]. Execution would typically (Interpretation:) take place during the initialization and startup phase of the Adaptive Application, before diagnostic messages need to be processed over the network. Question Q-c1e385a434fe1e4e (open)
Error Handling and Concurrency
The function is declared with noexcept and guarantees exception safety [SWS_DM_00619]. If the service was already previously offered, the registration fails and returns the error code DiagOfferErrc::kAlreadyOffered with rollback semantics [SWS_DM_00619]. Regarding thread safety, the interface is specified as not thread-safe[SWS_DM_00619]; concurrent calls on the same instance must be synchronized by the calling application.
Interaction
Offering via Offer corresponds to the standardized registration pattern in the AUTOSAR Adaptive diagnostic subsystem, as specified similarly for routines ([SWS_DM_00557]) or data identifiers ([SWS_DM_00638]). Although the nomenclature is based on ara::com, it is a diagnostics-specific method of the Diagnostic Manager AUTOSAR_AP_SWS_Diagnostics §7.3.4.1.2 “Monitors”.
This usage note was generated by an AI based on the AUTOSAR specification R25-11.
This StopOffer will disable the forwarding of request messages from DM.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 5dba8a8b4077ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The method StopOffer of class ara::diag::GenericUDSService disables the forwarding of incoming diagnostic requests from Diagnostic Management (DM) to the service instance [SWS_DM_00620]. The function is provided via header ara/diag/generic_uds_service.h, expects no parameters, and has the return type void[SWS_DM_00620].
Error handling
The method is specified with noexcept and as exception safe (exception safe) [SWS_DM_00620]. It throws no exceptions and returns no error codes; stopping the forwarding occurs deterministically.
Concurrency and Limitations
According to the specification, StopOffer is classified as not thread-safe[SWS_DM_00620]. Parallel calls for the same instance must be synchronized on the application side. Interpretation: The call to StopOffer is likely to occur typically prior to the destruction of the instance object or during temporary unavailability in order to prevent pending forwardings. Question Q-408323dd00c313c0 (open)
gemini-3.8-flash-low· 2026-10-13 · German original