RealSense Cross Platform API
RealSense Cross-platform API
rs_context.h
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2  Copyright(c) 2017 RealSense, Inc. All Rights Reserved. */
3 
9 #ifndef LIBREALSENSE_RS2_CONTEXT_H
10 #define LIBREALSENSE_RS2_CONTEXT_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 #include "rs_types.h"
16 
24 rs2_context* rs2_create_context(int api_version, rs2_error** error);
25 
49 rs2_context* rs2_create_context_ex(int api_version, const char * json_settings, rs2_error** error);
50 
55 void rs2_delete_context(rs2_context* context);
56 
65 
73 void rs2_set_devices_changed_callback(const rs2_context* context, rs2_devices_changed_callback_ptr callback, void* user, rs2_error** error);
74 
82 rs2_device* rs2_context_add_device(rs2_context* ctx, const char* file, rs2_error** error);
83 
91 
98 void rs2_context_remove_device(rs2_context* ctx, const char* file, rs2_error** error);
99 
108 
118 void rs2_convert_bag_to_db3(const char* input_bag_path, const char* output_db3_path, const rs2_context* ctx,
119  rs2_update_progress_callback_ptr callback, void* client_data, rs2_error** error);
120 
127 rs2_device_list* rs2_query_devices(const rs2_context* context, rs2_error** error);
128 
129 #define RS2_PRODUCT_LINE_ANY 0xff
130 #define RS2_PRODUCT_LINE_ANY_INTEL 0xfe
131 #define RS2_PRODUCT_LINE_NON_INTEL 0x01
132 #define RS2_PRODUCT_LINE_D400 0x02
133 #define RS2_PRODUCT_LINE_SR300 0x04
134 #define RS2_PRODUCT_LINE_L500 0x08
135 #define RS2_PRODUCT_LINE_T200 0x10
136 #define RS2_PRODUCT_LINE_D500 0x20
137 #define RS2_PRODUCT_LINE_SW_ONLY 0x100 // enable to return only SW devices, including playback
138 #define RS2_PRODUCT_LINE_DEPTH ( RS2_PRODUCT_LINE_L500 | RS2_PRODUCT_LINE_SR300 | RS2_PRODUCT_LINE_D400 | RS2_PRODUCT_LINE_D500 )
139 #define RS2_PRODUCT_LINE_TRACKING RS2_PRODUCT_LINE_T200
140 
148 rs2_device_list* rs2_query_devices_ex(const rs2_context* context, int product_mask, rs2_error** error);
149 
157 
162 void rs2_delete_device_hub(const rs2_device_hub* hub);
163 
173 
181 int rs2_device_hub_is_device_connected(const rs2_device_hub* hub, const rs2_device* device, rs2_error** error);
182 
183 
184 #ifdef __cplusplus
185 }
186 #endif
187 #endif
rs2_context * rs2_create_context_ex(int api_version, const char *json_settings, rs2_error **error)
Creates RealSense context that is required for the rest of the API, and accepts a settings JSON...
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
rs2_device_hub * rs2_create_device_hub(const rs2_context *context, rs2_error **error)
Creates RealSense device_hub .
rs2_context * rs2_create_context(int api_version, rs2_error **error)
Creates RealSense context that is required for the rest of the API. Context settings are taken from t...
struct rs2_context rs2_context
Definition: rs_types.h:314
void rs2_delete_context(rs2_context *context)
Frees the relevant context object.
rs2_device * rs2_context_add_device(rs2_context *ctx, const char *file, rs2_error **error)
void(* rs2_update_progress_callback_ptr)(const float, void *)
Definition: rs_types.h:337
rs2_device_list * rs2_query_devices_ex(const rs2_context *context, int product_mask, rs2_error **error)
struct rs2_device_hub rs2_device_hub
Definition: rs_types.h:315
Exposes RealSense structs.
void rs2_convert_bag_to_db3(const char *input_bag_path, const char *output_db3_path, const rs2_context *ctx, rs2_update_progress_callback_ptr callback, void *client_data, rs2_error **error)
int rs2_device_hub_is_device_connected(const rs2_device_hub *hub, const rs2_device *device, rs2_error **error)
void rs2_delete_device_hub(const rs2_device_hub *hub)
Frees the relevant device hub object.
void(* rs2_devices_changed_callback_ptr)(rs2_device_list *, rs2_device_list *, void *)
Definition: rs_types.h:334
void rs2_context_unload_tracking_module(rs2_context *ctx, rs2_error **error)
void rs2_context_add_software_device(rs2_context *ctx, rs2_device *dev, rs2_error **error)
struct rs2_device rs2_device
Definition: rs_types.h:292
void rs2_set_devices_changed_callback_cpp(rs2_context *context, rs2_devices_changed_callback *callback, rs2_error **error)
void rs2_set_devices_changed_callback(const rs2_context *context, rs2_devices_changed_callback_ptr callback, void *user, rs2_error **error)
void rs2_context_remove_device(rs2_context *ctx, const char *file, rs2_error **error)
struct rs2_device_list rs2_device_list
Definition: rs_types.h:301
Definition: rs_types.hpp:81
struct rs2_error rs2_error
Definition: rs_types.h:293
rs2_device * rs2_device_hub_wait_for_device(const rs2_device_hub *hub, rs2_error **error)