Diag-Client-Lib
Public Types | Public Member Functions | Private Attributes | List of all members
doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl Class Referencefinal

Class implements vehicle identification handler. More...

Collaboration diagram for doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl:
Collaboration graph
[legend]

Public Types

using VehicleIdentificationStateContext = utility::state::StateContext< VehicleIdentificationState >
 Type alias for state context. More...
 
using SyncTimer = utility::sync_timer::SyncTimer< std::chrono::steady_clock >
 Type alias for Sync timer. More...
 

Public Member Functions

 VehicleIdentificationHandlerImpl (sockets::UdpSocketHandler &udp_socket_handler, DoipUdpChannel &channel)
 Constructs an instance of VehicleDiscoveryHandlerImpl. More...
 
auto GetStateContext () noexcept -> VehicleIdentificationStateContext &
 Function to get the Vehicle Identification State context. More...
 
auto GetSocketHandler () noexcept -> sockets::UdpSocketHandler &
 Function to get the socket handler. More...
 
auto GetDoipChannel () noexcept -> DoipUdpChannel &
 Function to get the doip channel. More...
 
auto GetSyncTimer () noexcept -> SyncTimer &
 Function to get the sync timer. More...
 

Private Attributes

sockets::UdpSocketHandlerudp_socket_handler_
 The reference to socket handler. More...
 
DoipUdpChannelchannel_
 The reference to doip channel. More...
 
VehicleIdentificationStateContext state_context_
 Stores the vehicle identification states. More...
 
SyncTimer sync_timer_
 Store the synchronous timer. More...
 

Detailed Description

Class implements vehicle identification handler.

Definition at line 178 of file doip_vehicle_identification_handler.cpp.

Member Typedef Documentation

◆ SyncTimer

Type alias for Sync timer.

Definition at line 188 of file doip_vehicle_identification_handler.cpp.

◆ VehicleIdentificationStateContext

Type alias for state context.

Definition at line 183 of file doip_vehicle_identification_handler.cpp.

Constructor & Destructor Documentation

◆ VehicleIdentificationHandlerImpl()

doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::VehicleIdentificationHandlerImpl ( sockets::UdpSocketHandler udp_socket_handler,
DoipUdpChannel channel 
)
inlineexplicit

Constructs an instance of VehicleDiscoveryHandlerImpl.

Parameters
[in]udp_socket_handlerThe reference to socket handler

Definition at line 195 of file doip_vehicle_identification_handler.cpp.

196  : udp_socket_handler_{udp_socket_handler},
197  channel_{channel},
198  state_context_{} {
199  // create and add state for vehicle identification
200  // kIdle
201  state_context_.AddState(VehicleIdentificationState::kIdle,
202  std::make_unique<kIdle>(VehicleIdentificationState::kIdle));
203  // kSendVehicleIdentificationReq
205  VehicleIdentificationState::kSendVehicleIdentificationReq,
206  std::make_unique<kSendVehicleIdentificationReq>(VehicleIdentificationState::kSendVehicleIdentificationReq));
207  // kWaitForVehicleIdentificationRes
208  state_context_.AddState(VehicleIdentificationState::kWaitForVehicleIdentificationRes,
209  std::make_unique<kWaitForVehicleIdentificationRes>(
210  VehicleIdentificationState::kWaitForVehicleIdentificationRes));
211  // kDoIPCtrlTimeout
212  state_context_.AddState(VehicleIdentificationState::kDoIPCtrlTimeout,
213  std::make_unique<kDoIPCtrlTimeout>(VehicleIdentificationState::kDoIPCtrlTimeout));
214  // Transit to idle state
215  state_context_.TransitionTo(VehicleIdentificationState::kIdle);
216  }
void TransitionTo(EnumState state)
Definition: state.h:69
void AddState(EnumState state, std::unique_ptr< State< EnumState >> state_ptr)
Definition: state.h:58

References utility::state::StateContext< EnumState >::AddState(), state_context_, and utility::state::StateContext< EnumState >::TransitionTo().

Here is the call graph for this function:

Member Function Documentation

◆ GetDoipChannel()

auto doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::GetDoipChannel ( ) -> DoipUdpChannel &
inlinenoexcept

Function to get the doip channel.

Returns
The reference to channel

Definition at line 234 of file doip_vehicle_identification_handler.cpp.

234 { return channel_; }

References channel_.

◆ GetSocketHandler()

auto doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::GetSocketHandler ( ) -> sockets::UdpSocketHandler &
inlinenoexcept

Function to get the socket handler.

Returns
The reference to socket handler

Definition at line 228 of file doip_vehicle_identification_handler.cpp.

228 { return udp_socket_handler_; }

References udp_socket_handler_.

◆ GetStateContext()

auto doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::GetStateContext ( ) -> VehicleIdentificationStateContext &
inlinenoexcept

Function to get the Vehicle Identification State context.

Returns
The reference to state context

Definition at line 222 of file doip_vehicle_identification_handler.cpp.

222 { return state_context_; }

References state_context_.

◆ GetSyncTimer()

auto doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::GetSyncTimer ( ) -> SyncTimer &
inlinenoexcept

Function to get the sync timer.

Returns
The reference to sync timer

Definition at line 240 of file doip_vehicle_identification_handler.cpp.

References sync_timer_.

Member Data Documentation

◆ channel_

DoipUdpChannel& doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::channel_
private

The reference to doip channel.

Definition at line 251 of file doip_vehicle_identification_handler.cpp.

Referenced by GetDoipChannel().

◆ state_context_

VehicleIdentificationStateContext doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::state_context_
private

Stores the vehicle identification states.

Definition at line 256 of file doip_vehicle_identification_handler.cpp.

Referenced by GetStateContext(), and VehicleIdentificationHandlerImpl().

◆ sync_timer_

SyncTimer doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::sync_timer_
private

Store the synchronous timer.

Definition at line 261 of file doip_vehicle_identification_handler.cpp.

Referenced by GetSyncTimer().

◆ udp_socket_handler_

sockets::UdpSocketHandler& doip_client::channel::udp_channel::VehicleIdentificationHandler::VehicleIdentificationHandlerImpl::udp_socket_handler_
private

The reference to socket handler.

Definition at line 246 of file doip_vehicle_identification_handler.cpp.

Referenced by GetSocketHandler().


The documentation for this class was generated from the following file: