Diag-Client-Lib
Public Types | Public Member Functions | List of all members
diag::client::conversation::Conversation Class Referenceabstract

Interface for diag client conversation. More...

#include <conversation.h>

Inheritance diagram for diag::client::conversation::Conversation:
Inheritance graph
[legend]

Public Types

using IpAddress = DiagClientConversation::IpAddress
 Type alias for Ip address. More...
 
using ConnectResult = DiagClientConversation::ConnectResult
 Type alias for Connection results. More...
 
using DisconnectResult = DiagClientConversation::DisconnectResult
 Type alias for Disconnection results. More...
 
using DiagError = DiagClientConversation::DiagError
 Type alias for Diagnostic results. More...
 

Public Member Functions

 Conversation () noexcept=default
 Constructs an instance of Conversation. More...
 
 Conversation (const Conversation &other) noexcept=delete
 Deleted copy assignment and copy constructor. More...
 
Conversationoperator= (const Conversation &other) noexcept=delete
 
 Conversation (Conversation &&other) noexcept=delete
 Deleted move assignment and move constructor. More...
 
Conversationoperator= (Conversation &&other) noexcept=delete
 
virtual ~Conversation () noexcept=default
 Destructs an instance of Conversation. More...
 
virtual void Startup () noexcept=0
 Function to start the Conversation. More...
 
virtual void Shutdown () noexcept=0
 Function to shutdown the Conversation. More...
 
virtual void RegisterConnection (std::unique_ptr<::uds_transport::Connection > connection) noexcept=0
 Function to register the conversation to underlying transport protocol handler. More...
 
virtual ::uds_transport::ConversionHandlerGetConversationHandler () noexcept=0
 Function to get the conversation handler from conversation object. More...
 
virtual ConnectResult ConnectToDiagServer (std::uint16_t, IpAddress) noexcept
 Function to connect to Diagnostic Server. More...
 
virtual DisconnectResult DisconnectFromDiagServer () noexcept
 Function to disconnect from Diagnostic Server. More...
 
virtual std::pair<::uds_transport::UdsTransportProtocolMgr::IndicationResult, ::uds_transport::UdsMessagePtrIndicateMessage (::uds_transport::UdsMessage::Address source_addr, ::uds_transport::UdsMessage::Address target_addr, ::uds_transport::UdsMessage::TargetAddressType type, ::uds_transport::ChannelID channel_id, std::size_t size, ::uds_transport::Priority priority, ::uds_transport::ProtocolKind protocol_kind, core_type::Span< std::uint8_t > payload_info) noexcept=0
 Function to indicate a start of reception of message. More...
 
virtual void HandleMessage (::uds_transport::UdsMessagePtr message) noexcept=0
 Function to Hands over a valid received Uds message. More...
 
virtual Result< uds_message::UdsResponseMessagePtr, DiagErrorSendDiagnosticRequest (uds_message::UdsRequestMessageConstPtr) noexcept
 Function to send Diagnostic Request and get Diagnostic Response. More...
 
virtual core_type::Result< diag::client::vehicle_info::VehicleInfoMessageResponseUniquePtr, DiagClient::VehicleInfoResponseErrorSendVehicleIdentificationRequest (vehicle_info::VehicleInfoListRequestType) noexcept
 Function to send vehicle identification request and get the Diagnostic Server list. More...
 

Detailed Description

Interface for diag client conversation.

Definition at line 24 of file conversation.h.

Member Typedef Documentation

◆ ConnectResult

Type alias for Connection results.

Definition at line 34 of file conversation.h.

◆ DiagError

Type alias for Diagnostic results.

Definition at line 44 of file conversation.h.

◆ DisconnectResult

Type alias for Disconnection results.

Definition at line 39 of file conversation.h.

◆ IpAddress

Type alias for Ip address.

Definition at line 29 of file conversation.h.

Constructor & Destructor Documentation

◆ Conversation() [1/3]

diag::client::conversation::Conversation::Conversation ( )
defaultnoexcept

Constructs an instance of Conversation.

◆ Conversation() [2/3]

diag::client::conversation::Conversation::Conversation ( const Conversation other)
deletenoexcept

Deleted copy assignment and copy constructor.

◆ Conversation() [3/3]

diag::client::conversation::Conversation::Conversation ( Conversation &&  other)
deletenoexcept

Deleted move assignment and move constructor.

◆ ~Conversation()

virtual diag::client::conversation::Conversation::~Conversation ( )
virtualdefaultnoexcept

Destructs an instance of Conversation.

Member Function Documentation

◆ ConnectToDiagServer()

virtual ConnectResult diag::client::conversation::Conversation::ConnectToDiagServer ( std::uint16_t  ,
IpAddress   
)
inlinevirtualnoexcept

Function to connect to Diagnostic Server.

Parameters
[in]target_addressLogical address of the Remote server
[in]host_ip_addrIP address of the Remote server
Returns
ConnectResult Connection result returned

Reimplemented in diag::client::conversation::DmConversation.

Definition at line 101 of file conversation.h.

References diag::client::conversation::DiagClientConversation::kConnectFailed.

Referenced by diag::client::conversation::DiagClientConversation::DiagClientConversationImpl::ConnectToDiagServer().

Here is the caller graph for this function:

◆ DisconnectFromDiagServer()

virtual DisconnectResult diag::client::conversation::Conversation::DisconnectFromDiagServer ( )
inlinevirtualnoexcept

Function to disconnect from Diagnostic Server.

Returns
DisconnectResult Disconnection result returned

Reimplemented in diag::client::conversation::DmConversation.

Definition at line 108 of file conversation.h.

References diag::client::conversation::DiagClientConversation::kDisconnectFailed.

Referenced by diag::client::conversation::DiagClientConversation::DiagClientConversationImpl::DisconnectFromDiagServer().

Here is the caller graph for this function:

◆ GetConversationHandler()

virtual ::uds_transport::ConversionHandler& diag::client::conversation::Conversation::GetConversationHandler ( )
pure virtualnoexcept

Function to get the conversation handler from conversation object.

Returns
ConversionHandler & The reference to conversation handler

Implemented in diag::client::conversation::VdConversation, and diag::client::conversation::DmConversation.

◆ HandleMessage()

virtual void diag::client::conversation::Conversation::HandleMessage ( ::uds_transport::UdsMessagePtr  message)
pure virtualnoexcept

Function to Hands over a valid received Uds message.

Parameters
[in]messageThe The Uds message ptr (unique_ptr semantics) with the request. Ownership of the UdsMessage is given back to the conversation here

Implemented in diag::client::conversation::VdConversation, and diag::client::conversation::DmConversation.

◆ IndicateMessage()

virtual std::pair<::uds_transport::UdsTransportProtocolMgr::IndicationResult, ::uds_transport::UdsMessagePtr> diag::client::conversation::Conversation::IndicateMessage ( ::uds_transport::UdsMessage::Address  source_addr,
::uds_transport::UdsMessage::Address  target_addr,
::uds_transport::UdsMessage::TargetAddressType  type,
::uds_transport::ChannelID  channel_id,
std::size_t  size,
::uds_transport::Priority  priority,
::uds_transport::ProtocolKind  protocol_kind,
core_type::Span< std::uint8_t >  payload_info 
)
pure virtualnoexcept

Function to indicate a start of reception of message.

This is called to indicate the reception of new message by underlying transport protocol handler

Parameters
[in]source_addrThe UDS source address of message
[in]target_addrThe UDS target address of message
[in]typeThe indication whether its is phys/func request
[in]channel_idThe transport protocol channel on which message start happened
[in]sizeThe size in bytes of the UdsMessage starting from SID
[in]priorityThe priority of the given message, used for prioritization of conversations
[in]protocol_kindThe identifier of protocol kind associated to message
[in]payload_infoThe View onto the first received payload bytes, if any. This view shall be used only within this function call. It is recommended that the TP provides at least the first two bytes of the request message, so the DM can identify a functional TesterPresent
Returns
std::pair< IndicationResult, UdsMessagePtr > The pair of IndicationResult and a pointer to UdsMessage owned/created by DM core and returned to the handler to get filled

Implemented in diag::client::conversation::VdConversation, and diag::client::conversation::DmConversation.

◆ operator=() [1/2]

Conversation& diag::client::conversation::Conversation::operator= ( const Conversation other)
deletenoexcept

◆ operator=() [2/2]

Conversation& diag::client::conversation::Conversation::operator= ( Conversation &&  other)
deletenoexcept

◆ RegisterConnection()

virtual void diag::client::conversation::Conversation::RegisterConnection ( std::unique_ptr<::uds_transport::Connection connection)
pure virtualnoexcept

Function to register the conversation to underlying transport protocol handler.

Parameters
[in]connectionThe conversation connection object

Implemented in diag::client::conversation::VdConversation, and diag::client::conversation::DmConversation.

◆ SendDiagnosticRequest()

virtual Result<uds_message::UdsResponseMessagePtr, DiagError> diag::client::conversation::Conversation::SendDiagnosticRequest ( uds_message::UdsRequestMessageConstPtr  )
inlinevirtualnoexcept

Function to send Diagnostic Request and get Diagnostic Response.

Parameters
[in]messageThe diagnostic request message wrapped in a unique pointer
Returns
DiagResult The Result returned
uds_message::UdsResponseMessagePtr Diagnostic Response message received, null_ptr in case of error

Reimplemented in diag::client::conversation::DmConversation.

Definition at line 158 of file conversation.h.

159  {
161  }
static Result FromError(const E &e) noexcept
Build a new Result from the specified error (given as lvalue)
Definition: result.h:83

References core_type::Result< T, E >::FromError(), and diag::client::conversation::DiagClientConversation::kDiagRequestSendFailed.

Referenced by diag::client::conversation::DiagClientConversation::DiagClientConversationImpl::SendDiagnosticRequest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendVehicleIdentificationRequest()

virtual core_type::Result<diag::client::vehicle_info::VehicleInfoMessageResponseUniquePtr, DiagClient::VehicleInfoResponseError> diag::client::conversation::Conversation::SendVehicleIdentificationRequest ( vehicle_info::VehicleInfoListRequestType  )
inlinevirtualnoexcept

Function to send vehicle identification request and get the Diagnostic Server list.

Parameters
[in]vehicle_info_requestVehicle information sent along with request
Returns
Result containing available vehicle information response on success, VehicleResponseErrorCode on error

Reimplemented in diag::client::conversation::VdConversation.

Definition at line 171 of file conversation.h.

171  {
172  return core_type::Result<
175  }
Class type to contains a value (of type ValueType), or an error (of type ErrorType)
Definition: result.h:29
VehicleInfoResponseError
Definitions of Vehicle Identification response error code.
std::unique_ptr< VehicleInfoMessage > VehicleInfoMessageResponseUniquePtr
The unique_ptr for Vehicle Identification Response Message.

References diag::client::DiagClient::kTransmitFailed.

◆ Shutdown()

virtual void diag::client::conversation::Conversation::Shutdown ( )
pure virtualnoexcept

◆ Startup()

virtual void diag::client::conversation::Conversation::Startup ( )
pure virtualnoexcept

The documentation for this class was generated from the following file: