Diag-Client-Lib
Functions
doip_client::anonymous_namespace{doip_message.cpp} Namespace Reference

Functions

auto GetDoIPPayloadType (core_type::Span< std::uint8_t const > payload) noexcept -> std::uint16_t
 
auto GetDoIPPayloadLength (core_type::Span< std::uint8_t const > payload) noexcept -> std::uint32_t
 
auto ConvertToAddr (core_type::Span< std::uint8_t const > payload) noexcept -> std::uint16_t
 

Function Documentation

◆ ConvertToAddr()

auto doip_client::anonymous_namespace{doip_message.cpp}::ConvertToAddr ( core_type::Span< std::uint8_t const >  payload) -> std::uint16_t
noexcept

Definition at line 24 of file doip_message.cpp.

24  {
25  return static_cast<std::uint16_t>(((payload[0u] << 8) & 0xFF00) | payload[1u]);
26 }

Referenced by doip_client::DoipMessage::DoipMessage().

Here is the caller graph for this function:

◆ GetDoIPPayloadLength()

auto doip_client::anonymous_namespace{doip_message.cpp}::GetDoIPPayloadLength ( core_type::Span< std::uint8_t const >  payload) -> std::uint32_t
noexcept

Definition at line 17 of file doip_message.cpp.

17  {
18  return ((static_cast<std::uint32_t>(payload[4u] << 24) & 0xFF000000) |
19  (static_cast<std::uint32_t>(payload[5u] << 16) & 0x00FF0000) |
20  (static_cast<std::uint32_t>(payload[6u] << 8) & 0x0000FF00) |
21  (static_cast<std::uint32_t>(payload[7u] & 0x000000FF)));
22 }

◆ GetDoIPPayloadType()

auto doip_client::anonymous_namespace{doip_message.cpp}::GetDoIPPayloadType ( core_type::Span< std::uint8_t const >  payload) -> std::uint16_t
noexcept

Definition at line 13 of file doip_message.cpp.

13  {
14  return (static_cast<std::uint16_t>(((payload[2u] & 0xFF) << 8) | (payload[3u] & 0xFF)));
15 }