7 #ifndef IFM3D_DESERIALIZE_STRUCT_TOF_INFO_V4_HPP
8 #define IFM3D_DESERIALIZE_STRUCT_TOF_INFO_V4_HPP
12 #include <ifm3d/device/device.h>
13 #include <ifm3d/device/err.h>
14 #include <ifm3d/fg/organizer_utils.h>
15 #include <ifm3d/fg/buffer.h>
16 #include <ifm3d/deserialize/deserialize_utils.hpp>
17 #include <ifm3d/deserialize/struct_tof_info_v3.hpp>
23 constexpr
auto TOF_INFO_MEASUREMENT_BLOCK_INDEX = 0x01A0;
24 constexpr
auto TOF_INFO_MEASUREMENT_RANGE_MIN_INDEX = 0x01A4;
25 constexpr
auto TOF_INFO_MEASUREMENT_RANGE_MAX_INDEX = 0x01A8;
32 using Ptr = std::shared_ptr<TOFInfoV4>;
35 Read(
const uint8_t* data,
size_t size)
42 TOFInfoV3::Read(data, size);
43 const uint8_t* start_ptr = data;
45 mkval<std::uint32_t>(start_ptr + TOF_INFO_MEASUREMENT_BLOCK_INDEX);
46 measurement_range_min =
47 mkval<float>(start_ptr + TOF_INFO_MEASUREMENT_RANGE_MIN_INDEX);
48 measurement_range_max =
49 mkval<float>(start_ptr + TOF_INFO_MEASUREMENT_RANGE_MAX_INDEX);
62 float measurement_range_min;
68 float measurement_range_max;
75 Deserialize(
const Buffer& tof_info_buffer)
79 tof_info_v4.Read(tof_info_buffer.
ptr<uint8_t>(0),
80 tof_info_buffer.
size());
86 #endif // IFM3D_DESERIALIZE_STRUCT_TOF_INFO_V3_HPP