7 #ifndef IFM3D_DESERIALIZE_STRUCT_O3R__ODS_INFO_V1_HPP
8 #define IFM3D_DESERIALIZE_STRUCT_O3R__ODS_INFO_V1_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>
22 constexpr
auto ODS_INFO_TIMESTAMP_NS_INDEX = 0x0000;
23 constexpr
auto ODS_INFO_ZONE_OCCUPIED_INDEX = 0x0008;
24 constexpr
auto ODS_INFO_ZONE_CONFIG_ID_INDEX = 0x000B;
31 using Ptr = std::shared_ptr<ODSInfoV1>;
34 Read(
const uint8_t* data,
size_t size)
36 if (size < ods_info_v1_size)
40 const uint8_t* start_ptr = data;
42 mkval<std::uint64_t>(start_ptr + ODS_INFO_TIMESTAMP_NS_INDEX);
43 mkarray<uint8_t, 3>(start_ptr + ODS_INFO_ZONE_OCCUPIED_INDEX,
46 mkval<uint32_t>(start_ptr + ODS_INFO_ZONE_CONFIG_ID_INDEX);
49 uint64_t timestamp_ns;
55 std::array<uint8_t, 3> zone_occupied;
59 uint32_t zone_config_id;
63 const size_t ods_info_v1_size = 15;
66 Deserialize(
const Buffer& tof_info_buffer)
70 ods_info_v1.Read(tof_info_buffer.
ptr<uint8_t>(0),
71 tof_info_buffer.
size());
77 #endif // IFM3D_DESERIALIZE_STRUCT_O3R__ODS_INFO_V1_HPP