livox_mid360_core
C++ driver library for the Livox Mid-360 LiDAR
Loading...
Searching...
No Matches
firmware_log.hpp File Reference

Firmware log collection (issue #44): the 0x03xx command group on the LiDAR's log port (56500). More...

#include <array>
#include <cstddef>
#include <cstdint>
#include <expected>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include "livox/mid360/export.hpp"
#include "livox/mid360/protocol.hpp"

Go to the source code of this file.

Classes

struct  livox::mid360::FirmwareLogFlags
 flag bits of a 0x0300 push (SDK2 logger_manager.cpp). More...
struct  livox::mid360::FirmwareLogControlRequest
 0x0301 request: start (enable) or stop collecting log_type. More...
struct  livox::mid360::FirmwareLogPushHeader
 0x0300 push header (16 bytes, little-endian) followed by data_length bytes. More...
struct  livox::mid360::FirmwareLogPushView
 A validated 0x0300 push: header plus a view over its data. More...
struct  livox::mid360::FirmwareLogPushAck
 Host → LiDAR answer to a push with ack_requested(), sent as a cmd-type 0x0300 frame. More...
struct  livox::mid360::FirmwareLogChunk
 What Device hands to a FirmwareLogCallback (receive thread; data is valid only during the callback, copy it to keep it). More...

Namespaces

namespace  livox
 Livox LiDAR drivers.
namespace  livox::mid360
 The livox_mid360_core library: everything declared by the public headers.

Enumerations

enum class  livox::mid360::FirmwareLogType : std::uint8_t { livox::mid360::kRealTime = 0 , livox::mid360::kException = 1 }
 log_type of 0x0300 / 0x0301. SDK2 states that only the real-time log is supported. More...

Functions

std::string_view livox::mid360::to_string (FirmwareLogType t) noexcept
 Lower-case name ("realtime", "exception"; "unknown" for other values).
std::string livox::mid360::to_string (const FirmwareLogPushHeader &h)
 One-line summary of the header fields, for logs.
std::array< std::byte, 2 > livox::mid360::encode_firmware_log_control (const FirmwareLogControlRequest &req) noexcept
 0x0301 payload: {log_type, enable}.
std::expected< FirmwareLogControlRequest, ParseError > livox::mid360::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.
std::expected< FirmwareLogPushView, ParseError > livox::mid360::parse_firmware_log_push (std::span< const std::byte > data) noexcept
 0x0300 payload: header + data.
std::expected< std::vector< std::byte >, EncodeError > livox::mid360::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::kDataTooLarge.
std::array< std::byte, kFirmwareLogPushAckSize > livox::mid360::encode_firmware_log_push_ack (const FirmwareLogPushAck &ack) noexcept
 FirmwareLogPushAck payload: {ret_code u8, log_type u8, file_index u8, trans_index u32}.
std::expected< FirmwareLogPushAck, ParseError > livox::mid360::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.

Variables

constexpr std::uint8_t livox::mid360::kFirmwareLogFlagAck = 0x01
 FirmwareLogFlags::ack_requested.
constexpr std::uint8_t livox::mid360::kFirmwareLogFlagBegin = 0x02
 FirmwareLogFlags::file_begin.
constexpr std::uint8_t livox::mid360::kFirmwareLogFlagEnd = 0x04
 FirmwareLogFlags::file_end.
constexpr std::size_t livox::mid360::kFirmwareLogPushHeaderSize = 16
 Size of the 0x0300 push header in bytes.
constexpr std::size_t livox::mid360::kFirmwareLogPushDataMaxSize
 Largest data part of one 0x0300 push that fits a command frame.
constexpr std::size_t livox::mid360::kFirmwareLogPushAckSize = 7
 Size of the FirmwareLogPushAck payload in bytes.

Detailed Description

Firmware log collection (issue #44): the 0x03xx command group on the LiDAR's log port (56500).

The layouts follow Livox-SDK2 (sdk_core/comm/define.h) and match a Mid-360 on firmware 13.18.0244 (#11). Unrelated to the SDK's own diagnostic logging (log.hpp).