14 return (
static_cast<std::uint16_t
>(((payload[2u] & 0xFF) << 8) | (payload[3u] & 0xFF)));
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)));
25 return static_cast<std::uint16_t
>(((payload[0u] << 8) & 0xFF00) | payload[1u]);
31 std::uint16_t host_port_number,
33 : host_ip_address_{host_ip_address},
34 host_port_number_{host_port_number},
35 protocol_version_{payload[0u]},
36 protocol_version_inv_{payload[1u]},
41 constexpr std::uint8_t kDoipHeaderSize{8u};
42 constexpr std::uint8_t kSourceAddressSize{4u};
45 &payload[kDoipHeaderSize + kSourceAddressSize],
46 payload.
size() - (kDoipHeaderSize + kSourceAddressSize)};
49 payload.
size() - kDoipHeaderSize};
A view over a contiguous sequence of objects.
constexpr size_type size() const noexcept
Return the size of this Span.
DoipMessage(MessageType message_type, IpAddressType host_ip_address, std::uint16_t host_port_number, core_type::Span< std::uint8_t const > payload)
Constructs an instance of DoipMessage.
std::uint16_t client_address_
Store server address.
core_type::Span< std::uint8_t const > payload_
Store payload.
MessageType
Definition of message type.
std::uint16_t server_address_
Store server address.
std::string_view IpAddressType
Type alias of IP address type.
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
auto GetDoIPPayloadType(core_type::Span< std::uint8_t const > payload) noexcept -> std::uint16_t