livox_mid360_core
C++ driver library for the Livox Mid-360 LiDAR
Toggle main menu visibility
Loading...
Searching...
No Matches
hms.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
9
#pragma once
10
11
#include <cstdint>
12
#include <string_view>
13
14
#include "
livox/mid360/export.hpp
"
15
16
LIVOX_MID360_API_BEGIN
17
namespace
livox::mid360
18
{
19
21
enum class
HmsLevel
: std::uint8_t
22
{
23
kNone
= 0,
24
kInfo = 1,
25
kWarning = 2,
26
kError = 3,
27
kFatal = 4,
28
};
29
31
struct
HmsCode
32
{
33
std::uint16_t
abnormal_id
;
34
HmsLevel
level
;
35
std::uint8_t
reserved
;
36
std::uint32_t
raw
;
37
39
[[nodiscard]]
constexpr
bool
active
() const noexcept {
return
raw
!= 0; }
40
};
41
43
[[nodiscard]]
constexpr
HmsCode
decode_hms
(std::uint32_t raw)
noexcept
44
{
45
return
{
46
static_cast<
std::uint16_t
>
(raw >> 16),
static_cast<
HmsLevel
>
(raw & 0xFFu),
47
static_cast<
std::uint8_t
>
((raw >> 8) & 0xFFu), raw};
48
}
49
51
[[nodiscard]] std::string_view
to_string
(
HmsLevel
l)
noexcept
;
52
54
[[nodiscard]] std::string_view
hms_description
(std::uint16_t abnormal_id)
noexcept
;
55
57
[[nodiscard]] std::string_view
hms_suggestion
(std::uint16_t abnormal_id)
noexcept
;
58
59
}
// namespace livox::mid360
60
LIVOX_MID360_API_END
export.hpp
Symbol visibility helpers.
livox::mid360
The livox_mid360_core library: everything declared by the public headers.
Definition
bytes.hpp:14
livox::mid360::DisconnectReason::kNone
@ kNone
not disconnected (or the event is not a disconnect / reconnect)
Definition
event.hpp:82
livox::mid360::hms_suggestion
std::string_view hms_suggestion(std::uint16_t abnormal_id) noexcept
Suggested action from the official table, or "" if unknown.
livox::mid360::decode_hms
constexpr HmsCode decode_hms(std::uint32_t raw) noexcept
Splits a raw HMS code into its fields.
Definition
hms.hpp:43
livox::mid360::hms_description
std::string_view hms_description(std::uint16_t abnormal_id) noexcept
Human-readable description for an abnormal ID from the official table, or "" if unknown.
livox::mid360::HmsLevel
HmsLevel
Abnormal level, byte 0 of an HMS code.
Definition
hms.hpp:22
livox::mid360::to_string
std::string_view to_string(Event::Kind kind) noexcept
Name of an event kind, e.g. "state_changed".
livox::mid360::HmsCode
One decoded HMS code (one of the eight uint32 slots of key 0x8011).
Definition
hms.hpp:32
livox::mid360::HmsCode::raw
std::uint32_t raw
the undecoded code
Definition
hms.hpp:36
livox::mid360::HmsCode::abnormal_id
std::uint16_t abnormal_id
byte 3-2; look up with hms_description() / hms_suggestion()
Definition
hms.hpp:33
livox::mid360::HmsCode::active
constexpr bool active() const noexcept
False for an unused slot (raw code 0).
Definition
hms.hpp:39
livox::mid360::HmsCode::reserved
std::uint8_t reserved
byte 1
Definition
hms.hpp:35
livox::mid360::HmsCode::level
HmsLevel level
byte 0
Definition
hms.hpp:34
livox
mid360
hms.hpp
Generated by
1.18.0