Enables the diagnostic runtime environment to retrieve file and directory data step-by-step from an application.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: a81aee002281ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables the diagnostic runtime environment to retrieve file and directory data step-by-step from an application.
Class ara::diag::DataTransferReadByPullHandler serves to provide file or directory data that is actively retrieved from the application by diagnostic layer AraDiag as part of a UDS read operation ([SWS_DM_01506]). The sequence comprises step-by-step data retrieval via Read() up to the final session termination via ExitRead(). As a strict lifecycle condition, a handler instance that is associated with exactly one single transfer session must under no circumstances be destroyed before ExitRead() is called ([SWS_DM_01510]).
Context
Class ara::diag::DataTransferReadByPullHandler ([SWS_DM_01506], AUTOSAR_AP_SWS_Diagnostics §8.10.2 “Class: DataTransferReadByPullHandler”) handles data transfers initiated by diagnostic requests to read files or directories (such as RequestReadFile or RequestReadDirectory). The architecture is based on a pull method in which diagnostic layer AraDiag actively queries ("pulls") the data to be transferred from the implementation.
Three components participate in the interaction: the external UDS client (diagnostic tester), the diagnostic subsystem AraDiag, and the application-specific handler implementation. The external client sends read requests, whereupon AraDiag calls the methods of the handler to provide data chunks step-by-step and transmit them to the UDS client ([SWS_DM_01513]).
Lifecycle
The lifecycle of a handler instance is exclusively bound to a single file transfer session. The default constructor is declared protected ([SWS_DM_01507]). Interpretation: The concrete application would therefore be expected to implement and instantiate a derived subclass. Question Q-cb78bc4a1d40968b (open)
Copy operations are completely disabled: the copy constructor ([SWS_DM_01509]) and the copy assignment operator ([SWS_DM_01512]) are specified as deleted (=delete), since handlers are intended for one-way use within a session ("only one way usage i.e. per single file transfer session"). Move operations (move constructor and move assignment), on the other hand, are defined as default implementations and declared as noexcept ([SWS_DM_01508], [SWS_DM_01511], AUTOSAR_AP_SWS_Diagnostics §8.10.2.1.1.1 “Move Constructor”).
A strict precondition applies to release: an instance of the class must under no circumstances be destroyed before method ExitRead() has been called ([SWS_DM_01510], AUTOSAR_AP_SWS_Diagnostics §8.10.2.1.1.2 “Destructor”). Regarding concurrency, the interface methods Read() and ExitRead() are defined as not thread-safe ("not thread-safe"), but exception-safe (noexcept) ([SWS_DM_01513], [SWS_DM_01514]).
Usage Path
The regular sequence of data retrieval is divided into the following steps:
Initialization: The application instantiates the derived handler class for the upcoming transfer session.
Data retrieval: To provide the data blocks, AraDiag calls method Read() ([SWS_DM_01513], AUTOSAR_AP_SWS_Diagnostics §8.10.2.1.3.2 “Read”). The application receives a memory view response_data (of type ara::core::Span<const ara::core::Byte>) of a buffer preallocated by AraDiag, fills it with the next file contents, and completes the ara::core::Future<std::uint32_t> with the number of bytes written. AraDiag inserts this data after the block sequence counter (blockSequenceCounter) as transferResponseParameterRecord into the positive UDS response ([SWS_DM_01513]). This step is repeated for subsequent chunks.
Session termination: For the regular termination of the transfer, AraDiag calls ExitRead() ([SWS_DM_01514], AUTOSAR_AP_SWS_Diagnostics §8.10.2.1.3.1 “ExitRead”). The termination reason exit_type, vendor-specific parameters (transfer_request_parameter_record), meta_info, and a cancellation_handler are passed. The implementation acknowledges this via a ara::core::Future<ara::core::Vector<ara::core::Byte>>, whose return values are transmitted after the SID in the positive response ([SWS_DM_01514]).
Release: Only after ExitRead() has been called may the handler object be destroyed ([SWS_DM_01510]).
Sequence diagram: Typical sequence of data retrieval via pull method using AraDiag. Sources: [SWS_DM_01513], [SWS_DM_01514]
Error Scenarios
If errors occur during data preparation or termination, the application reports this via the returned Future by providing it with a UDS error code (DiagUdsNrcErrc according to ISO 14229-1) ([SWS_DM_01513], [SWS_DM_01514]). AraDiag then generates the corresponding negative UDS response (NRC) to the tester.
For premature cancellation, a CancellationHandler is passed to both methods ([SWS_DM_01513], [SWS_DM_01514]). The application can check via cancellation_handler.IsCanceled() whether the conversation was cancelled, or register a callback function via cancellation_handler.SetNotifier(). The provided buffers (response_data and transfer_request_parameter_record) remain valid until the promise is fulfilled or cancellation occurs via the handler.
If the instance is destroyed before ExitRead() is called, this constitutes a violation of the specification requirement ([SWS_DM_01510]), which can lead to incomplete transfer sessions and undefined system states.
This class guide is based on the AUTOSAR Adaptive R25-11 specification and summarizes the requirements for the ara::diag::DataTransferReadByPullHandler interface.
Reads data chunk from the application. The first or subsequent file/directory info content chunk to be sent back to the UDS client will be composed by the application and copied into the provided by ara::diag Span with up to the requested Span size.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 7a822a7b2a3dProvenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The pure virtual method ExitRead terminates an ongoing data transfer session in the context of ara::diag::DataTransferReadByPullHandler[SWS_DM_01514] (AUTOSAR_AP_SWS_Diagnostics §8.10.2.1.3.1 “ExitRead”). It accepts as parameters the termination reason exit_type (type DataTransferExitType), vehicle-manufacturer-specific parameters in transfer_request_parameter_record (as ara::core::Span<const ara::core::Byte>), the request context meta_info, and a cancellation_handler. The parameter transfer_request_parameter_record remains valid until the associated promise is fulfilled or execution is canceled via the cancellation handler [SWS_DM_01514].
The call is made asynchronously and returns a ara::core::Future<ara::core::Vector<ara::core::Byte>>[SWS_DM_01514]:
In case of success, the future is provided for a positive response message; the data from OperationOutput.response_data is placed after the service ID as transferResponseParameterRecord.
In case of an error, the future is fulfilled with a UDS error code (NRC) in accordance with ISO 14229-1 from DiagUdsNrcErrc for a negative response message.
The function is declared as noexcept and is exception-safe (exception safe), but not thread-safe (not thread-safe) [SWS_DM_01514]. Via cancellation_handler, the cancellation status can be queried using cancellation_handler.IsCanceled() or a notification function for a cancellation of the conversation can be registered via cancellation_handler.SetNotifier()[SWS_DM_01514].
Regarding the ordering, an instance of DataTransferReadByPullHandler must under no circumstances be destroyed before ExitRead() has been called [SWS_DM_01510]. Corresponding termination functions and destructor conditions exist in parallel for ara::diag::DataTransferReadSharedDataHandler::ExitRead[SWS_DM_01505] ([SWS_DM_01499]) and ara::diag::DataTransferReadByPushHandler::ExitRead[SWS_DM_01523] ([SWS_DM_01519]).
This text was created by an AI; the specification is authoritative.
This parameter record contains parameter(s), which are required
parameter_record
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.
meta_info
MetaInfo of the request.
cancellation_handler
This parameter is used to • Query the current cancellation status by calling cancellation_ handler.IsCanceled(). Returns true in case, the current conversation has been cancelled and false otherwise. • Register a notifier function by calling cancellation_handler.Set Notifier(). 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 UDS ErrorCode from DiagUdsNrcErrc (for an negative response message). Data in OperationOutput.response_data 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.
Reads data chunk from the application. The first or subsequent file/directory info content chunk to be sent back to the UDS client will be composed by the application and copied into the provided by ara::diag Span with up to the requested Span size.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 104f857aa59eProvenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Usage and invocation semantics
The method Read of class ara::diag::DataTransferReadByPullHandler serves for reading data blocks by the application within the scope of UDS data transfer [SWS_DM_01513]. The application compiles the first or subsequent file or directory content blocks and copies them into the buffer response_data (type ara::core::Span<const ara::core::Byte>) passed by ara::diag up to a maximum of the span's size.
The call is asynchronous and returns a ara::core::Future<std::uint32_t>[SWS_DM_01513]. In case of success, the future is fulfilled with the number of bytes actually provided; this data is placed in the positive UDS response after the blockSequenceCounter as transferResponseParameterRecord. Via parameter cancellation_handler, the application can query the cancellation status using IsCanceled() or register a notification function for a cancellation via SetNotifier().
Error Handling and Boundary Conditions
In case of error, the future is completed with an applicable UDS NRC from DiagUdsNrcErrc according to ISO 14229-1 [SWS_DM_01513]. If an interface is not or no longer provided by means of offer(), the DM responds with NRC 0x94 (ResourceTemporarilyNotAvailable) [SWS_DM_01257].
Concurrency and Interaction
The interface is specified as not thread-safe (not thread-safe), but exception safe (exception safe) [SWS_DM_01513]. The memory area of response_data remains valid only until the associated promise is fulfilled or the operation is canceled. As an alternative to the pull pattern, the push method via DataTransferReadByPushHandler::Read[SWS_DM_01522] as well as the transfer with shared ownership via DataTransferReadSharedOwnershipHandler::Read[SWS_DM_01504] exist for data transfer.
This usage note was created automatically based on the specification documents of AUTOSAR Adaptive.
The view over a pre-allocated by AraDiag memory to write in this data chunk. Lifetime: Valid until Promise is fulfilled or the processing is cancelled by the cancellationHandler.
meta_info
MetaInfo of the request.
cancellation_handler
This parameter is used to • Query the current cancellation status by calling cancellation_ handler.IsCanceled(). Returns true in case, the current conversation has been cancelled and false otherwise. • Register a notifier function by calling cancellation_handler.Set Notifier(). The registered notifier is called if the current conversation is cancelled.
A Future, which either gets readied to actual amount of data provided in the Span (for a positive response message) or readied with UDS ErrorCode from DiagUdsNrcErrc (for an negative response message). Data in response_data will be placed after blockSequenceCounter 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.
gemini-3.8-flash-low· 2026-10-13 · German original