Diag-Client-Lib
Public Member Functions | Private Member Functions | Private Attributes | List of all members
diag::client::vd_message::VdMessage Class Referencefinal

#include <vd_message.h>

Inheritance diagram for diag::client::vd_message::VdMessage:
Inheritance graph
[legend]
Collaboration diagram for diag::client::vd_message::VdMessage:
Collaboration graph
[legend]

Public Member Functions

 VdMessage (std::uint8_t preselection_mode, uds_transport::ByteVector &preselection_value, std::string_view host_ip_address)
 
 VdMessage () noexcept
 
 ~VdMessage () noexcept override=default
 
- Public Member Functions inherited from uds_transport::UdsMessage
 UdsMessage ()=default
 
 UdsMessage (const UdsMessage &other)=default
 
 UdsMessage (UdsMessage &&other) noexcept=default
 
UdsMessageoperator= (const UdsMessage &other)=default
 
UdsMessageoperator= (UdsMessage &&other) noexcept=default
 
virtual ~UdsMessage ()=default
 

Private Member Functions

void AddMetaInfo (std::shared_ptr< const MetaInfoMap > meta_info) override
 
const uds_transport::ByteVectorGetPayload () const override
 
uds_transport::ByteVectorGetPayload () override
 
Address GetSa () const noexcept override
 
Address GetTa () const noexcept override
 
TargetAddressType GetTaType () const noexcept override
 
IpAddress GetHostIpAddress () const noexcept override
 
PortNumber GetHostPortNumber () const noexcept override
 

Private Attributes

Address source_address_
 
Address target_address_
 
TargetAddressType target_address_type
 
IpAddress host_ip_address_
 
uds_transport::ByteVector vehicle_info_payload_
 
std::shared_ptr< const MetaInfoMapmeta_info_ {}
 

Additional Inherited Members

- Public Types inherited from uds_transport::UdsMessage
enum class  TargetAddressType : std::uint8_t { kPhysical = 0U , kFunctional = 1U }
 
using Address = std::uint16_t
 
using IpAddress = std::string_view
 
using PortNumber = std::uint16_t
 
using MetaInfoMap = std::map< std::string, std::string >
 

Detailed Description

Definition at line 19 of file vd_message.h.

Constructor & Destructor Documentation

◆ VdMessage() [1/2]

diag::client::vd_message::VdMessage::VdMessage ( std::uint8_t  preselection_mode,
uds_transport::ByteVector preselection_value,
std::string_view  host_ip_address 
)

Definition at line 26 of file vd_message.cpp.

29  source_address_{0U},
30  target_address_{0U},
32  host_ip_address_{host_ip_address},
33  vehicle_info_payload_{SerializeVehicleInfoList(preselection_mode, preselection_value)} {}
uds_transport::ByteVector vehicle_info_payload_
Definition: vd_message.h:45
TargetAddressType target_address_type
Definition: vd_message.h:39
auto SerializeVehicleInfoList(std::uint8_t preselection_mode, uds_transport::ByteVector &preselection_value) noexcept -> uds_transport::ByteVector
Definition: vd_message.cpp:17

◆ VdMessage() [2/2]

diag::client::vd_message::VdMessage::VdMessage ( )
noexcept

◆ ~VdMessage()

diag::client::vd_message::VdMessage::~VdMessage ( )
overridedefaultnoexcept

Member Function Documentation

◆ AddMetaInfo()

void diag::client::vd_message::VdMessage::AddMetaInfo ( std::shared_ptr< const MetaInfoMap meta_info)
inlineoverrideprivatevirtual

Implements uds_transport::UdsMessage.

Definition at line 51 of file vd_message.h.

51  {
52  // update meta info data
53  if (meta_info != nullptr) {
54  meta_info_ = meta_info;
55  host_ip_address_ = meta_info_->at("kRemoteIpAddress");
56  }
57  }
std::shared_ptr< const MetaInfoMap > meta_info_
Definition: vd_message.h:48

References host_ip_address_, and meta_info_.

◆ GetHostIpAddress()

IpAddress diag::client::vd_message::VdMessage::GetHostIpAddress ( ) const
inlineoverrideprivatevirtualnoexcept

Implements uds_transport::UdsMessage.

Definition at line 75 of file vd_message.h.

75 { return host_ip_address_; }

References host_ip_address_.

◆ GetHostPortNumber()

PortNumber diag::client::vd_message::VdMessage::GetHostPortNumber ( ) const
inlineoverrideprivatevirtualnoexcept

Implements uds_transport::UdsMessage.

Definition at line 78 of file vd_message.h.

78 { return 13400U; }

◆ GetPayload() [1/2]

const uds_transport::ByteVector& diag::client::vd_message::VdMessage::GetPayload ( ) const
inlineoverrideprivatevirtual

Implements uds_transport::UdsMessage.

Definition at line 60 of file vd_message.h.

60 { return vehicle_info_payload_; }

References vehicle_info_payload_.

◆ GetPayload() [2/2]

uds_transport::ByteVector& diag::client::vd_message::VdMessage::GetPayload ( )
inlineoverrideprivatevirtual

Implements uds_transport::UdsMessage.

Definition at line 63 of file vd_message.h.

63 { return vehicle_info_payload_; }

References vehicle_info_payload_.

◆ GetSa()

Address diag::client::vd_message::VdMessage::GetSa ( ) const
inlineoverrideprivatevirtualnoexcept

Implements uds_transport::UdsMessage.

Definition at line 66 of file vd_message.h.

66 { return source_address_; }

References source_address_.

◆ GetTa()

Address diag::client::vd_message::VdMessage::GetTa ( ) const
inlineoverrideprivatevirtualnoexcept

Implements uds_transport::UdsMessage.

Definition at line 69 of file vd_message.h.

69 { return target_address_; }

References target_address_.

◆ GetTaType()

TargetAddressType diag::client::vd_message::VdMessage::GetTaType ( ) const
inlineoverrideprivatevirtualnoexcept

Implements uds_transport::UdsMessage.

Definition at line 72 of file vd_message.h.

72 { return target_address_type; }

References target_address_type.

Member Data Documentation

◆ host_ip_address_

IpAddress diag::client::vd_message::VdMessage::host_ip_address_
private

Definition at line 42 of file vd_message.h.

Referenced by AddMetaInfo(), and GetHostIpAddress().

◆ meta_info_

std::shared_ptr<const MetaInfoMap> diag::client::vd_message::VdMessage::meta_info_ {}
private

Definition at line 48 of file vd_message.h.

Referenced by AddMetaInfo().

◆ source_address_

Address diag::client::vd_message::VdMessage::source_address_
private

Definition at line 33 of file vd_message.h.

Referenced by GetSa().

◆ target_address_

Address diag::client::vd_message::VdMessage::target_address_
private

Definition at line 36 of file vd_message.h.

Referenced by GetTa().

◆ target_address_type

TargetAddressType diag::client::vd_message::VdMessage::target_address_type
private

Definition at line 39 of file vd_message.h.

Referenced by GetTaType().

◆ vehicle_info_payload_

uds_transport::ByteVector diag::client::vd_message::VdMessage::vehicle_info_payload_
private

Definition at line 45 of file vd_message.h.

Referenced by GetPayload().


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