Encapsulates active diagnostic read transfers and forwards incoming data transfers to registered handlers.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9db606b147f6ProvenanceOpen questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Encapsulates active diagnostic read transfers and forwards incoming data transfers to registered handlers.
The class serves for the encapsulation and structured management of all variants of diagnostic read transfers within the adaptive AUTOSAR diagnostic module according to [SWS_DM_01548]. After the successful initiation of a read operation, the diagnostic server instance delegates incoming requests for sequential data block transfer and for session termination to the registered methods of the read handler [SWS_DM_01317]. By specifically disabling copy operations while simultaneously supporting move semantics, the class ensures an unambiguous ownership assignment of the underlying transfer session.
Context
The class ara::diag::DataTransferReadSession represents the encapsulation of all variants for diagnostic reading of data blocks in the adaptive diagnostic module [SWS_DM_01548]. In the context of standardized UDS services such as RequestFileTransfer (0x38), TransferData (0x36), and RequestTransferExit (0x37), the session class acts as a link between the internal runtime environment of the diagnostic server and the application-specific read handlers SWS Diagnostics §7 “Realization of TransferData and RequestTransferExit”. It ensures that ongoing read-out operations—such as for files via ReadFile[SWS_DM_01314] or directories via ReadDir[SWS_DM_01315]—are managed in an isolated manner and forwarded to the associated handlers.
An instance of ara::diag::DataTransferReadSession has a lifetime that is strictly coupled to the transfer session. Creation via a default constructor is explicitly prohibited [SWS_DM_01549]. Instead, the session is initialized via specialized template constructors that register the application-specific handlers SWS Diagnostics §7 “Realization of TransferData and RequestTransferExit”. In practice, instantiation is likely typically performed by the diagnostic server or the service handler upon initiation of the file transfer. Question Q-b0706bcd28c702c6 (open)
To rule out multiple assignments or inconsistent session states, ara::diag::DataTransferReadSession is designed as a non-copyable single instance: both the copy constructor [SWS_DM_01553] and the copy assignment operator [SWS_DM_01554] are deleted (=delete). A transfer of ownership is intended exclusively via move semantics. The move constructor [SWS_DM_01551] and the move assignment operator [SWS_DM_01552] are defined as noexcept=default. Destruction occurs deterministically via the destructor [SWS_DM_01550], which is likewise declared as noexcept=default. Completing the transfer via RequestTransferExit presumably leads to the release of the object. Question Q-c1999fd1f283a007 (open)
Usage Path
The typical sequence of a read transfer session is divided into three consecutive phases:
Initialization: An external diagnostic client sends RequestFileTransfer with a read mode such as ReadFile (0x04) [SWS_DM_01314] or ReadDir (0x05) [SWS_DM_01315]. During this, the session instance is created and the read handler is registered.
Data transfer: The diagnostic server processes incoming diagnostic requests of type TransferData (0x36) by calling the corresponding Read method of the handler registered via the template constructors [SWS_DM_01317]. This is done iteratively for each requested data block.
Termination: As soon as all data has been transferred, the client sends RequestTransferExit (0x37). The diagnostic server then calls the Exit method of the registered handler in order to terminate the read operation properly [SWS_DM_01318].
Since ara::diag::DataTransferReadSession is declared as final and the default constructor [SWS_DM_01549] does not exist, erroneous creation without a registered handler is already prevented at compile time. Likewise, the deleted copy operations [SWS_DM_01553] prevent accidental duplication of session states. Both move construction as well as move assignment and destruction guarantee absolute exception safety through their noexcept specification [SWS_DM_01551][SWS_DM_01550]. If the provision of data blocks in the handler fails, this is handled on the protocol level within the scope of UDS communication.
This guide is based on the specification AUTOSAR Adaptive Platform R25-11 (diag module) and summarizes the requirements for ara::diag::DataTransferReadSession.
gemini-3.8-flash-low· 2026-10-13 · German original