Diag-Client-Lib
doip_transport_protocol_handler.h
Go to the documentation of this file.
1 /* Diagnostic Client library
2  * Copyright (C) 2024 Avijit Dey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 #ifndef DIAG_CLIENT_LIB_LIB_DOIP_CLIENT_DOIP_TRANSPORT_PROTOCOL_HANDLER_H_
9 #define DIAG_CLIENT_LIB_LIB_DOIP_CLIENT_DOIP_TRANSPORT_PROTOCOL_HANDLER_H_
10 
11 #include <memory>
12 #include <string_view>
13 
16 
17 namespace doip_client {
18 namespace transport_protocol_handler {
19 
26  public:
31 
36 
45  uds_transport::UdsTransportProtocolMgr const &transport_protocol_mgr);
46 
51 
57 
61  void Start() override;
62 
66  void Stop() override;
67 
78  std::unique_ptr<uds_transport::Connection> CreateTcpConnection(uds_transport::ConversionHandler &conversation,
79  std::string_view tcp_ip_address,
80  std::uint16_t port_num) override;
81 
92  std::unique_ptr<uds_transport::Connection> CreateUdpConnection(uds_transport::ConversionHandler &conversion_handler,
93  std::string_view udp_ip_address,
94  std::uint16_t port_num) override;
95 
96  private:
100  connection::DoipConnectionManager doip_connection_mgr_;
101 };
102 
103 } // namespace transport_protocol_handler
104 } // namespace doip_client
105 
106 #endif // DIAG_CLIENT_LIB_LIB_DOIP_CLIENT_DOIP_TRANSPORT_PROTOCOL_HANDLER_H_
Protocol handler class to manage the whole Doip protocol communication.
DoipTransportProtocolHandler(UdsTransportProtocolHandlerId handler_id, uds_transport::UdsTransportProtocolMgr const &transport_protocol_mgr)
Constructs an instance of DoipTransportProtocolHandler.
connection::DoipConnectionManager doip_connection_mgr_
Store Doip Connection manager.
std::unique_ptr< uds_transport::Connection > CreateTcpConnection(uds_transport::ConversionHandler &conversation, std::string_view tcp_ip_address, std::uint16_t port_num) override
Function to create a new Tcp connection.
std::unique_ptr< uds_transport::Connection > CreateUdpConnection(uds_transport::ConversionHandler &conversion_handler, std::string_view udp_ip_address, std::uint16_t port_num) override
Function to create a new Udp connection.
InitializationResult Initialize() override
Function to initialize the handler.
uds_transport::UdsTransportProtocolHandler::UdsTransportProtocolHandlerId UdsTransportProtocolHandlerId
Type alias for handler id.
~DoipTransportProtocolHandler() final
Destruct an instance of DoipTransportProtocolHandler.
std::uint8_t UdsTransportProtocolHandlerId
Type alias for handler id.
InitializationResult
Definitions of different initialization result.