Diag-Client-Lib
|
Protocol handler class to manage the whole Doip protocol communication. More...
#include <doip_transport_protocol_handler.h>
Public Types | |
using | UdsTransportProtocolHandlerId = uds_transport::UdsTransportProtocolHandler::UdsTransportProtocolHandlerId |
Type alias for handler id. More... | |
using | InitializationResult = uds_transport::UdsTransportProtocolHandler::InitializationResult |
Type alias for Initialization result. More... | |
![]() | |
enum class | InitializationResult : std::uint8_t { kInitializeOk = 0 , kInitializeFailed = 1 } |
Definitions of different initialization result. More... | |
using | UdsTransportProtocolHandlerId = std::uint8_t |
Type alias for handler id. More... | |
Public Member Functions | |
DoipTransportProtocolHandler (UdsTransportProtocolHandlerId handler_id, uds_transport::UdsTransportProtocolMgr const &transport_protocol_mgr) | |
Constructs an instance of DoipTransportProtocolHandler. More... | |
~DoipTransportProtocolHandler () final | |
Destruct an instance of DoipTransportProtocolHandler. More... | |
InitializationResult | Initialize () override |
Function to initialize the handler. More... | |
void | Start () override |
Function to start the protocol handler. More... | |
void | Stop () override |
Function to stop the protocol handler. More... | |
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. More... | |
std::unique_ptr< uds_transport::Connection > | CreateUdpConnection (uds_transport::ConversionHandler &conversation, std::string_view udp_ip_address, std::uint16_t port_num) override |
Function to create a new Udp connection. More... | |
![]() | |
UdsTransportProtocolHandler (UdsTransportProtocolHandlerId const handler_id, UdsTransportProtocolMgr const &) | |
Constructs an instance of UdsTransportProtocolHandler. More... | |
virtual | ~UdsTransportProtocolHandler ()=default |
Destruct an instance of UdsTransportProtocolHandler. More... | |
virtual UdsTransportProtocolHandlerId | GetHandlerID () const |
Function to get the handler id. More... | |
virtual std::unique_ptr< Connection > | CreateTcpConnection (ConversionHandler &conversion_handler, std::string_view tcpIpaddress, uint16_t portNum)=0 |
Function to create a new Tcp connection. More... | |
virtual std::unique_ptr< Connection > | CreateUdpConnection (ConversionHandler &conversion_handler, std::string_view udpIpaddress, uint16_t portNum)=0 |
Function to create a new Udp connection. More... | |
Private Attributes | |
connection::ConnectionManager | connection_mgr_ |
Store Doip Connection manager. More... | |
Additional Inherited Members | |
![]() | |
UdsTransportProtocolHandlerId | handler_id_ |
Store the handler id. More... | |
Protocol handler class to manage the whole Doip protocol communication.
This class must be instantiated by user for using the DoIP functionalities. This will inherit uds transport protocol handler
Definition at line 25 of file doip_transport_protocol_handler.h.
using doip_client::transport_protocol_handler::DoipTransportProtocolHandler::InitializationResult = uds_transport::UdsTransportProtocolHandler::InitializationResult |
Type alias for Initialization result.
Definition at line 36 of file doip_transport_protocol_handler.h.
using doip_client::transport_protocol_handler::DoipTransportProtocolHandler::UdsTransportProtocolHandlerId = uds_transport::UdsTransportProtocolHandler::UdsTransportProtocolHandlerId |
Type alias for handler id.
Definition at line 30 of file doip_transport_protocol_handler.h.
doip_client::transport_protocol_handler::DoipTransportProtocolHandler::DoipTransportProtocolHandler | ( | UdsTransportProtocolHandlerId | handler_id, |
uds_transport::UdsTransportProtocolMgr const & | transport_protocol_mgr | ||
) |
Constructs an instance of DoipTransportProtocolHandler.
[in] | handler_id | The id of this transport protocol handler |
[in] | transport_protocol_mgr | The reference to transport protocol manager |
Definition at line 16 of file doip_transport_protocol_handler.cpp.
|
finaldefault |
Destruct an instance of DoipTransportProtocolHandler.
|
override |
Function to create a new Tcp connection.
[in] | conversation | The conversation handler used by tcp connection to communicate |
[in] | tcp_ip_address | The local tcp ip address |
[in] | port_num | The local port number |
Definition at line 31 of file doip_transport_protocol_handler.cpp.
References connection_mgr_, doip_client::connection::ConnectionManager::CreateTcpConnection(), FILE_NAME, and doip_client::logger::DoipClientLogger::GetDiagClientLogger().
|
override |
Function to create a new Udp connection.
[in] | conversation | The conversation handler used by udp connection to communicate |
[in] | udp_ip_address | The local udp ip address |
[in] | port_num | The local port number |
Definition at line 42 of file doip_transport_protocol_handler.cpp.
References connection_mgr_, doip_client::connection::ConnectionManager::CreateUdpConnection(), FILE_NAME, and doip_client::logger::DoipClientLogger::GetDiagClientLogger().
|
overridevirtual |
Function to initialize the handler.
Implements uds_transport::UdsTransportProtocolHandler.
Definition at line 23 of file doip_transport_protocol_handler.cpp.
References uds_transport::UdsTransportProtocolHandler::kInitializeOk.
|
overridevirtual |
Function to start the protocol handler.
Implements uds_transport::UdsTransportProtocolHandler.
Definition at line 27 of file doip_transport_protocol_handler.cpp.
|
overridevirtual |
Function to stop the protocol handler.
Implements uds_transport::UdsTransportProtocolHandler.
Definition at line 29 of file doip_transport_protocol_handler.cpp.
|
private |
Store Doip Connection manager.
Definition at line 102 of file doip_transport_protocol_handler.h.
Referenced by CreateTcpConnection(), and CreateUdpConnection().