8 #ifndef DIAGNOSTIC_CLIENT_LIB_LIB_UDS_TRANSPORT_LAYER_API_UDS_TRANSPORT_CONNECTION_H 
    9 #define DIAGNOSTIC_CLIENT_LIB_LIB_UDS_TRANSPORT_LAYER_API_UDS_TRANSPORT_CONNECTION_H 
   14 #include <string_view> 
   24 template<
typename... T>
 
   26   std::string appended_name{};
 
   27   (appended_name.append(args), ...);
 
   35                                         std::uint8_t connection_id) {
 
   36   std::string final_connection_name{connection_name};
 
   37   final_connection_name.append(std::to_string(connection_id));
 
   38   return final_connection_name;
 
  150   virtual std::pair<UdsTransportProtocolMgr::IndicationResult, UdsMessagePtr> 
IndicateMessage(
 
A view over a contiguous sequence of objects.
 
Interface class to handle connection between two layers.
 
std::uint8_t ConnectionId
Type alias for connection id.
 
virtual ~Connection()=default
Destruct an instance of Connection.
 
uds_transport::ConversionHandler const  & conversation_handler_
Store the conversation handler.
 
ConnectionId GetConnectionId() const noexcept
Function to get the connection id.
 
virtual std::pair< UdsTransportProtocolMgr::IndicationResult, UdsMessagePtr > IndicateMessage(UdsMessage::Address source_addr, UdsMessage::Address target_addr, UdsMessage::TargetAddressType type, ChannelID channel_id, std::size_t size, Priority priority, ProtocolKind protocol_kind, core_type::Span< std::uint8_t const > payload_info)=0
Function to indicate a start of reception of message.
 
virtual UdsTransportProtocolMgr::TransmissionResult Transmit(UdsMessageConstPtr message)=0
Function to transmit a valid Uds message.
 
virtual InitializationResult Initialize()=0
Function to initialize the connection.
 
ConnectionId connection_id_
Store the connection id.
 
std::string connection_name_
Store the connection name.
 
virtual void Stop()=0
Function to stop the connection.
 
virtual bool IsConnectToHost()=0
Function to check if connected to host remote server.
 
virtual UdsTransportProtocolMgr::ConnectionResult ConnectToHost(UdsMessageConstPtr message)=0
Function to establish connection to remote host server.
 
Connection(std::string_view connection_name, ConnectionId connection_id, uds_transport::ConversionHandler const &conversation_handler) noexcept
Constructor to create a new connection.
 
virtual void Start()=0
Function to start the connection.
 
virtual void HandleMessage(UdsMessagePtr message)=0
Function to Hands over a valid received Uds message.
 
virtual UdsTransportProtocolMgr::DisconnectionResult DisconnectFromHost()=0
Function to disconnect from remote host server.
 
std::string_view GetConnectionName() const noexcept
Function to get the connection name.
 
Class to manage reception from transport protocol handler to connection handler.
 
InitializationResult
Definitions of different initialization result.
 
std::string CreateConnectionName(std::string_view connection_name, std::uint8_t connection_id)
Function to append the connection id to the connection name.
 
std::string Append(T... args)
 
std::string_view ProtocolKind
 
std::unique_ptr< const UdsMessage > UdsMessageConstPtr
 
std::unique_ptr< UdsMessage > UdsMessagePtr