For sensor buffers using sensor_format_datad_t for the info field of sensor_buffer_t, the payload data that's found in data has a specific format
#include <sensor/sensor_api.h>
typedef enum { VL_SECONDARY_RETURN = 1, VL_INVALID_RETURN = 2 } sensor_lidar_flag_t;
When this bit is set, it represents a secondary return data and when this bit isn't set, it represents a primary return data from the lidar system.
This section defines the format of this data for the sensor_format_t that it applies as well as the definition of the flag field of sensor_format_t for this particular format. The lidar bit field flag. The following bits can be set or not set to indicate whether the data read from the lidar system is valid and whether it is primary or secondary data that was read.