Enables reading out complete files or directories via shared memory regions upon diagnostic requests.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 4c654c39d186ProvenanceOpen questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Enables reading out complete files or directories via shared memory regions upon diagnostic requests.
Class ara::diag::DataTransferReadSharedDataHandler serves to handle read diagnostic data transfers for file and directory contents via shared memory ([SWS_DM_01497]). After the session is started, the application implementation provides the entire data as a shared data view via Read() and keeps the allocated buffer available until the release notification by the ReleaseHandler ([SWS_DM_01504]). Prior to destroying the handler-specific object, the transfer session must mandatory be concluded via ExitRead(). The object is exclusively intended for a single transfer session and may therefore be moved, but not copied.
Context
Class ara::diag::DataTransferReadSharedDataHandler belongs to the diagnostic domain of the AUTOSAR Adaptive Platform in module diag (AUTOSAR_AP_SWS_Diagnostics §8.10.5 “Class: DataTransferReadSharedDataHandler”). Its core task consists in handling data transfers for file and directory contents initiated by UDS requests such as RequestReadFile or RequestReadDirectory ([SWS_DM_01497]). Instead of individual copy steps for each transfer block, this handler allows the application-specific implementation to provide the entire data as a contiguous shared memory region.
In the overall system sequence, three main actors cooperate: the external UDS client sends the read request to the ECU. The diagnostic runtime environment AraDiag receives the request and forwards execution to the concrete implementation of DataTransferReadSharedDataHandler ([SWS_DM_01497], [SWS_DM_01504]). A third partner, the ReleaseHandler, signals to the application as soon as the shared memory resources are no longer required by the platform and may be released ([SWS_DM_01504]).
Context diagram: Interaction between UDS client, AraDiag runtime environment, and the application-side handler implementation. Sources: [SWS_DM_01497], [SWS_DM_01504], [SWS_DM_01505]
For the destruction of the object, a strict precondition exists: an instance of this class must under no circumstances be destroyed before the transfer session has been formally ended by calling ExitRead() ([SWS_DM_01499], AUTOSAR_AP_SWS_Diagnostics §8.10.5.1.1.3 “Destructor”). Only after completing this termination handling may the virtual destructor execute ([SWS_DM_01499]).
Regarding concurrency, the central methods Read() and ExitRead() are designated as not thread-safe (not thread-safe), while all functions of the interface guarantee exception safety (exception safe) ([SWS_DM_01498], [SWS_DM_01504], [SWS_DM_01505]).
Usage Path
The typical call sequence of a data transfer with shared memory regions comprises several steps:
Provision of the shared data:AraDiag calls the pure virtual method Read() and passes a ReleaseHandler, MetaInfo, as well as a CancellationHandler ([SWS_DM_01504]). The application allocates the entire file or directory content and returns the shared view thereof as ara::core::Span<ara::core::Byte> via a ara::core::Future to AraDiag ([SWS_DM_01504]).
Memory reservation and release: The application must strictly keep the allocated memory intact until the ReleaseHandler signals that the memory region can safely be released ([SWS_DM_01504]). For this purpose, the application can register a notifier function on the ReleaseHandler or actively poll its status ([SWS_DM_01504]). Interpretation: The signaling via the ReleaseHandler is presumably performed asynchronously by AraDiag as soon as the data blocks have been successfully transmitted to the UDS client. Question Q-0fbc1c5e667c9a68 (open)
Session termination: To terminate the transfer, AraDiag calls method ExitRead() ([SWS_DM_01505], AUTOSAR_AP_SWS_Diagnostics §8.10.5.1.3.1 “ExitRead”). In addition to the termination reason (DataTransferExitType), vehicle-manufacturer-specific request parameters are passed, whose lifetime is guaranteed until fulfillment of the result promise ([SWS_DM_01505]). The application returns the response data via a ara::core::Future<ara::core::Vector<ara::core::Byte>> ([SWS_DM_01505]).
Object destruction: After ExitRead() has been successfully called, the handler instance may be released and destroyed ([SWS_DM_01499]).
Sequence diagram: Step sequence from data provision via Read() to memory release up to termination via ExitRead(). Sources: [SWS_DM_01499], [SWS_DM_01504], [SWS_DM_01505]
Error Scenarios
If errors occur during data provision or transfer termination, they are reported via the respective ara::core::Future with a ara::core::ErrorCode from domain DiagUdsNrcErrc according to ISO 14229-1 ([SWS_DM_01504], [SWS_DM_01505]).
Another scenario is the cancellation of an ongoing diagnostic conversation. Both methods receive a CancellationHandler ([SWS_DM_01504], [SWS_DM_01505]). The application can check the cancellation status synchronously via cancellation_handler.IsCanceled() or configure a notification function via cancellation_handler.SetNotifier() to react immediately to premature cancellation ([SWS_DM_01504], [SWS_DM_01505]).
A violation of the precondition regarding the destructor—if the object is destroyed before ExitRead() was called—contradicts requirement [SWS_DM_01499] and leads to erroneous program states.
This class guide is based on the specification AUTOSAR Adaptive Platform Release R25-11.
Provides the whole data to be read out from the application in form of a shared data view. The whole file/directory info content to be sent back to the UDS client will be allocated by the application and its shared ownership (view over the memory location) is passed as a result to AraDiag. The allocated memory must be kept until the ReleaseHandler’s notifier is invoked or the status polled, signalling that the memory, addressed by the Span now can safely be released.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 8bcba929adb6Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The interface ExitRead of class ara::diag::DataTransferReadSharedDataHandler ([SWS_DM_01505]; header ara/diag/data_transfer.h) terminates an ongoing data transfer session.
exit_type (DataTransferExitType): Specifies the reason for terminating the session.
transfer_request_parameter_record (ara::core::Span<const ara::core::Byte>): Contains manufacturer-specific parameters to support the transfer. The data remains valid until the associated promise is fulfilled or processing is canceled.
meta_info (MetaInfo const&): Contains additional meta-information of the diagnostic request.
cancellation_handler (CancellationHandler): Allows checking the cancellation status by means of cancellation_handler.IsCanceled() and registering a notification function via cancellation_handler.SetNotifier(), which is called upon cancellation of the conversation.
Error Handling and Return Values
Upon successful completion, the Future provides the output data (transferResponseParameterRecord), which is placed after the SID in the positive response [SWS_DM_01505]. In the event of an error, the Future is fulfilled with an error code from DiagUdsNrcErrc (applicable NRC according to ISO 14229-1) [SWS_DM_01505].
Concurrency and Lifecycle
The method is declared as noexcept (exception safe), but explicitly specified as not thread-safe[SWS_DM_01505]. Regarding object lifecycle, the requirement applies that an instance of DataTransferReadSharedDataHandler must under no circumstances be destroyed before ExitRead() has been called ([SWS_DM_01499]). Analogous termination functions and destructor requirements exist for the related classes DataTransferReadByPullHandler ([SWS_DM_01514]) and DataTransferReadByPushHandler ([SWS_DM_01523]).
This usage note was created by an AI and is based on the specifications of the AUTOSAR Adaptive Platform.
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
contains additional meta information 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.
Returns a Future, which either gets readied to OperationOutput (transferResponseParameterRecord 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.
Provides the whole data to be read out from the application in form of a shared data view. The whole file/directory info content to be sent back to the UDS client will be allocated by the application and its shared ownership (view over the memory location) is passed as a result to AraDiag. The allocated memory must be kept until the ReleaseHandler’s notifier is invoked or the status polled, signalling that the memory, addressed by the Span now can safely be released.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: cba844c9db1eProvenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
The method Read of interface ara::diag::DataTransferReadSharedDataHandler provides file or directory data to be read for the UDS client via a shared memory view ([SWS_DM_01504]). The call is asynchronous and returns a ara::core::Future with a ara::core::Span<ara::core::Byte> ([SWS_DM_01504]).
Usage and lifecycle
The implementing application allocates the entire content itself and passes the view to AraDiag. The underlying memory area must strictly be kept unchanged until the release has been signaled via the passed ReleaseHandler by its notifier or queried via status check ([SWS_DM_01504]). The ReleaseHandler must be stored for the same UDS client based on the MetaInfo ([SWS_DM_01504]). Via the CancellationHandler, an ongoing transfer can be monitored via IsCanceled() or a cancellation notifier can be registered via SetNotifier() ([SWS_DM_01504]).
Error Handling and Concurrency
In case of success, the data is sent as transferResponseParameterRecord after the blockSequenceCounter ([SWS_DM_01504]). If reading fails, the Future must be completed with a matching error code from DiagUdsNrcErrc according to ISO 14229-1 ([SWS_DM_01504]). If the interface of the application has not yet or no longer been provided via offer(), the server reports NRC 0x94 (ResourceTemporarilyNotAvailable) ([SWS_DM_01257]). The function is specified as noexcept and exception safe, but is considered not thread-safe (not thread-safe) ([SWS_DM_01504]).
demarcation
In contrast to DataTransferReadByPullHandler::Read, in which data blocks are copied into a predetermined buffer ([SWS_DM_01513]), or DataTransferReadByPushHandler::Read, which provides vectors via ownership transfer ([SWS_DM_01522]), this handler transfers the entire content via shared memory without a buffer copy ([SWS_DM_01504]).
This usage note was generated automatically based on the AUTOSAR standard.
The release shared resource handler to be stored and used by the application until a new one is passed for the same meta_info (UDS client).
meta_info
Contains additional meta information.
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.
Returns a Future, which either gets readied to ReadSharedOutput (transferResponseParameterRecord for a positive response message) or readied with ErrorCode from DiagUdsNrcErrc (for an negative response message). Data in ReleaseSharedHandler.responseData will be placed after the 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