11 #include "common/logger.h"
16 namespace udp_channel {
120 std::make_unique<kIdle>(VehicleDiscoveryState::kIdle));
123 std::make_unique<kWaitForVehicleAnnouncement>(
124 VehicleDiscoveryState::kWaitForVehicleAnnouncement));
127 VehicleDiscoveryState::kDoIPCtrlTimeout,
128 std::make_unique<kDoIPCtrlTimeout>(VehicleDiscoveryState::kDoIPCtrlTimeout));
164 if (handler_impl_->GetStateContext().GetActiveState().GetState() ==
165 VehicleDiscoveryState::kWaitForVehicleAnnouncement) {
168 FILE_NAME, __LINE__, __func__, [](std::stringstream &msg) {
169 msg <<
"Processing of vehicle announcement is not implemented";
Immutable class to store received doip message.
Class to manage a udp channel as per DoIP protocol.
Class implements vehicle discovery handler.
VehicleDiscoveryHandlerImpl(sockets::UdpSocketHandler &udp_socket_handler)
Constructs an instance of VehicleDiscoveryHandlerImpl.
auto GetSocketHandler() noexcept -> sockets::UdpSocketHandler &
Function to get the socket handler.
auto GetStateContext() noexcept -> VehicleDiscoveryStateContext &
Function to get the Vehicle Discovery State context.
VehicleDiscoveryStateContext state_context_
Stores the vehicle discovery states.
sockets::UdpSocketHandler & udp_socket_handler_
The reference to socket handler.
~VehicleDiscoveryHandler()
Destruct an instance of VehicleDiscoveryHandler.
void ProcessVehicleAnnouncementResponse(DoipMessage &doip_payload) noexcept
Function to process received vehicle announcement response.
VehicleDiscoveryHandler(sockets::UdpSocketHandler &udp_socket_handler, DoipUdpChannel &channel)
Constructs an instance of VehicleDiscoveryHandler.
Class implements idle state.
void Stop() override
Function to stop the current state.
kIdle(VehicleDiscoveryState state)
Constructs an instance of kIdle.
void Start() override
Function to start the current state.
Class implements idle state.
kDoIPCtrlTimeout(VehicleDiscoveryState state)
Constructs an instance of kDoIPCtrlTimeout.
void Stop() override
Function to stop the current state.
void Start() override
Function to start the current state.
Class implements idle state.
kWaitForVehicleAnnouncement(VehicleDiscoveryState state)
Constructs an instance of kWaitForVehicleAnnouncement.
void Start() override
Function to start the current state.
void Stop() override
Function to stop the current state.
static auto GetDiagClientLogger() noexcept -> DoipClientLogger &
Handler class to manage different socket of various client (Udp / Tcp)
void TransitionTo(EnumState state)
void AddState(EnumState state, std::unique_ptr< State< EnumState >> state_ptr)
VehicleDiscoveryState
Different vehicle discovery state.
SocketHandler< boost_support::client::udp::UdpClient > UdpSocketHandler
Type alias of Udp socket handler.
State
Definitions of different connection state.