Diag-Client-Lib
Classes | Typedefs | Enumerations | Functions
doip_client::channel::udp_channel::anonymous_namespace{doip_vehicle_identification_handler.cpp} Namespace Reference

Classes

class  kIdle
 Class implements idle state. More...
 
class  kSendVehicleIdentificationReq
 Class implements sending of vehicle identification request state. More...
 
class  kWaitForVehicleIdentificationRes
 Class implements wait for vehicle identification response state. More...
 
class  kDoIPCtrlTimeout
 Class implements Ctrl timeout state. More...
 

Typedefs

using VehiclePayloadType = std::pair< std::uint16_t, std::uint8_t >
 Type alias of vehicle payload type. More...
 

Enumerations

enum class  VehicleIdentificationState : std::uint8_t { kIdle = 0U , kSendVehicleIdentificationReq , kWaitForVehicleIdentificationRes , kDoIPCtrlTimeout }
 Different vehicle identification state. More...
 

Functions

void CreateDoipGenericHeader (std::vector< std::uint8_t > &doip_header_buffer, std::uint16_t payload_type, std::uint32_t payload_len)
 Create the doip generic header. More...
 
auto GetVehicleIdentificationPayloadType (std::uint8_t preselection_mode) noexcept -> VehiclePayloadType
 Get the vehicle identification payload type based on preselection mode. More...
 

Typedef Documentation

◆ VehiclePayloadType

using doip_client::channel::udp_channel::anonymous_namespace{doip_vehicle_identification_handler.cpp}::VehiclePayloadType = typedef std::pair<std::uint16_t, std::uint8_t>

Type alias of vehicle payload type.

Definition at line 25 of file doip_vehicle_identification_handler.cpp.

Enumeration Type Documentation

◆ VehicleIdentificationState

enum doip_client::channel::udp_channel::anonymous_namespace{doip_vehicle_identification_handler.cpp}::VehicleIdentificationState : std::uint8_t
strong

Function Documentation

◆ CreateDoipGenericHeader()

void doip_client::channel::udp_channel::anonymous_namespace{doip_vehicle_identification_handler.cpp}::CreateDoipGenericHeader ( std::vector< std::uint8_t > &  doip_header_buffer,
std::uint16_t  payload_type,
std::uint32_t  payload_len 
)

Create the doip generic header.

Definition at line 133 of file doip_vehicle_identification_handler.cpp.

134  {
135  doip_header_buffer.emplace_back(kDoip_ProtocolVersion);
136  doip_header_buffer.emplace_back(~(static_cast<std::uint8_t>(kDoip_ProtocolVersion)));
137  doip_header_buffer.emplace_back(static_cast<std::uint8_t>((payload_type & 0xFF00) >> 8));
138  doip_header_buffer.emplace_back(static_cast<std::uint8_t>(payload_type & 0x00FF));
139  doip_header_buffer.emplace_back(static_cast<std::uint8_t>((payload_len & 0xFF000000) >> 24));
140  doip_header_buffer.emplace_back(static_cast<std::uint8_t>((payload_len & 0x00FF0000) >> 16));
141  doip_header_buffer.emplace_back(static_cast<std::uint8_t>((payload_len & 0x0000FF00) >> 8));
142  doip_header_buffer.emplace_back(static_cast<std::uint8_t>(payload_len & 0x000000FF));
143 }
constexpr std::uint8_t kDoip_ProtocolVersion

References doip_client::kDoip_ProtocolVersion.

Referenced by doip_client::channel::tcp_channel::DiagnosticMessageHandler::SendDiagnosticRequest(), doip_client::channel::tcp_channel::RoutingActivationHandler::SendRoutingActivationRequest(), and doip_client::channel::udp_channel::VehicleIdentificationHandler::SendVehicleIdentificationRequest().

Here is the caller graph for this function:

◆ GetVehicleIdentificationPayloadType()

auto doip_client::channel::udp_channel::anonymous_namespace{doip_vehicle_identification_handler.cpp}::GetVehicleIdentificationPayloadType ( std::uint8_t  preselection_mode) -> VehiclePayloadType
noexcept

Get the vehicle identification payload type based on preselection mode.

Parameters
[in]preselection_modeThe preselection mode
Returns
The payload type with request type and request length

Definition at line 151 of file doip_vehicle_identification_handler.cpp.

151  {
152  std::uint16_t vehicle_identification_type{0u};
153  std::uint8_t vehicle_identification_length{0u};
154  switch (preselection_mode) {
155  case 0U:
156  vehicle_identification_type = kDoip_VehicleIdentification_ReqType;
157  vehicle_identification_length = kDoip_VehicleIdentification_ReqLen;
158  break;
159  case 1U:
160  vehicle_identification_type = kDoip_VehicleIdentificationVIN_ReqType;
161  vehicle_identification_length = kDoip_VehicleIdentificationVIN_ReqLen;
162  break;
163  case 2U:
164  vehicle_identification_type = kDoip_VehicleIdentificationEID_ReqType;
165  vehicle_identification_length = kDoip_VehicleIdentificationEID_ReqLen;
166  break;
167  default:
168  break;
169  }
170  return VehiclePayloadType{vehicle_identification_type, vehicle_identification_length};
171 }
std::pair< std::uint16_t, std::uint8_t > VehiclePayloadType
Type alias of vehicle payload type.
constexpr std::uint16_t kDoip_VehicleIdentification_ReqType
constexpr std::uint32_t kDoip_VehicleIdentification_ReqLen
constexpr std::uint32_t kDoip_VehicleIdentificationVIN_ReqLen
constexpr std::uint16_t kDoip_VehicleIdentificationVIN_ReqType
constexpr std::uint32_t kDoip_VehicleIdentificationEID_ReqLen
constexpr std::uint16_t kDoip_VehicleIdentificationEID_ReqType

References doip_client::kDoip_VehicleIdentification_ReqLen, doip_client::kDoip_VehicleIdentification_ReqType, doip_client::kDoip_VehicleIdentificationEID_ReqLen, doip_client::kDoip_VehicleIdentificationEID_ReqType, doip_client::kDoip_VehicleIdentificationVIN_ReqLen, and doip_client::kDoip_VehicleIdentificationVIN_ReqType.

Referenced by doip_client::channel::udp_channel::VehicleIdentificationHandler::SendVehicleIdentificationRequest().

Here is the caller graph for this function: