livox_mid360_core
C++ driver library for the Livox Mid-360 LiDAR
Loading...
Searching...
No Matches
debug_data.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
8#pragma once
9
10#include <array>
11#include <cstddef>
12#include <cstdint>
13#include <expected>
14#include <span>
15
19
20LIVOX_MID360_API_BEGIN
21namespace livox::mid360
22{
23
25inline constexpr std::size_t kDebugDataControlSize = 9;
26
29{
30 bool enable = true;
31 std::array<std::uint8_t, 4> host_ip{};
35 std::uint16_t reserved = 0;
36
39 default;
40};
41
44[[nodiscard]] std::array<std::byte, kDebugDataControlSize> encode_debug_data_control(
45 const DebugDataControlRequest & req) noexcept;
47[[nodiscard]] std::expected<DebugDataControlRequest, ParseError> parse_debug_data_control(
48 std::span<const std::byte> data) noexcept;
49
53{
54 std::uint64_t host_receive_time_ns = 0;
56 std::span<const std::byte> data;
57};
58
59} // namespace livox::mid360
60LIVOX_MID360_API_END
Symbol visibility helpers.
The livox_mid360_core library: everything declared by the public headers.
Definition bytes.hpp:14
std::expected< DebugDataControlRequest, ParseError > parse_debug_data_control(std::span< const std::byte > data) noexcept
enable is any non-zero byte; bytes after the ninth are ignored.
std::array< std::byte, kDebugDataControlSize > encode_debug_data_control(const DebugDataControlRequest &req) noexcept
0x0303 payload: {enable u8, host_ip u8[4], host_port u16, reserved u16}, little-endian.
constexpr std::size_t kDebugDataControlSize
Size of the 0x0303 request payload in bytes.
Definition debug_data.hpp:25
constexpr std::uint16_t kDefaultHostDebugDataPort
as SDK2 (#93)
Definition protocol.hpp:45
Pure-function protocol layer for the Livox Mid-360: framing, parsing and serialisation of control-com...
0x0303 request: start (enable) or stop the stream towards host_ip:host_port.
Definition debug_data.hpp:29
std::uint16_t host_port
destination UDP port
Definition debug_data.hpp:32
std::uint16_t reserved
reserved in the protocol document; SDK2 calls it bandwidth (Mbps) and sends 0.
Definition debug_data.hpp:35
friend bool operator==(const DebugDataControlRequest &, const DebugDataControlRequest &)=default
Field-wise comparison.
bool enable
start (true) or stop the stream
Definition debug_data.hpp:30
std::array< std::uint8_t, 4 > host_ip
destination IPv4 address, in order
Definition debug_data.hpp:31
What Device hands to a DebugDataCallback: one datagram of the stream, not interpreted (receive thread...
Definition debug_data.hpp:53
std::uint64_t host_receive_time_ns
Datagram::recv_time_ns of the datagram.
Definition debug_data.hpp:54
Endpoint from
the LiDAR, port 60301 on a Mid-360
Definition debug_data.hpp:55
std::span< const std::byte > data
the datagram as received
Definition debug_data.hpp:56
IPv4 address + UDP port. Mid-360 is IPv4 only.
Definition transport.hpp:37
UDP transport layer: a thin, dependency-free wrapper over POSIX sockets.