Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
rs_device.h
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2  Copyright(c) 2017 Intel Corporation. All Rights Reserved. */
3 
9 #ifndef LIBREALSENSE_RS2_DEVICE_H
10 #define LIBREALSENSE_RS2_DEVICE_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include "rs_types.h"
17 #include "rs_sensor.h"
18 
25 int rs2_get_device_count(const rs2_device_list* info_list, rs2_error** error);
26 
32 
40 int rs2_device_list_contains(const rs2_device_list* info_list, const rs2_device* device, rs2_error** error);
41 
49 rs2_device* rs2_create_device(const rs2_device_list* info_list, int index, rs2_error** error);
50 
55 void rs2_delete_device(rs2_device* device);
56 
64 const char* rs2_get_device_info(const rs2_device* device, rs2_camera_info info, rs2_error** error);
65 
73 int rs2_supports_device_info(const rs2_device* device, rs2_camera_info info, rs2_error** error);
74 
81 void rs2_hardware_reset(const rs2_device * device, rs2_error ** error);
82 
91 const rs2_raw_data_buffer* rs2_send_and_receive_raw_data(rs2_device* device, void* raw_data_to_send, unsigned size_of_raw_data_to_send, rs2_error** error);
92 
100 int rs2_is_device_extendable_to(const rs2_device* device, rs2_extension extension, rs2_error ** error);
101 
108 rs2_sensor_list* rs2_query_sensors(const rs2_device* device, rs2_error** error);
109 
116 void rs2_loopback_enable(const rs2_device* device, const char* from_file, rs2_error** error);
117 
123 void rs2_loopback_disable(const rs2_device* device, rs2_error** error);
124 
131 int rs2_loopback_is_enabled(const rs2_device* device, rs2_error** error);
132 
139 void rs2_connect_tm2_controller(const rs2_device* device, const unsigned char* mac_addr, rs2_error** error);
140 
147 void rs2_disconnect_tm2_controller(const rs2_device* device, int id, rs2_error** error);
148 
149 
155 void rs2_reset_to_factory_calibration(const rs2_device* device, rs2_error** e);
156 
162 void rs2_write_calibration(const rs2_device* device, rs2_error** e);
163 
173 void rs2_update_firmware_cpp(const rs2_device* device, const void* fw_image, int fw_image_size, rs2_update_progress_callback* callback, rs2_error** error);
174 
185 void rs2_update_firmware(const rs2_device* device, const void* fw_image, int fw_image_size, rs2_update_progress_callback_ptr callback, void* client_data, rs2_error** error);
186 
195 
204 const rs2_raw_data_buffer* rs2_create_flash_backup(const rs2_device* device, rs2_update_progress_callback_ptr callback, void* client_data, rs2_error** error);
205 
206 #define RS2_UNSIGNED_UPDATE_MODE_UPDATE 0
207 #define RS2_UNSIGNED_UPDATE_MODE_READ_ONLY 1
208 #define RS2_UNSIGNED_UPDATE_MODE_FULL 2
209 
221 void rs2_update_firmware_unsigned_cpp(const rs2_device* device, const void* fw_image, int fw_image_size, rs2_update_progress_callback* callback, int update_mode, rs2_error** error);
222 
235 void rs2_update_firmware_unsigned(const rs2_device* device, const void* fw_image, int fw_image_size, rs2_update_progress_callback_ptr callback, void* client_data, int update_mode, rs2_error** error);
236 
242 void rs2_enter_update_state(const rs2_device* device, rs2_error** error);
243 
264 const rs2_raw_data_buffer* rs2_run_on_chip_calibration_cpp(rs2_device* device, const void* json_content, int content_size, float* health, rs2_update_progress_callback* progress_callback, int timeout_ms, rs2_error** error);
265 
287 const rs2_raw_data_buffer* rs2_run_on_chip_calibration(rs2_device* device, const void* json_content, int content_size, float* health, rs2_update_progress_callback_ptr callback, void* client_data, int timeout_ms, rs2_error** error);
288 
311 const rs2_raw_data_buffer* rs2_run_tare_calibration_cpp(rs2_device* dev, float ground_truth_mm, const void* json_content, int content_size, rs2_update_progress_callback* progress_callback, int timeout_ms, rs2_error** error);
312 
336 const rs2_raw_data_buffer* rs2_run_tare_calibration(rs2_device* dev, float ground_truth_mm, const void* json_content, int content_size, rs2_update_progress_callback_ptr callback, void* client_data, int timeout_ms, rs2_error** error);
337 
343 
348 void rs2_set_calibration_table(const rs2_device* device, const void* calibration, int calibration_size, rs2_error** error);
349 
350 /* Serialize JSON content, returns ASCII-serialized JSON string on success. otherwise nullptr */
352 
353 /* Load JSON and apply advanced-mode controls */
354 void rs2_load_json(rs2_device* dev, const void* json_content, unsigned content_size, rs2_error** error);
355 
356 #ifdef __cplusplus
357 }
358 #endif
359 #endif
rs2_create_flash_backup_cpp
const rs2_raw_data_buffer * rs2_create_flash_backup_cpp(const rs2_device *device, rs2_update_progress_callback *callback, rs2_error **error)
rs2_serialize_json
rs2_raw_data_buffer * rs2_serialize_json(rs2_device *dev, rs2_error **error)
rs2_disconnect_tm2_controller
void rs2_disconnect_tm2_controller(const rs2_device *device, int id, rs2_error **error)
rs2_extension
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:134
rs2_enter_update_state
void rs2_enter_update_state(const rs2_device *device, rs2_error **error)
rs2_send_and_receive_raw_data
const rs2_raw_data_buffer * rs2_send_and_receive_raw_data(rs2_device *device, void *raw_data_to_send, unsigned size_of_raw_data_to_send, rs2_error **error)
rs2_run_on_chip_calibration_cpp
const rs2_raw_data_buffer * rs2_run_on_chip_calibration_cpp(rs2_device *device, const void *json_content, int content_size, float *health, rs2_update_progress_callback *progress_callback, int timeout_ms, rs2_error **error)
rs2_create_flash_backup
const rs2_raw_data_buffer * rs2_create_flash_backup(const rs2_device *device, rs2_update_progress_callback_ptr callback, void *client_data, rs2_error **error)
rs2_update_firmware_cpp
void rs2_update_firmware_cpp(const rs2_device *device, const void *fw_image, int fw_image_size, rs2_update_progress_callback *callback, rs2_error **error)
rs2_device_list_contains
int rs2_device_list_contains(const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
rs2_update_firmware
void rs2_update_firmware(const rs2_device *device, const void *fw_image, int fw_image_size, rs2_update_progress_callback_ptr callback, void *client_data, rs2_error **error)
rs2_loopback_disable
void rs2_loopback_disable(const rs2_device *device, rs2_error **error)
rs_sensor.h
Exposes RealSense sensor functionality for C compilers.
rs2_delete_device_list
void rs2_delete_device_list(rs2_device_list *info_list)
rs_types.h
Exposes RealSense structs.
rs2_get_device_info
const char * rs2_get_device_info(const rs2_device *device, rs2_camera_info info, rs2_error **error)
rs2_set_calibration_table
void rs2_set_calibration_table(const rs2_device *device, const void *calibration, int calibration_size, rs2_error **error)
rs2_get_calibration_table
const rs2_raw_data_buffer * rs2_get_calibration_table(const rs2_device *dev, rs2_error **error)
rs2_run_on_chip_calibration
const rs2_raw_data_buffer * rs2_run_on_chip_calibration(rs2_device *device, const void *json_content, int content_size, float *health, rs2_update_progress_callback_ptr callback, void *client_data, int timeout_ms, rs2_error **error)
rs2_delete_device
void rs2_delete_device(rs2_device *device)
rs2_update_firmware_unsigned_cpp
void rs2_update_firmware_unsigned_cpp(const rs2_device *device, const void *fw_image, int fw_image_size, rs2_update_progress_callback *callback, int update_mode, rs2_error **error)
rs2_get_device_count
int rs2_get_device_count(const rs2_device_list *info_list, rs2_error **error)
rs2_run_tare_calibration_cpp
const rs2_raw_data_buffer * rs2_run_tare_calibration_cpp(rs2_device *dev, float ground_truth_mm, const void *json_content, int content_size, rs2_update_progress_callback *progress_callback, int timeout_ms, rs2_error **error)
rs2_update_firmware_unsigned
void rs2_update_firmware_unsigned(const rs2_device *device, const void *fw_image, int fw_image_size, rs2_update_progress_callback_ptr callback, void *client_data, int update_mode, rs2_error **error)
rs2_sensor_list
struct rs2_sensor_list rs2_sensor_list
Definition: rs_types.h:240
rs2_load_json
void rs2_load_json(rs2_device *dev, const void *json_content, unsigned content_size, rs2_error **error)
rs2_camera_info
rs2_camera_info
Read-only strings that can be queried from the device. Not all information attributes are available o...
Definition: rs_sensor.h:22
rs2_loopback_is_enabled
int rs2_loopback_is_enabled(const rs2_device *device, rs2_error **error)
rs2_write_calibration
void rs2_write_calibration(const rs2_device *device, rs2_error **e)
rs2_raw_data_buffer
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:219
rs2_create_device
rs2_device * rs2_create_device(const rs2_device_list *info_list, int index, rs2_error **error)
rs2_device
struct rs2_device rs2_device
Definition: rs_types.h:216
rs2_update_progress_callback
Definition: rs_types.hpp:69
rs2_supports_device_info
int rs2_supports_device_info(const rs2_device *device, rs2_camera_info info, rs2_error **error)
rs2_query_sensors
rs2_sensor_list * rs2_query_sensors(const rs2_device *device, rs2_error **error)
rs2_connect_tm2_controller
void rs2_connect_tm2_controller(const rs2_device *device, const unsigned char *mac_addr, rs2_error **error)
rs2_loopback_enable
void rs2_loopback_enable(const rs2_device *device, const char *from_file, rs2_error **error)
rs2_hardware_reset
void rs2_hardware_reset(const rs2_device *device, rs2_error **error)
rs2_reset_to_factory_calibration
void rs2_reset_to_factory_calibration(const rs2_device *device, rs2_error **e)
rs2_device_list
struct rs2_device_list rs2_device_list
Definition: rs_types.h:225
rs2_update_progress_callback_ptr
void(* rs2_update_progress_callback_ptr)(const float, void *)
Definition: rs_types.h:252
rs2_error
struct rs2_error rs2_error
Definition: rs_types.h:217
rs2_is_device_extendable_to
int rs2_is_device_extendable_to(const rs2_device *device, rs2_extension extension, rs2_error **error)
rs2_run_tare_calibration
const rs2_raw_data_buffer * rs2_run_tare_calibration(rs2_device *dev, float ground_truth_mm, const void *json_content, int content_size, rs2_update_progress_callback_ptr callback, void *client_data, int timeout_ms, rs2_error **error)