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

auto CreateDoipGenericHeader (std::uint16_t payload_type, std::uint32_t payload_len) noexcept -> std::vector< std::uint8_t >
 Function to create 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()

auto doip_client::channel::udp_channel::anonymous_namespace{doip_vehicle_identification_handler.cpp}::CreateDoipGenericHeader ( std::uint16_t  payload_type,
std::uint32_t  payload_len 
) -> std::vector<std::uint8_t>
noexcept

Function to create doip generic header.

Parameters
[in]payload_typeThe type of payload
[in]payload_lenThe length of payload

Definition at line 141 of file doip_vehicle_identification_handler.cpp.

142  {
143  std::vector<std::uint8_t> output_buffer{};
144  output_buffer.emplace_back(kDoip_ProtocolVersion);
145  output_buffer.emplace_back(~(static_cast<std::uint8_t>(kDoip_ProtocolVersion)));
146  output_buffer.emplace_back(static_cast<std::uint8_t>((payload_type & 0xFF00) >> 8));
147  output_buffer.emplace_back(static_cast<std::uint8_t>(payload_type & 0x00FF));
148  output_buffer.emplace_back(static_cast<std::uint8_t>((payload_len & 0xFF000000) >> 24));
149  output_buffer.emplace_back(static_cast<std::uint8_t>((payload_len & 0x00FF0000) >> 16));
150  output_buffer.emplace_back(static_cast<std::uint8_t>((payload_len & 0x0000FF00) >> 8));
151  output_buffer.emplace_back(static_cast<std::uint8_t>(payload_len & 0x000000FF));
152  return output_buffer;
153 }
constexpr std::uint8_t kDoip_ProtocolVersion

References doip_client::kDoip_ProtocolVersion.

Referenced by 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 161 of file doip_vehicle_identification_handler.cpp.

162  {
163  std::uint16_t vehicle_identification_type{0u};
164  std::uint8_t vehicle_identification_length{0u};
165  switch (preselection_mode) {
166  case 0U:
167  vehicle_identification_type = kDoip_VehicleIdentification_ReqType;
168  vehicle_identification_length = kDoip_VehicleIdentification_ReqLen;
169  break;
170  case 1U:
171  vehicle_identification_type = kDoip_VehicleIdentificationVIN_ReqType;
172  vehicle_identification_length = kDoip_VehicleIdentificationVIN_ReqLen;
173  break;
174  case 2U:
175  vehicle_identification_type = kDoip_VehicleIdentificationEID_ReqType;
176  vehicle_identification_length = kDoip_VehicleIdentificationEID_ReqLen;
177  break;
178  default:
179  break;
180  }
181  return VehiclePayloadType{vehicle_identification_type, vehicle_identification_length};
182 }
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: