Macros | Functions
rs_context.h File Reference

Exposes RealSense context functionality for C compilers. More...

#include "rs_types.h"
Include dependency graph for rs_context.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RS2_PRODUCT_LINE_ANY   0xff
 
#define RS2_PRODUCT_LINE_ANY_INTEL   0xfe
 
#define RS2_PRODUCT_LINE_D400   0x02
 
#define RS2_PRODUCT_LINE_DEPTH   (RS2_PRODUCT_LINE_L500 | RS2_PRODUCT_LINE_SR300 | RS2_PRODUCT_LINE_D400)
 
#define RS2_PRODUCT_LINE_L500   0x08
 
#define RS2_PRODUCT_LINE_NON_INTEL   0x01
 
#define RS2_PRODUCT_LINE_SR300   0x04
 
#define RS2_PRODUCT_LINE_T200   0x10
 
#define RS2_PRODUCT_LINE_TRACKING   RS2_PRODUCT_LINE_T200
 

Functions

rs2_devicers2_context_add_device (rs2_context *ctx, const char *file, rs2_error **error)
 
void rs2_context_add_software_device (rs2_context *ctx, rs2_device *dev, rs2_error **error)
 
void rs2_context_remove_device (rs2_context *ctx, const char *file, rs2_error **error)
 
void rs2_context_unload_tracking_module (rs2_context *ctx, rs2_error **error)
 
rs2_contextrs2_create_context (int api_version, rs2_error **error)
 Creates RealSense context that is required for the rest of the API. More...
 
rs2_device_hubrs2_create_device_hub (const rs2_context *context, rs2_error **error)
 Creates RealSense device_hub . More...
 
void rs2_delete_context (rs2_context *context)
 Frees the relevant context object. More...
 
void rs2_delete_device_hub (const rs2_device_hub *hub)
 Frees the relevant device hub object. More...
 
int rs2_device_hub_is_device_connected (const rs2_device_hub *hub, const rs2_device *device, rs2_error **error)
 
rs2_devicers2_device_hub_wait_for_device (const rs2_device_hub *hub, rs2_error **error)
 
rs2_device_listrs2_query_devices (const rs2_context *context, rs2_error **error)
 
rs2_device_listrs2_query_devices_ex (const rs2_context *context, int product_mask, 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_set_devices_changed_callback_cpp (rs2_context *context, rs2_devices_changed_callback *callback, rs2_error **error)
 

Detailed Description

Exposes RealSense context functionality for C compilers.

Definition in file rs_context.h.

Macro Definition Documentation

#define RS2_PRODUCT_LINE_ANY   0xff

Definition at line 91 of file rs_context.h.

#define RS2_PRODUCT_LINE_ANY_INTEL   0xfe

Definition at line 92 of file rs_context.h.

#define RS2_PRODUCT_LINE_D400   0x02

Definition at line 94 of file rs_context.h.

#define RS2_PRODUCT_LINE_DEPTH   (RS2_PRODUCT_LINE_L500 | RS2_PRODUCT_LINE_SR300 | RS2_PRODUCT_LINE_D400)

Definition at line 98 of file rs_context.h.

#define RS2_PRODUCT_LINE_L500   0x08

Definition at line 96 of file rs_context.h.

#define RS2_PRODUCT_LINE_NON_INTEL   0x01

Definition at line 93 of file rs_context.h.

#define RS2_PRODUCT_LINE_SR300   0x04

Definition at line 95 of file rs_context.h.

#define RS2_PRODUCT_LINE_T200   0x10

Definition at line 97 of file rs_context.h.

#define RS2_PRODUCT_LINE_TRACKING   RS2_PRODUCT_LINE_T200

Definition at line 99 of file rs_context.h.

Function Documentation

rs2_device* rs2_context_add_device ( rs2_context ctx,
const char *  file,
rs2_error **  error 
)

Create a new device and add it to the context

Parameters
ctxThe context to which the new device will be added
fileThe file from which the device should be created
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
A pointer to a device that plays data from the file, or null in case of failure

Definition at line 1519 of file rs.cpp.

void rs2_context_add_software_device ( rs2_context ctx,
rs2_device dev,
rs2_error **  error 
)

Add an instance of software device to the context

Parameters
ctxThe context to which the new device will be added
devInstance of software device to register into the context
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1529 of file rs.cpp.

void rs2_context_remove_device ( rs2_context ctx,
const char *  file,
rs2_error **  error 
)

Removes a playback device from the context, if exists

Parameters
[in]ctxThe context from which the device should be removed
[in]fileThe file name that was used to add the device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 1539 of file rs.cpp.

void rs2_context_unload_tracking_module ( rs2_context ctx,
rs2_error **  error 
)

Removes tracking module. function query_devices() locks the tracking module in the tm_context object. If the tracking module device is not used it should be removed using this function, so that other applications could find it. This function can be used both before the call to query_device() to prevent enabling tracking modules or afterwards to release them.

Definition at line 1547 of file rs.cpp.

rs2_context* rs2_create_context ( int  api_version,
rs2_error **  error 
)

Creates RealSense context that is required for the rest of the API.

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
Context object

Definition at line 163 of file rs.cpp.

rs2_device_hub* rs2_create_device_hub ( const rs2_context context,
rs2_error **  error 
)

Creates RealSense device_hub .

Parameters
[in]contextThe context for the device hub
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
Device hub object

Definition at line 178 of file rs.cpp.

void rs2_delete_context ( rs2_context context)

Frees the relevant context object.

Parameters
[in]contextObject that is no longer needed

Definition at line 171 of file rs.cpp.

void rs2_delete_device_hub ( const rs2_device_hub hub)

Frees the relevant device hub object.

Parameters
[in]hubObject that is no longer needed

Definition at line 184 of file rs.cpp.

int rs2_device_hub_is_device_connected ( const rs2_device_hub hub,
const rs2_device device,
rs2_error **  error 
)

Checks if device is still connected

Parameters
[in]hubThe device hub object
[in]deviceThe device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
1 if the device is connected, 0 otherwise

Definition at line 199 of file rs.cpp.

rs2_device* rs2_device_hub_wait_for_device ( const rs2_device_hub hub,
rs2_error **  error 
)

If any device is connected return it, otherwise wait until next RealSense device connects. Calling this method multiple times will cycle through connected devices

Parameters
[in]ctxThe context to creat the device
[in]hubThe device hub object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
device object

Definition at line 191 of file rs.cpp.

rs2_device_list* rs2_query_devices ( const rs2_context context,
rs2_error **  error 
)

create a static snapshot of all connected devices at the time of the call

Parameters
contextObject representing librealsense session
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
the list of devices, should be released by rs2_delete_device_list

Definition at line 208 of file rs.cpp.

rs2_device_list* rs2_query_devices_ex ( const rs2_context context,
int  product_mask,
rs2_error **  error 
)

create a static snapshot of all connected devices at the time of the call

Parameters
contextObject representing librealsense session
product_maskControls what kind of devices will be returned
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
the list of devices, should be released by rs2_delete_device_list

Definition at line 214 of file rs.cpp.

void rs2_set_devices_changed_callback ( const rs2_context context,
rs2_devices_changed_callback_ptr  callback,
void user,
rs2_error **  error 
)

set callback to get devices changed events these events will be raised by the context whenever new RealSense device is connected or existing device gets disconnected

Parameters
contextObject representing librealsense session
[in]callbackfunction pointer to register as per-notifications callback
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 787 of file rs.cpp.

void rs2_set_devices_changed_callback_cpp ( rs2_context context,
rs2_devices_changed_callback callback,
rs2_error **  error 
)

set callback to get devices changed events these events will be raised by the context whenever new RealSense device is connected or existing device gets disconnected

Parameters
contextObject representing librealsense session
[in]callbackcallback object created from c++ application. ownership over the callback object is moved into the context
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

Definition at line 823 of file rs.cpp.



librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:28