36 [[nodiscard]]
constexpr bool ack_requested() const noexcept {
return (
raw & 0x01) != 0; }
38 [[nodiscard]]
constexpr bool file_begin() const noexcept {
return (
raw & 0x02) != 0; }
40 [[nodiscard]]
constexpr bool file_end() const noexcept {
return (
raw & 0x04) != 0; }
77 std::span<const std::byte>
data;
99 std::span<const std::byte>
data;
113 std::span<const std::byte> data)
noexcept;
118 std::span<const std::byte> data)
noexcept;
129 std::span<const std::byte> data)
noexcept;
Symbol visibility helpers.
The livox_mid360_core library: everything declared by the public headers.
Definition bytes.hpp:14
std::array< std::byte, kFirmwareLogPushAckSize > encode_firmware_log_push_ack(const FirmwareLogPushAck &ack) noexcept
FirmwareLogPushAck payload: {ret_code u8, log_type u8, file_index u8, trans_index u32}...
constexpr std::uint8_t kFirmwareLogFlagBegin
FirmwareLogFlags::file_begin.
Definition firmware_log.hpp:44
constexpr std::size_t kCommandDataMaxSize
Largest command payload that fits a frame.
Definition protocol.hpp:52
constexpr std::uint8_t kFirmwareLogFlagAck
FirmwareLogFlags::ack_requested.
Definition firmware_log.hpp:43
constexpr std::size_t kFirmwareLogPushHeaderSize
Size of the 0x0300 push header in bytes.
Definition firmware_log.hpp:48
std::expected< FirmwareLogPushAck, ParseError > parse_firmware_log_push_ack(std::span< const std::byte > data) noexcept
Inverse of encode_firmware_log_push_ack(); bytes after the seventh are ignored.
FirmwareLogType
log_type of 0x0300 / 0x0301. SDK2 states that only the real-time log is supported.
Definition firmware_log.hpp:26
@ kException
ACKed by 13.18.0244, but no chunk arrived on demand (#11).
Definition firmware_log.hpp:28
@ kRealTime
real-time log
Definition firmware_log.hpp:27
std::array< std::byte, 2 > encode_firmware_log_control(const FirmwareLogControlRequest &req) noexcept
0x0301 payload: {log_type, enable}.
std::expected< FirmwareLogPushView, ParseError > parse_firmware_log_push(std::span< const std::byte > data) noexcept
0x0300 payload: header + data.
RetCode
Result code carried as the first byte of every ACK.
Definition protocol.hpp:93
std::expected< FirmwareLogControlRequest, ParseError > parse_firmware_log_control(std::span< const std::byte > data) noexcept
Inverse of encode_firmware_log_control(); enable is any non-zero byte, extra bytes are ignored.
EncodeError
Why encode_command_frame() or build_command_frame() failed.
Definition protocol.hpp:212
constexpr std::size_t kFirmwareLogPushAckSize
Size of the FirmwareLogPushAck payload in bytes.
Definition firmware_log.hpp:90
constexpr std::uint8_t kFirmwareLogFlagEnd
FirmwareLogFlags::file_end.
Definition firmware_log.hpp:45
std::string_view to_string(Event::Kind kind) noexcept
Name of an event kind, e.g. "state_changed".
std::expected< std::vector< std::byte >, EncodeError > encode_firmware_log_push(const FirmwareLogPushHeader &header, std::span< const std::byte > data)
Serialises a push payload (header + data); nullopt-free: data above the frame limit is an EncodeError...
constexpr std::size_t kFirmwareLogPushDataMaxSize
Largest data part of one 0x0300 push that fits a command frame.
Definition firmware_log.hpp:50
Pure-function protocol layer for the Livox Mid-360: framing, parsing and serialisation of control-com...
What Device hands to a FirmwareLogCallback (receive thread; data is valid only during the callback,...
Definition firmware_log.hpp:96
FirmwareLogPushHeader header
decoded push header
Definition firmware_log.hpp:97
std::span< const std::byte > data
the log bytes of this packet
Definition firmware_log.hpp:99
std::uint64_t host_receive_time_ns
Datagram::recv_time_ns of the push.
Definition firmware_log.hpp:98
0x0301 request: start (enable) or stop collecting log_type.
Definition firmware_log.hpp:55
bool enable
start (true) or stop
Definition firmware_log.hpp:57
FirmwareLogType log_type
log to start or stop
Definition firmware_log.hpp:56
flag bits of a 0x0300 push (SDK2 logger_manager.cpp).
Definition firmware_log.hpp:33
constexpr bool file_begin() const noexcept
First packet of a log file (bit 1).
Definition firmware_log.hpp:38
std::uint8_t raw
the byte as received
Definition firmware_log.hpp:34
constexpr bool ack_requested() const noexcept
The LiDAR expects a FirmwareLogPushAck for this push (bit 0).
Definition firmware_log.hpp:36
constexpr bool file_end() const noexcept
Last packet of a log file (bit 2).
Definition firmware_log.hpp:40
Host → LiDAR answer to a push with ack_requested(), sent as a cmd-type 0x0300 frame.
Definition firmware_log.hpp:82
std::uint32_t trans_index
copied from the push header
Definition firmware_log.hpp:86
RetCode ret_code
result reported to the LiDAR
Definition firmware_log.hpp:83
FirmwareLogType log_type
copied from the push header
Definition firmware_log.hpp:84
std::uint8_t file_index
copied from the push header
Definition firmware_log.hpp:85
A validated 0x0300 push: header plus a view over its data.
Definition firmware_log.hpp:75
std::span< const std::byte > data
the data_length bytes after the header
Definition firmware_log.hpp:77
FirmwareLogPushHeader header
decoded header
Definition firmware_log.hpp:76