Intel® RealSense™ Cross Platform API  2.13.0
Intel Realsense Cross-platform API
Functions
rs_device.h File Reference

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

#include "rs_types.h"
#include "rs_sensor.h"

Go to the source code of this file.

Functions

int rs2_get_device_count (const rs2_device_list *info_list, rs2_error **error)
 
void rs2_delete_device_list (rs2_device_list *info_list)
 
int rs2_device_list_contains (const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
 
rs2_devicers2_create_device (const rs2_device_list *info_list, int index, rs2_error **error)
 
void rs2_delete_device (rs2_device *device)
 
const char * rs2_get_device_info (const rs2_device *device, rs2_camera_info info, rs2_error **error)
 
int rs2_supports_device_info (const rs2_device *device, rs2_camera_info info, rs2_error **error)
 
void rs2_hardware_reset (const rs2_device *device, rs2_error **error)
 
const rs2_raw_data_bufferrs2_send_and_receive_raw_data (rs2_device *device, void *raw_data_to_send, unsigned size_of_raw_data_to_send, rs2_error **error)
 
int rs2_is_device_extendable_to (const rs2_device *device, rs2_extension extension, rs2_error **error)
 
rs2_sensor_listrs2_query_sensors (const rs2_device *device, rs2_error **error)
 
void rs2_loopback_enable (const rs2_device *device, const char *from_file, rs2_error **error)
 
void rs2_loopback_disable (const rs2_device *device, rs2_error **error)
 
int rs2_loopback_is_enabled (const rs2_device *device, rs2_error **error)
 
void rs2_connect_tm2_controller (const rs2_device *device, const unsigned char *mac_addr, rs2_error **error)
 
void rs2_disconnect_tm2_controller (const rs2_device *device, int id, rs2_error **error)
 

Detailed Description

Exposes RealSense device functionality for C compilers.

Function Documentation

◆ rs2_connect_tm2_controller()

void rs2_connect_tm2_controller ( const rs2_device device,
const unsigned char *  mac_addr,
rs2_error **  error 
)

Connects to a given tm2 controller

Parameters
[in]deviceDevice to connect to the controller
[in]mac_addrThe MAC address of the desired controller
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_create_device()

rs2_device* rs2_create_device ( const rs2_device_list info_list,
int  index,
rs2_error **  error 
)

Creates a device by index. The device object represents a physical camera and provides the means to manipulate it.

Parameters
[in]info_listthe list containing the device to retrieve
[in]indexThe zero based index of device to retrieve
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
The requested device, should be released by rs2_delete_device

◆ rs2_delete_device()

void rs2_delete_device ( rs2_device device)

Delete RealSense device

Parameters
[in]deviceRealsense device to delete

◆ rs2_delete_device_list()

void rs2_delete_device_list ( rs2_device_list info_list)

Deletes device list, any devices created using this list will remain unaffected.

Parameters
[in]info_listList to delete

◆ rs2_device_list_contains()

int rs2_device_list_contains ( const rs2_device_list info_list,
const rs2_device device,
rs2_error **  error 
)

Checks if a specific device is contained inside a device list.

Parameters
[in]info_listThe list of devices to check in
[in]deviceRealSense device to check for
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
True if the device is in the list and false otherwise

◆ rs2_disconnect_tm2_controller()

void rs2_disconnect_tm2_controller ( const rs2_device device,
int  id,
rs2_error **  error 
)

Disconnects a given tm2 controller

Parameters
[in]deviceDevice to disconnect the controller from
[in]idThe ID of the desired controller
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_get_device_count()

int rs2_get_device_count ( const rs2_device_list info_list,
rs2_error **  error 
)

Determines number of devices in a list.

Parameters
[in]info_listThe list of connected devices captured using rs2_query_devices
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Device count

◆ rs2_get_device_info()

const char* rs2_get_device_info ( const rs2_device device,
rs2_camera_info  info,
rs2_error **  error 
)

Retrieve camera specific information, like versions of various internal components.

Parameters
[in]deviceThe RealSense device
[in]infoCamera info type to retrieve
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
The requested camera info string, in a format specific to the device model

◆ rs2_hardware_reset()

void rs2_hardware_reset ( const rs2_device device,
rs2_error **  error 
)

Send hardware reset request to the device. The actual reset is asynchronous. Note: Invalidates all handles to this device.

Parameters
[in]deviceThe RealSense device to reset
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_is_device_extendable_to()

int rs2_is_device_extendable_to ( const rs2_device device,
rs2_extension  extension,
rs2_error **  error 
)

Test if the given device can be extended to the requested extension.

Parameters
[in]deviceRealsense device
[in]extensionThe extension to which the device should be tested if it is extendable
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Non-zero value iff the device can be extended to the given extension

◆ rs2_loopback_disable()

void rs2_loopback_disable ( const rs2_device device,
rs2_error **  error 
)

Restores the given device into normal operation mode

Parameters
[in]deviceDevice to restore to normal operation mode
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_loopback_enable()

void rs2_loopback_enable ( const rs2_device device,
const char *  from_file,
rs2_error **  error 
)

Enter the given device into loopback operation mode that uses the given file as input for raw data

Parameters
[in]deviceDevice to enter into loopback operation mode
[in]from_filePath to bag file with raw data for loopback
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_loopback_is_enabled()

int rs2_loopback_is_enabled ( const rs2_device device,
rs2_error **  error 
)

Checks if the device is in loopback mode or not

Parameters
[in]deviceDevice to check for operation mode
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
true if the device is in loopback operation mode

◆ rs2_query_sensors()

rs2_sensor_list* rs2_query_sensors ( const rs2_device device,
rs2_error **  error 
)

Create a static snapshot of all connected sensors within a specific device.

Parameters
[in]deviceSpecific RealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
The list of sensors, should be released by rs2_delete_sensor_list

◆ 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 
)

Send raw data to device

Parameters
[in]deviceRealSense device to send data to
[in]raw_data_to_sendRaw data to be sent to device
[in]size_of_raw_data_to_sendSize of raw_data_to_send in bytes
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Device's response in a rs2_raw_data_buffer, which should be released by rs2_delete_raw_data

◆ rs2_supports_device_info()

int rs2_supports_device_info ( const rs2_device device,
rs2_camera_info  info,
rs2_error **  error 
)

Check if a camera supports a specific camera info type.

Parameters
[in]deviceThe RealSense device to check
[in]infoThe parameter to check for support
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
True if the parameter both exist and well-defined for the specific device