16 namespace connection {
38 std::uint16_t port_num)
113 std::pair<uds_transport::UdsTransportProtocolMgr::IndicationResult, uds_transport::UdsMessagePtr>
IndicateMessage(
120 protocol_kind, payload_info));
171 std::uint16_t port_num)
245 std::pair<uds_transport::UdsTransportProtocolMgr::IndicationResult, uds_transport::UdsMessagePtr>
IndicateMessage(
252 protocol_kind, payload_info));
285 return (std::make_unique<DoipTcpConnection>(conversation, tcp_ip_address, port_num));
290 return (std::make_unique<DoipUdpConnection>(conversation, udp_ip_address, port_num));
Class to manage a tcp channel as per DoIP protocol.
void Stop()
Function to stop the channel.
void Start()
Function to start the channel.
bool IsConnectToHost()
Function to check if connected to host remote server.
uds_transport::UdsTransportProtocolMgr::ConnectionResult ConnectToHost(uds_transport::UdsMessageConstPtr message)
Function to establish connection to remote host server.
uds_transport::UdsTransportProtocolMgr::DisconnectionResult DisconnectFromHost()
Function to disconnect from remote host server.
uds_transport::UdsTransportProtocolMgr::TransmissionResult Transmit(uds_transport::UdsMessageConstPtr message)
Function to transmit a valid Uds message.
Class to manage a udp channel as per DoIP protocol.
uds_transport::UdsTransportProtocolMgr::TransmissionResult Transmit(uds_transport::UdsMessageConstPtr message)
Function to transmit a Vehicle Identification request.
void Start()
Function to start the channel.
void Stop()
Function to stop the channel.
std::unique_ptr< uds_transport::Connection > FindOrCreateTcpConnection(uds_transport::ConversionHandler const &conversation, std::string_view tcp_ip_address, std::uint16_t port_num)
Function to find or create a new Tcp connection.
std::unique_ptr< uds_transport::Connection > FindOrCreateUdpConnection(uds_transport::ConversionHandler const &conversation, std::string_view udp_ip_address, std::uint16_t port_num)
Function to find or create a new Udp connection.
Doip Tcp Connection handle connection between two layers.
InitializationResult Initialize() override
Function to initialize the connection.
bool IsConnectToHost() override
Function to check if connected to host remote server.
DoipTcpConnection(uds_transport::ConversionHandler const &conversation_handler, std::string_view tcp_ip_address, std::uint16_t port_num)
Constructor to create a new tcp connection.
channel::tcp_channel::DoipTcpChannel doip_tcp_channel_
Store the reference to doip tcp channel.
void Start() override
Function to start the connection.
uds_transport::UdsTransportProtocolMgr::TransmissionResult Transmit(uds_transport::UdsMessageConstPtr message) override
Function to transmit a valid Uds message.
void HandleMessage(uds_transport::UdsMessagePtr message) override
Function to Hands over a valid received Uds message.
uds_transport::UdsTransportProtocolMgr::DisconnectionResult DisconnectFromHost() override
Function to disconnect from remote host server.
void Stop() override
Function to stop the connection.
uds_transport::UdsTransportProtocolMgr::ConnectionResult ConnectToHost(uds_transport::UdsMessageConstPtr message) override
Function to establish connection to remote host server.
~DoipTcpConnection() final=default
Destruct an instance of DoipTcpConnection.
std::pair< uds_transport::UdsTransportProtocolMgr::IndicationResult, uds_transport::UdsMessagePtr > 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) override
Function to indicate a start of reception of message.
Doip Udp Connection handle connection between two layers.
DoipUdpConnection(uds_transport::ConversionHandler const &conversation_handler, std::string_view udp_ip_address, std::uint16_t port_num)
Constructor to create a new udp connection.
InitializationResult Initialize() override
Function to initialize the connection.
channel::udp_channel::DoipUdpChannel doip_udp_channel_
Store the reference to doip udp channel.
void Stop() override
Function to stop the connection.
std::pair< uds_transport::UdsTransportProtocolMgr::IndicationResult, uds_transport::UdsMessagePtr > 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) override
Function to indicate a start of reception of message.
bool IsConnectToHost() override
Function to check if connected to host remote server.
uds_transport::UdsTransportProtocolMgr::TransmissionResult Transmit(uds_transport::UdsMessageConstPtr message) override
Function to transmit a valid Uds message.
void Start() override
Function to start the connection.
void HandleMessage(uds_transport::UdsMessagePtr message) override
Function to Hands over a valid received Uds message.
uds_transport::UdsTransportProtocolMgr::DisconnectionResult DisconnectFromHost() override
Function to disconnect from remote host server.
~DoipUdpConnection() final=default
Destruct an instance of DoipUdpConnection.
uds_transport::UdsTransportProtocolMgr::ConnectionResult ConnectToHost(uds_transport::UdsMessageConstPtr) override
Function to establish connection to remote host server.
Interface class to handle connection between two layers.
uds_transport::UdsTransportProtocolHandler::InitializationResult InitializationResult
Type alias for Initialization result.
uds_transport::ConversionHandler const & conversation_handler_
Store the conversation handler.
Connection(ConnectionId connection_id, uds_transport::ConversionHandler const &conversation_handler) noexcept
Constructor to create a new connection.
Class to manage reception from transport protocol handler to connection handler.
virtual void HandleMessage(UdsMessagePtr message) const noexcept=0
Function to Hands over a valid received Uds message.
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 > payload_info) const noexcept=0
Function to indicate a start of reception of message.
InitializationResult
Definitions of different initialization result.
std::string_view ProtocolKind
std::unique_ptr< const UdsMessage > UdsMessageConstPtr
std::unique_ptr< UdsMessage > UdsMessagePtr