Enables the application to provide ECU data for UDS uploads to Diagnostic Management.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: e2e1ae703412ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables the application to provide ECU data for UDS uploads to Diagnostic Management.
The class ara::diag::UploadService serves as an application-side service interface for providing ECU data for external diagnostic uploads according to UDS [SWS_DM_00797]. After successful activation via Offer(), the handler asynchronously processes the successive requests for upload initiation, data block transfer, and transfer termination [SWS_DM_00802]. The non-copyable service instance supports both block-by-block data transfers and premature cancellation via a cancellation handler. The handler acknowledges erroneous requests via negative UDS response codes within the asynchronous response futures.
Context
The class ara::diag::UploadService defines the central service interface for diagnostic upload operations within the AUTOSAR Adaptive Platform [SWS_DM_00797]. It acts as an application-side handler for reading out and providing in-vehicle data to external test equipment according to the diagnostic standard UDS (ISO 14229-1) [SWS_DM_00799].
In the system architecture, ara::diag::UploadService essentially interacts with two partners: the external diagnostic client (tester) and the platform-side diagnostic daemon Diagnostic Management (DM) [SWS_DM_00799], [SWS_DM_00802]. The DM receives incoming UDS service requests such as RequestUpload, TransferData, and RequestTransferExit at protocol level, validates them, and forwards the technical queries to the registered handler of the application [SWS_DM_00799], [SWS_DM_00800], [SWS_DM_00801]. The application instance implements the virtual methods of the interface in order to read the actual data blocks from memory and return them [SWS_DM_00800].
Context diagram: Integration of the upload service between diagnostic client, Diagnostic Management, and application handler. Sources: [SWS_DM_00797], [SWS_DM_00799], [SWS_DM_00802].
Lifecycle
An instance of ara::diag::UploadService is constructed by specifying an ara::core::InstanceSpecifier as well as the concurrency behavior concurrencyType[SWS_DM_00797]. The specifier links the instance to a modeled port prototype of type DiagnosticUploadInterface[SWS_DM_00797]. The constructor is specified as exception-safe and thread-safe [SWS_DM_00797]. To guarantee a unique assignment of the service instance, copy and move constructors as well as assignment operators are explicitly deleted [SWS_DM_01671], [SWS_DM_01672], [SWS_DM_01673], [SWS_DM_01674].
After instantiation, the service is initially in the inactive state; the DM does not forward any requests yet. Only explicit invocation of Offer() activates the forwarding [SWS_DM_00802]. The forwarding of requests can be stopped again at any time via StopOffer()[SWS_DM_00803]. Both Offer() and StopOffer() are defined as not thread-safe and require external synchronization when called from multiple threads [SWS_DM_00802], [SWS_DM_00803].
Destruction takes place via the virtual destructor ~UploadService(), which is likewise not thread-safe [SWS_DM_00798]. Prior to releasing the object, the service should therefore be properly deregistered via StopOffer()[SWS_DM_00803]. Whether the virtual processing methods must be executed thread-safely internally is determined by the ConcurrencyType configured during construction (kConcurrent or kNotConcurrent) [SWS_DM_00797], [SWS_DM_00799].
Usage Path
The regular sequence of an upload session takes place in several successive steps:
Service provision: The application initializes the handler and calls Offer() to receive incoming diagnostic requests from the DM [SWS_DM_00802].
Request upload (RequestUpload): If a UDS request to initiate an upload arrives, the DM calls the method RequestUpload()[SWS_DM_00799]. The handler checks data format, addressing format as well as memory address and length (memoryAddressAndSize). The passed memory area remains valid until the returned ara::core::Future<void> is fulfilled or the operation is cancelled [SWS_DM_00799].
Transfer data blocks (UploadData): After successful initiation, the tester sends UDS TransferData requests. The DM then repeatedly calls UploadData()[SWS_DM_00800]. The application reads the requested data block and returns it via a ara::core::Future<OperationOutput>; the bytes in OperationOutput.responseData are placed in the positive response after the block counter [SWS_DM_00800]. Interpretation: The buffer limitation numBytesToReturn is likely to act here as the maximum chunk size for the internal buffering of the DM, so that larger memory areas are segmented sequentially via successive calls. Question Q-6ede2e3041d99294 (open)
Terminate transfer (RequestUploadExit): To conclude, the DM calls RequestUploadExit() and passes the manufacturer-specific transfer parameters in transferRequestParameterRecord[SWS_DM_00801]. The handler validates the completion and returns optional return parameters in OperationOutput[SWS_DM_00801].
Deactivate service: After completion of all upload transactions or during shutdown, the application stops forwarding with StopOffer()[SWS_DM_00803].
Throughout data transfer, the handler receives a CancellationHandler object. Via this object, the cancellation status can be actively queried using IsCanceled(), or a callback can be registered via SetNotifier() in case the tester cancels the dialogue prematurely [SWS_DM_00799], [SWS_DM_00800], [SWS_DM_00801].
Error states can occur during construction, during activation, and during actual data handling:
Model and configuration violations: If the configuration does not match the ARXML model, violations occur during the constructor call [SWS_DM_00797]. These include InstanceSpecifierMappingIntegrityViolation (specifier does not reference a PortPrototype), PortInterfaceMappingViolation (missing link via DiagnosticServiceGenericMapping), ProcessMappingViolation (no match with the modeled process), and InstanceSpecifierAlreadyInUseViolation (multiple use of the same specifier within a process) [SWS_DM_00797].
Multiple service activation: If Offer() is called while the service is already being offered, the call fails and returns the error code DiagOfferErrc::kAlreadyOffered in ara::core::Result<void>[SWS_DM_00802].
UDS error responses (Negative Response): If the handler cannot technically service a request in RequestUpload(), UploadData(), or RequestUploadExit() (e.g. invalid memory addresses, format errors, or invalid sequence counters), it signals this by providing an error code from DiagUdsNrcErrc in the returned Future[SWS_DM_00799], [SWS_DM_00800], [SWS_DM_00801]. The DM then generates a standard-compliant negative UDS response (NRC) to the external test equipment [SWS_DM_00799].
This guide is based exclusively on the specification AUTOSAR Adaptive Platform Release R25-11.
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: dce89cbe34efProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Usage and Semantics
The synchronous member function Offer of class ara::diag::UploadService ([SWS_DM_00802]) enables the forwarding of diagnostic requests by Diagnostic Management (DM) to the registered handler. The call takes no parameters and declares exception safety noexcept ([SWS_DM_00802]). ara::core::Result<void> acts as the return type, representing successful offering or an error that occurred ([SWS_DM_00802]).
Error Handling and Concurrency
Error Codes: If the service was already offered previously, execution fails with the error code DiagOfferErrc::kAlreadyOffered ([SWS_DM_00802]); rollback semantics apply here.
Thread Safety: The function is explicitly specified as not thread-safe ([SWS_DM_00802]). Concurrent calls on the same service instance must be synchronized on the application side.
Interplay in the Diagnostic Subsystem
The operation integrates into the uniform offering pattern of adaptive diagnostic handlers, as used among others with DownloadService ([SWS_DM_00792]) or GenericUDSService ([SWS_DM_00619]). As long as offering has not occurred, the DM does not forward incoming diagnostic messages to the handler (cf. analogous behaviors in [SWS_DM_01525]). Interpretation: The call to Offer is likely to occur typically during the initialization phase of the application before diagnostic traffic is accepted. Question Q-aba091d233b5e45b (open)
This usage note was generated automatically based on the AUTOSAR specification R25-11.
dataFormatIdentifier and addressAndLengthFormatIdentifier: UDS format identifiers for data, memory address, and length specifications.
memoryAddressAndSize: A ara::core::Span containing memory address and size, whose validity is guaranteed until fulfillment of the promise or cancellation of processing.
metaInfo: Meta-information on the diagnostic request.
cancellationHandler: Serves to query the cancellation status via cancellationHandler.IsCanceled and to register notification functions by means of cancellationHandler.SetNotifier.
Processing is performed asynchronously with the return type ara::core::Future<void>[SWS_DM_00799].
Error handling
In case of an error, the ara::core::Future provides an appropriate UDS NRC error code according to ISO 14229-1 via DiagUdsNrcErrc, whereupon a negative response occurs [SWS_DM_00799]. Upon a positive response, the Diagnostic Manager reports the security event SEV_UDS_REQUEST_UP_DOWNLOAD_SUCCESSFUL to the IdsM [SWS_DM_02031], upon a negative response the event SEV_UDS_REQUEST_UP_DOWNLOAD_FAILED[SWS_DM_02033].
Concurrency and Interaction
The function is declared as noexcept and is exception-safe. Whether the method must be implemented thread-safely is conditional and is defined via the ConcurrencyType passed in the constructor [SWS_DM_00799].
After successful confirmation of RequestUpload, the actual upload data transfer is continued via UploadData on subsequent requests of UDS service 0x36 (TransferData) [SWS_DM_00800][SWS_DM_01096].
This usage note was generated by artificial intelligence 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
dataFormatIdentifier
UDS dataFormat Identifier
addressAndLengthFormatIdentifier
UDS addressAndLengthFormatIdentifier
memoryAddressAndSize
memoryAddress and memorySize part of the request. 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.
The interface takes the following parameters [SWS_DM_00801]:
transferRequestParameterRecord: Contains vendor-specific parameters to support the transfer in format ara::core::Span<const std::uint8_t>. The data remain valid until the associated promise is fulfilled or processing is canceled. Interpretation: The evaluation of these parameters is likely to serve primarily vendor-specific validations upon completion of the upload. Question Q-d3989837f58761d7 (open)
metaInfo: Passes meta-information of the current diagnostic request.
cancellationHandler: Enables querying the cancellation status via cancellationHandler.IsCanceled() or registering a notification callback by means of cancellationHandler.SetNotifier().
Return Values and Error Handling
Execution is performed asynchronously and returns a ara::core::Future<OperationOutput>[SWS_DM_00801]. In case of success, the future is fulfilled with an instance of OperationOutput. The data from responseData passed therein are inserted after the service ID as transferResponseParameterRecord into the positive diagnostic response [SWS_DM_00796], [SWS_DM_00801]. In case of an error, the future must be completed with an appropriate error code from DiagUdsNrcErrc according to ISO 14229-1 [SWS_DM_00801].
Concurrency and Limitations
The method is specified as noexcept[SWS_DM_00801]. The requirement for thread safety is conditional: whether the function must be executed thread-safely is defined via the ConcurrencyType passed in the constructor of UploadService[SWS_DM_00801].
This usage note is based on the specifications in AUTOSAR AP SWS Diagnostics 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
transferRequestParameterRecord
This parameter record contains parameter(s), which are required by the server to support the transfer of data. Format and length of this parameter(s) are vehicle manufacturer specific. 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.
A Future, which either gets readied to OperationOutput (transfer ResponseParameterRecord for a positive response message) or readied with ErrorCode from DiagUdsNrcErrc (for an negative response message). Data in OperationOutput.responseData will be placed after SID as transferResponseParameterRecord in the positive response.
Fehler
Fehlercode
Beschreibung
Please use an applicable NRC, as defined in ISO 14229-1, using DiagUdsNrcErrc.
Request a governed re-review of this record. The record is not changed immediately.
This StopOffer will disable the forwarding of request messages from DM.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: e7cdc33ba5c7ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
use
The method StopOffer() of class ara::diag::UploadService ([SWS_DM_00803], declared in #include "ara/diag/upload.h") deactivates the forwarding of incoming diagnostic requests from Diagnostic Management (DM) to the upload service. The function has the signature void StopOffer() noexcept;, takes no parameters, and returns no return value. The call occurs synchronously and terminates the forwarding of requests immediately.
Error handling
The operation is specified as exception-safe (exception safe) and declared with the identifier noexcept[SWS_DM_00803]. Thus, no C++ exceptions are thrown. Specific error codes or error messages are not provided for this call.
Concurrency and Limitations
According to the specification, StopOffer() is not thread-safe (not thread-safe) [SWS_DM_00803]. The calling Adaptive Application must therefore ensure independently that calls on the same instance do not occur concurrently from multiple threads without external synchronization. Regarding sequencing, the method would typically only be called after a preceding offering of the service in order to unregister it in a controlled manner. Question Q-90ce659f307f54ca (open)
Interaction
The interface fits into the unified offering pattern of AUTOSAR Adaptive diagnostics, which provides separate methods for activation and deactivation for service instances AUTOSAR_AP_SWS_Diagnostics §7.3.4.1.2 “Monitors”. The method forms the functional counterpart to ara::diag::DownloadService::StopOffer ([SWS_DM_00793]), which is subject to the same upstream requirements. Analogous deactivation functions also exist for further diagnostic components such as generic routines ([SWS_DM_00558]), UDS services ([SWS_DM_00620]), and authentication interfaces ([SWS_DM_01131]).
This usage note was created automatically based on the AUTOSAR Adaptive R25-11 specification.
numBytesToReturn: Specifies the maximum number of bytes that Diagnostic Manager (DM) can accept for this data block due to its internal buffer size ([SWS_DM_00800]). Interpretation: The application is likely to restrict the block size strictly to this limit. Question Q-89de95e70e1e6223 (open)
metaInfo: Provides meta information on the incoming diagnostic request ([SWS_DM_00800]).
cancellationHandler: Serves for monitoring ongoing conversations via cancellationHandler.IsCanceled() as well as registering notifications via cancellationHandler.SetNotifier() in case of cancellation ([SWS_DM_00800]).
The return is asynchronous via ara::core::Future<OperationOutput> ([SWS_DM_00800]). In the success case, the payload ([SWS_DM_00796]) provided in OperationOutput.responseData is placed directly behind the counter blockSequenceCounter as transferResponseParameterRecord in the positive response ([SWS_DM_00800]).
Error Handling and Validation
In the error case, the future is resolved with an appropriate error code (NRC) in accordance with ISO 14229-1 from DiagUdsNrcErrc ([SWS_DM_00800]). Apart from basic NRC checks according to [SWS_DM_00101] and [SWS_DM_00103], Diagnostic Manager performs no further service validation; all other required NRC checks must be implemented by the called application itself ([SWS_DM_01096]).
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
numBytesToReturn
number of bytes DM accepts (due to its internal buffer) for this chunk.
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.
A Future, which either gets readied to OperationOutput (transfer ResponseParameterRecord for a positive response message) or readied with ErrorCode from DiagUdsNrcErrc (for a negative response message). Data in OperationOutput.responseData will be placed after block SequenceCounter as transferResponseParameterRecord in the positive response.
Fehler
Fehlercode
Beschreibung
Please use an applicable NRC, as defined in ISO 14229-1, using DiagUdsNrcErrc.
Request a governed re-review of this record. The record is not changed immediately.
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 DiagnosticUploadInterface 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 DiagnosticUploadInterface.
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.
gemini-3.8-flash-low· 2026-10-13 · German original