RealSense Cross Platform API
RealSense Cross-platform API
Loading...
Searching...
No Matches
rs_rum.hpp
Go to the documentation of this file.
1// License: Apache 2.0. See LICENSE file in root directory.
2// Copyright(c) 2026 RealSense, Inc. All Rights Reserved.
3
4#ifndef LIBREALSENSE_RS2_RUM_HPP
5#define LIBREALSENSE_RS2_RUM_HPP
6
7#include "rs_types.hpp"
8#include "../h/rs_rum.h"
9
10#include <string>
11#include <memory>
12
13namespace rs2
14{
15 namespace rum
16 {
17 // Path of the on-disk RUM report file (read that file to inspect or upload the report).
18 inline std::string get_report_path()
19 {
20 rs2_error* e = nullptr;
21 std::shared_ptr<const rs2_raw_data_buffer> buffer(
24 if (!buffer)
25 return std::string();
26 auto size = rs2_get_raw_data_size(buffer.get(), &e);
28 auto data = rs2_get_raw_data(buffer.get(), &e);
30 if (!data)
31 return std::string();
32 return std::string(reinterpret_cast<const char*>(data), size);
33 }
34
35 // Set the cloud-upload consent flag; persists to the per-user config file.
36 inline void set_cloud_enabled(bool enabled)
37 {
38 rs2_error* e = nullptr;
39 rs2_rum_set_cloud_enabled(enabled ? 1 : 0, &e);
41 }
42
43 // Resolved cloud-upload consent (env var overrides the config file).
44 inline bool is_cloud_enabled()
45 {
46 rs2_error* e = nullptr;
47 auto enabled = rs2_rum_is_cloud_enabled(&e);
49 return enabled != 0;
50 }
51 }
52}
53
54#endif // LIBREALSENSE_RS2_RUM_HPP
static void handle(rs2_error *e)
Definition rs_types.hpp:162
Definition rs_rum.hpp:16
bool is_cloud_enabled()
Definition rs_rum.hpp:44
void set_cloud_enabled(bool enabled)
Definition rs_rum.hpp:36
std::string get_report_path()
Definition rs_rum.hpp:18
Definition rs_processing_gl.hpp:13
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
Exposes RUM (Real User Monitoring) functionality for C compilers.
int rs2_rum_is_cloud_enabled(rs2_error **error)
const rs2_raw_data_buffer * rs2_rum_get_report_path(rs2_error **error)
void rs2_rum_set_cloud_enabled(int enabled, rs2_error **error)
struct rs2_error rs2_error
Definition rs_types.h:296