Diag-Client-Lib
|
Doip Udp Connection handle connection between two layers. More...
Public Types | |
using | InitializationResult = uds_transport::Connection::InitializationResult |
Type alias for Initialization result. More... | |
Public Types inherited from uds_transport::Connection | |
using | ConnectionId = std::uint8_t |
Type alias for connection id. More... | |
using | InitializationResult = uds_transport::UdsTransportProtocolHandler::InitializationResult |
Type alias for Initialization result. More... | |
Public Member Functions | |
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. More... | |
~DoipUdpConnection () final=default | |
Destruct an instance of DoipUdpConnection. More... | |
InitializationResult | Initialize () override |
Function to initialize the connection. More... | |
void | Start () override |
Function to start the connection. More... | |
void | Stop () override |
Function to stop the connection. More... | |
bool | IsConnectToHost () override |
Function to check if connected to host remote server. More... | |
uds_transport::UdsTransportProtocolMgr::ConnectionResult | ConnectToHost (uds_transport::UdsMessageConstPtr) override |
Function to establish connection to remote host server. More... | |
uds_transport::UdsTransportProtocolMgr::DisconnectionResult | DisconnectFromHost () override |
Function to disconnect from remote host server. More... | |
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. More... | |
uds_transport::UdsTransportProtocolMgr::TransmissionResult | Transmit (uds_transport::UdsMessageConstPtr message) override |
Function to transmit a valid Uds message. More... | |
void | HandleMessage (uds_transport::UdsMessagePtr message) override |
Function to Hands over a valid received Uds message. More... | |
Public Member Functions inherited from uds_transport::Connection | |
Connection (ConnectionId connection_id, uds_transport::ConversionHandler const &conversation_handler) noexcept | |
Constructor to create a new connection. More... | |
virtual | ~Connection ()=default |
Destruct an instance of Connection. More... | |
ConnectionId | GetConnectionId () noexcept |
Function to get the connection id. More... | |
ConnectionId | GetConnectionId () const |
Function to get the connection id. More... | |
Private Attributes | |
channel::udp_channel::DoipUdpChannel | doip_udp_channel_ |
Store the reference to doip udp channel. More... | |
Additional Inherited Members | |
Protected Attributes inherited from uds_transport::Connection | |
uds_transport::ConversionHandler const & | conversation_handler_ |
Store the conversation handler. More... | |
Doip Udp Connection handle connection between two layers.
Definition at line 154 of file connection_manager.cpp.
using doip_client::connection::DoipUdpConnection::InitializationResult = uds_transport::Connection::InitializationResult |
Type alias for Initialization result.
Definition at line 159 of file connection_manager.cpp.
|
inline |
Constructor to create a new udp connection.
[in] | conversation_handler | The reference to conversation handler |
[in] | udp_ip_address | The local tcp ip address |
[in] | port_num | The local port number |
Definition at line 170 of file connection_manager.cpp.
|
finaldefault |
Destruct an instance of DoipUdpConnection.
|
inlineoverridevirtual |
Function to establish connection to remote host server.
[in] | message | The connection message |
Implements uds_transport::Connection.
Definition at line 208 of file connection_manager.cpp.
References uds_transport::UdsTransportProtocolMgr::kConnectionFailed.
|
inlineoverridevirtual |
Function to disconnect from remote host server.
Implements uds_transport::Connection.
Definition at line 216 of file connection_manager.cpp.
References uds_transport::UdsTransportProtocolMgr::kDisconnectionFailed.
|
inlineoverridevirtual |
Function to Hands over a valid received Uds message.
[in] | message | The Uds message ptr (unique_ptr semantics) with the request. Ownership of the UdsMessage is given back to the conversation here |
Implements uds_transport::Connection.
Definition at line 271 of file connection_manager.cpp.
References uds_transport::Connection::conversation_handler_, and uds_transport::ConversionHandler::HandleMessage().
|
inlineoverridevirtual |
Function to indicate a start of reception of message.
This is called to indicate the reception of new message by underlying transport protocol handler
[in] | source_addr | The UDS source address of message |
[in] | target_addr | The UDS target address of message |
[in] | type | The indication whether its is phys/func request |
[in] | channel_id | The transport protocol channel on which message start happened |
[in] | size | The size in bytes of the UdsMessage starting from SID |
[in] | priority | The priority of the given message, used for prioritization of conversations |
[in] | protocol_kind | The identifier of protocol kind associated to message |
[in] | payload_info | The 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 |
Implements uds_transport::Connection.
Definition at line 245 of file connection_manager.cpp.
References uds_transport::Connection::conversation_handler_, and uds_transport::ConversionHandler::IndicateMessage().
|
inlineoverridevirtual |
Function to initialize the connection.
Implements uds_transport::Connection.
Definition at line 184 of file connection_manager.cpp.
References uds_transport::UdsTransportProtocolHandler::kInitializeOk.
|
inlineoverridevirtual |
Function to check if connected to host remote server.
Implements uds_transport::Connection.
Definition at line 200 of file connection_manager.cpp.
|
inlineoverridevirtual |
Function to start the connection.
Implements uds_transport::Connection.
Definition at line 189 of file connection_manager.cpp.
References doip_udp_channel_, and doip_client::channel::udp_channel::DoipUdpChannel::Start().
|
inlineoverridevirtual |
Function to stop the connection.
Implements uds_transport::Connection.
Definition at line 194 of file connection_manager.cpp.
References doip_udp_channel_, and doip_client::channel::udp_channel::DoipUdpChannel::Stop().
|
inlineoverridevirtual |
Function to transmit a valid Uds message.
[in] | message | The Uds message ptr (unique_ptr semantics) with the request. |
Implements uds_transport::Connection.
Definition at line 260 of file connection_manager.cpp.
References doip_udp_channel_, and doip_client::channel::udp_channel::DoipUdpChannel::Transmit().
|
private |
Store the reference to doip udp channel.
Definition at line 280 of file connection_manager.cpp.
Referenced by Start(), Stop(), and Transmit().