Diag-Client-Lib
|
Class used as a handler to process routing activation messages. More...
#include <doip_routing_activation_handler.h>
Classes | |
class | RoutingActivationHandlerImpl |
Class implements routing activation handler. More... | |
Public Types | |
using | TcpMessagePtr = sockets::TcpSocketHandler::TcpMessagePtr |
Type alias for Tcp message pointer. More... | |
using | TcpMessage = sockets::TcpSocketHandler::TcpMessage |
Type alias for Tcp message. More... | |
Public Member Functions | |
RoutingActivationHandler (sockets::TcpSocketHandler &tcp_socket_handler) | |
Constructs an instance of RoutingActivationHandler. More... | |
~RoutingActivationHandler () | |
Destruct an instance of RoutingActivationHandler. More... | |
void | Start () |
Function to start the handler. More... | |
void | Stop () |
Function to stop the handler. More... | |
void | Reset () |
Function to reset the handler. More... | |
void | ProcessDoIPRoutingActivationResponse (DoipMessage &doip_payload) noexcept |
Function to process received routing activation response. More... | |
auto | HandleRoutingActivationRequest (uds_transport::UdsMessageConstPtr routing_activation_request) noexcept -> uds_transport::UdsTransportProtocolMgr::ConnectionResult |
Function to handle sending of routing activation request. More... | |
auto | IsRoutingActivated () noexcept -> bool |
Check if routing activation is active for this handler. More... | |
Private Member Functions | |
auto | SendRoutingActivationRequest (uds_transport::UdsMessageConstPtr routing_activation_request) noexcept -> uds_transport::UdsTransportProtocolMgr::TransmissionResult |
Function to send routing activation request. More... | |
Static Private Member Functions | |
static void | CreateDoipGenericHeader (std::vector< std::uint8_t > &doip_header, std::uint16_t payload_type, std::uint32_t payload_len) |
Function to create doip generic header. More... | |
Private Attributes | |
std::unique_ptr< RoutingActivationHandlerImpl > | handler_impl_ |
Stores the Handler implementation. More... | |
Class used as a handler to process routing activation messages.
Definition at line 29 of file doip_routing_activation_handler.h.
using doip_client::channel::tcp_channel::RoutingActivationHandler::TcpMessage = sockets::TcpSocketHandler::TcpMessage |
Type alias for Tcp message.
Definition at line 39 of file doip_routing_activation_handler.h.
using doip_client::channel::tcp_channel::RoutingActivationHandler::TcpMessagePtr = sockets::TcpSocketHandler::TcpMessagePtr |
Type alias for Tcp message pointer.
Definition at line 34 of file doip_routing_activation_handler.h.
|
explicit |
Constructs an instance of RoutingActivationHandler.
[in] | tcp_socket_handler | The reference to socket handler |
Definition at line 310 of file doip_routing_activation_handler.cpp.
|
default |
Destruct an instance of RoutingActivationHandler.
|
staticprivate |
Function to create doip generic header.
[in,out] | doip_header | The doip header |
[in] | payload_type | The type of payload |
[in] | payload_len | The length of payload |
Definition at line 443 of file doip_routing_activation_handler.cpp.
References doip_client::kDoip_ProtocolVersion.
|
noexcept |
Function to handle sending of routing activation request.
[in] | routing_activation_request | The routing activation request |
Definition at line 359 of file doip_routing_activation_handler.cpp.
References doip_client::logger::DoipClientLogger::GetDiagClientLogger(), uds_transport::UdsTransportProtocolMgr::kConnectionFailed, uds_transport::UdsTransportProtocolMgr::kConnectionOk, uds_transport::UdsTransportProtocolMgr::kConnectionTimeout, doip_client::channel::tcp_channel::anonymous_namespace{doip_routing_activation_handler.cpp}::kDoIPRoutingActivationTimeout, and uds_transport::UdsTransportProtocolMgr::kTransmitOk.
|
noexcept |
Check if routing activation is active for this handler.
Definition at line 410 of file doip_routing_activation_handler.cpp.
References handler_impl_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannelHandler::IsRoutingActivated().
|
noexcept |
Function to process received routing activation response.
[in] | doip_payload | The doip message received |
Definition at line 321 of file doip_routing_activation_handler.cpp.
References doip_client::logger::DoipClientLogger::GetDiagClientLogger(), doip_client::channel::tcp_channel::anonymous_namespace{doip_routing_activation_handler.cpp}::kDoip_RoutingActivation_ResCode_ConfirmtnRequired, and doip_client::channel::tcp_channel::anonymous_namespace{doip_routing_activation_handler.cpp}::kDoip_RoutingActivation_ResCode_RoutingSuccessful.
void doip_client::channel::tcp_channel::RoutingActivationHandler::Reset | ( | ) |
Function to reset the handler.
This will reset all the internal handler back to default state
Definition at line 319 of file doip_routing_activation_handler.cpp.
References handler_impl_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannelHandler::Reset().
|
privatenoexcept |
Function to send routing activation request.
[in] | routing_activation_request | The routing activation request |
Definition at line 415 of file doip_routing_activation_handler.cpp.
References doip_client::channel::udp_channel::anonymous_namespace{doip_vehicle_identification_handler.cpp}::CreateDoipGenericHeader(), doip_client::channel::tcp_channel::anonymous_namespace{doip_routing_activation_handler.cpp}::kDoip_RoutingActivation_ReqActType_Default, doip_client::channel::tcp_channel::anonymous_namespace{doip_routing_activation_handler.cpp}::kDoip_RoutingActivation_ReqMinLen, doip_client::channel::tcp_channel::anonymous_namespace{doip_routing_activation_handler.cpp}::kDoip_RoutingActivation_ReqType, doip_client::kDoipheadrSize, uds_transport::UdsTransportProtocolMgr::kTransmitFailed, and uds_transport::UdsTransportProtocolMgr::kTransmitOk.
void doip_client::channel::tcp_channel::RoutingActivationHandler::Start | ( | ) |
Function to start the handler.
Definition at line 315 of file doip_routing_activation_handler.cpp.
References handler_impl_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannelHandler::Start().
void doip_client::channel::tcp_channel::RoutingActivationHandler::Stop | ( | ) |
Function to stop the handler.
This will reset all the internal handler back to default state
Definition at line 317 of file doip_routing_activation_handler.cpp.
References handler_impl_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannelHandler::Stop().
|
private |
Stores the Handler implementation.
Definition at line 124 of file doip_routing_activation_handler.h.
Referenced by IsRoutingActivated(), Reset(), Start(), and Stop().