Enables applications to actively provide file and directory contents upon UDS read requests.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 1ed24b3e3197ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables applications to actively provide file and directory contents upon UDS read requests.
Class ara::diag::DataTransferReadByPushHandler serves as the base interface for UDS read transfers where the application actively packets and provides file contents [SWS_DM_01515]. Data blocks are handed over sequentially via Read() and the transfer session is subsequently concluded in an orderly manner via ExitRead()[SWS_DM_01523]. Each handler is strictly bound to exactly one transfer session, which is why copy operations are prevented. As an essential lifecycle condition, the instance must under no circumstances be destroyed before ExitRead() is called [SWS_DM_01519].
Context
Class ara::diag::DataTransferReadByPushHandler acts as a base and interface class for diagnostic data transfers initiated by requests such as RequestReadFile or RequestReadDirectory[SWS_DM_01515]. The underlying transfer pattern is based on the push principle: the file or directory data is actively packeted by the specific application implementation and handed over to Diagnostic Management (DM) AUTOSAR_AP_SWS_Diagnostics §8.10.3 “Class: DataTransferReadByPushHandler”. The interaction occurs between the external UDS client, the platform component ara::diag, and the concrete handler implementation of the application.
Since DataTransferReadByPushHandler is designed as an abstract base class, the parameterless constructor has protected visibility (protected) [SWS_DM_01516]. Instantiation takes place in the context of a derived class within the application. Instances are strictly bound to exactly one file transfer session ("one way usage"); consequently, copy constructor [SWS_DM_01518] and copy assignment operator [SWS_DM_01521] are explicitly deleted (=delete). A transfer of ownership is possible via move operations, since move constructor [SWS_DM_01517] and move assignment [SWS_DM_01520] are available as default implementations and declared exception-safe (noexcept).
For handler destruction, the specification defines a strict precondition: an instance must under no circumstances be destroyed before the session has been terminated via the call to ExitRead()[SWS_DM_01519], AUTOSAR_AP_SWS_Diagnostics §8.10.3.1.1.2 “Destructor”. Regarding concurrency, the virtual methods of the class are specified as not thread-safe ("not thread-safe") [SWS_DM_01522], [SWS_DM_01523], which is why concurrent accesses must be synchronized by the platform or executed sequentially.
Usage Path
The operational sequence is divided into the repetitive provision of data fragments and the orderly session termination. After initiation of the read process, ara::diag repeatedly calls method Read()[SWS_DM_01522], AUTOSAR_AP_SWS_Diagnostics §8.10.3.1.3.2 “Read”. In doing so, the framework passes a guideline value for the recommended return size in bytes (recommended_number_bytes_to_return) to achieve optimal throughput, as well as the request context (MetaInfo) and a CancellationHandler. The application generates the data packet and transfers its ownership via a ara::core::Future<ara::core::Vector<ara::core::Byte>> to Diagnostic Management, which inserts the payload after the block sequence counter into the UDS response message [SWS_DM_01522].
As soon as all data blocks have been transferred or the session is to be ended, ara::diag calls method ExitRead()[SWS_DM_01523], AUTOSAR_AP_SWS_Diagnostics §8.10.3.1.3.1 “ExitRead”. In addition to the termination reason (DataTransferExitType exit_type), vendor-specific request parameters are passed via transfer_request_parameter_record. The lifetime of this parameter span is strictly bound until the associated promise is fulfilled or processing is cancelled [SWS_DM_01523]. After returning the final response parameter set via the Future, the transfer is considered ended, thereby fulfilling the condition for the safe destruction of the handler object [SWS_DM_01519].
Sequence diagram: Typical interaction sequence between Diagnostic Management and handler during read transfer and transfer completion. Sources: [SWS_DM_01522], [SWS_DM_01523], [SWS_DM_01519]
Error Scenarios
If an error occurs during the assembly of data blocks or upon session termination, it is reported asynchronously via the respective ara::core::Future. Instead of a positive response structure, the future is provided with an error code (ara::core::ErrorCode) from domain DiagUdsNrcErrc, which corresponds to a matching Negative Response Code (NRC) according to ISO 14229-1 [SWS_DM_01522], [SWS_DM_01523].
If the diagnostic dialog aborts or the client sends a cancellation request, the passed CancellationHandler comes into play. The implementation can query the current cancellation status via cancellation_handler.IsCanceled() or register a callback function via cancellation_handler.SetNotifier() that is triggered when the conversation is cancelled [SWS_DM_01522], [SWS_DM_01523]. The fulfillment or cancellation of the promise simultaneously marks the end of validity of the parameter set in ExitRead()[SWS_DM_01523].
This guide is based on the specification AUTOSAR Adaptive Platform Release R25-11.
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 its ownership is passed as a result to ara::diag.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: eefe02828ffeProvenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The virtual method ExitRead terminates an ongoing data transfer session in the context of the diagnostic handler [SWS_DM_01523]. The function operates asynchronously and returns a ara::core::Future with the response data as a byte vector SWS Diagnostics §8.10.3.1.3.1 “ExitRead”.
Parameters and call context
exit_type (DataTransferExitType): Specifies the reason for terminating the transfer [SWS_DM_01523].
transfer_request_parameter_record (ara::core::Span<const ara::core::Byte>): Contains manufacturer-specific parameters to support the data transfer. The underlying data must remain valid until the associated promise is fulfilled or processing is canceled [SWS_DM_01523].
meta_info (MetaInfo const &): Passes meta-information of the diagnostic request [SWS_DM_01523].
cancellation_handler (CancellationHandler): Serves to check the cancellation status using IsCanceled() or to register a callback function via SetNotifier() in case of a session abort [SWS_DM_01523].
Error Handling and Return Values
In case of success, the Future provides the output data, which is placed in the positive UDS response after the SID as transferResponseParameterRecord[SWS_DM_01523]. In case of a failure, the Future is completed with an appropriate Negative Response Code (NRC) from DiagUdsNrcErrc according to ISO 14229-1 [SWS_DM_01523].
Concurrency and Lifecycle
The method is specified as exception safe (exception safe), but explicitly not thread-safe (not thread-safe) [SWS_DM_01523]. Regarding the object lifecycle, a binding ordering constraint exists: An instance of DataTransferReadByPushHandler must under no circumstances be destroyed before calling ExitRead()[SWS_DM_01519]. Analogous requirements apply to related handler classes in data transfer [SWS_DM_01510][SWS_DM_01499].
This text was generated by an AI based on the AUTOSAR Adaptive R25-11 specification.
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 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 its ownership is passed as a result to ara::diag.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: fcd7efa833dfProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The pure virtual method Read of class ara::diag::DataTransferReadByPushHandler serves for the asynchronous reading of data blocks for file or directory information from the application [SWS_DM_01522]. The application compiles the respective data chunk and passes its ownership as ara::core::Vector<ara::core::Byte> to the diagnostic module.
Usage and Call Context
The call is made by the Diagnostic Server to provide response data for UDS clients via header file ara/diag/data_transfer.h[SWS_DM_01522]. The method expects three parameters:
recommended_number_bytes_to_return: The recommended number of bytes for optimal throughput. This value is likely based on the internal buffer or PDU size of Diagnostic Management. Question Q-1a8c1270b192b96f (open)
meta_info: Additional meta-information of the incoming diagnostic request (MetaInfo).
cancellation_handler: Allows querying the cancellation status via cancellation_handler.IsCanceled() or registering a notification via cancellation_handler.SetNotifier() in the event of connection drops.
A ara::core::Future<ara::core::Vector<ara::core::Byte>> serves as the return value. Upon successful processing, the data is embedded as transferResponseParameterRecord after the sequence counter into the positive response message [SWS_DM_01522].
Error Handling and Concurrency
If processing fails, the future is fulfilled with an error code from DiagUdsNrcErrc that maps an appropriate NRC according to ISO 14229-1 [SWS_DM_01522]. If the interface is not yet or no longer offered by the service via offer(), the Diagnostic Manager answers the request with NRC 0x94 (ResourceTemporarilyNotAvailable) [SWS_DM_01257]. The method is specified as exception safe (exception safe), but as not thread-safe (not thread-safe) [SWS_DM_01522], which is why concurrent calls must be synchronized by the application.
Interaction
The push principle of this interface complements alternative read mechanisms of the diagnostic module: the pull method via ara::diag::DataTransferReadByPullHandler::Read[SWS_DM_01513] with a predefined memory area as well as the provision of a shared memory area by means of ReleaseHandler[SWS_DM_01504].
The recommended number of bytes to send back to DM in order to
bytes_to_return
get optimum data throughput.
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 ReadPushOutput (transfer ResponseParameterRecord for a positive response message) or readied with ErrorCode from DiagUdsNrcErrc (for a negative response message). Data in ReadPushOutput.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.
gemini-3.8-flash-low· 2026-10-13 · German original