14 #include "common/logger.h" 
   19 namespace udp_channel {
 
   33     : vehicle_discovery_handler_{udp_socket_handler_broadcast, channel},
 
   34       vehicle_identification_handler_{udp_socket_handler_unicast, channel} {}
 
   42   std::uint8_t 
const handler_type{vehicle_identification_request->GetPayload()[0u]};
 
   44   switch (handler_type) {
 
   47       ret_val = vehicle_identification_handler_.HandleVehicleIdentificationRequest(
 
   48           std::move(vehicle_identification_request));
 
   58   std::uint8_t nack_code{};
 
   60                               udp_rx_message->GetHostPortNumber(), udp_rx_message->GetPayload()};
 
   62   if (ProcessDoIPHeader(doip_rx_message, nack_code)) {
 
   63     ProcessDoIPPayload(doip_rx_message);
 
   73                               udp_rx_message->GetHostPortNumber(), udp_rx_message->GetPayload()};
 
   75   if (ProcessDoIPHeader(doip_rx_message, nack_code)) {
 
   76     vehicle_discovery_handler_.ProcessVehicleAnnouncementResponse(doip_rx_message);
 
   84                                               std::uint8_t &nack_code) noexcept -> 
bool {
 
   88        (doip_rx_message.GetInverseProtocolVersion() ==
 
   91        (doip_rx_message.GetInverseProtocolVersion() ==
 
  100           if (ProcessDoIPPayloadLength(doip_rx_message.GetPayloadLength(),
 
  101                                        doip_rx_message.GetPayloadType())) {
 
  127                                                      std::uint16_t payload_type) noexcept -> 
bool {
 
  129   switch (payload_type) {
 
Immutable class to store received doip message.
 
std::uint16_t GetPayloadType() const
Get the payload type.
 
RxSocketType
Definition of socket type from where the request was received.
 
std::mutex channel_handler_lock
Mutex to protect critical section.
 
auto ProcessDoIPHeader(DoipMessage &doip_rx_message, std::uint8_t &nack_code) noexcept -> bool
Function to process doip header in received response.
 
sockets::UdpSocketHandler::MessagePtr UdpMessagePtr
Type alias for Tcp message pointer.
 
auto SendVehicleIdentificationRequest(uds_transport::UdsMessageConstPtr vehicle_identification_request) noexcept -> uds_transport::UdsTransportProtocolMgr::TransmissionResult
Function to vehicle identification request to the connected network.
 
void ProcessDoIPPayload(DoipMessage &doip_payload, DoipMessage::RxSocketType socket_type=DoipMessage::RxSocketType::kUnicast)
Function to process the doip payload.
 
VehicleIdentificationHandler vehicle_identification_handler_
Handler to process vehicle identification req/res messages.
 
DoipUdpChannelHandler(sockets::UdpSocketHandler &udp_socket_handler_broadcast, sockets::UdpSocketHandler &udp_socket_handler_unicast, DoipUdpChannel &channel)
Constructs an instance of DoipUdpChannelHandler.
 
void HandleMessageUnicast(UdpMessagePtr udp_rx_message) noexcept
Function to process the received unicast udp message.
 
static auto ProcessDoIPPayloadLength(std::uint32_t payload_len, std::uint16_t payload_type) noexcept -> bool
Function to verify payload length of various payload type.
 
void HandleMessageBroadcast(UdpMessagePtr udp_rx_message) noexcept
Function to process the received broadcast udp message.
 
Class to manage a udp channel as per DoIP protocol.
 
void ProcessVehicleIdentificationResponse(DoipMessage &doip_payload) noexcept
Function to process received vehicle identification response.
 
Handler class to manage different socket of various client (Udp / Tcp)
 
constexpr std::uint8_t kDoip_GenericHeader_IncorrectPattern
Generic DoIP Header NACK codes.
 
constexpr std::uint8_t kDoip_GenericHeader_OutOfMemory
 
constexpr std::uint8_t kDoip_GenericHeader_InvalidPayloadLen
 
constexpr std::uint8_t kDoip_GenericHeader_MessageTooLarge
 
constexpr std::uint8_t kDoip_GenericHeader_UnknownPayload
 
constexpr std::uint8_t kDoip_ProtocolVersion_Def
 
constexpr std::uint32_t kDoip_Protocol_MaxPayload
 
constexpr std::uint32_t kUdpChannelLength
 
constexpr std::uint16_t kDoip_VehicleAnnouncement_ResType
 
constexpr std::uint8_t kDoip_ProtocolVersion
 
constexpr std::uint32_t kDoip_VehicleAnnouncement_ResMaxLen
 
std::unique_ptr< const UdsMessage > UdsMessageConstPtr