Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
Classes | Typedefs | Enumerations | Functions | Variables
rs_internal.h File Reference

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

#include "rs_types.h"
#include "rs_context.h"
#include "rs_sensor.h"
#include "rs_frame.h"
#include "rs_option.h"

Go to the source code of this file.

Classes

struct  rs2_video_stream
 All the parameters required to define a video stream. More...
 
struct  rs2_motion_stream
 All the parameters required to define a motion stream. More...
 
struct  rs2_pose_stream
 All the parameters required to define a pose stream. More...
 
struct  rs2_software_video_frame
 All the parameters required to define a video frame. More...
 
struct  rs2_software_motion_frame
 All the parameters required to define a motion frame. More...
 
struct  rs2_software_pose_frame
 All the parameters required to define a pose frame. More...
 
struct  rs2_software_pose_frame::pose_frame_info
 
struct  rs2_software_notification
 All the parameters required to define a sensor notification. More...
 

Typedefs

typedef enum rs2_recording_mode rs2_recording_mode
 
typedef struct rs2_video_stream rs2_video_stream
 All the parameters required to define a video stream. More...
 
typedef struct rs2_motion_stream rs2_motion_stream
 All the parameters required to define a motion stream. More...
 
typedef struct rs2_pose_stream rs2_pose_stream
 All the parameters required to define a pose stream. More...
 
typedef struct rs2_software_video_frame rs2_software_video_frame
 All the parameters required to define a video frame. More...
 
typedef struct rs2_software_motion_frame rs2_software_motion_frame
 All the parameters required to define a motion frame. More...
 
typedef struct rs2_software_pose_frame rs2_software_pose_frame
 All the parameters required to define a pose frame. More...
 
typedef struct rs2_software_notification rs2_software_notification
 All the parameters required to define a sensor notification. More...
 

Enumerations

enum  rs2_recording_mode { RS2_RECORDING_MODE_BLANK_FRAMES, RS2_RECORDING_MODE_COMPRESSED, RS2_RECORDING_MODE_BEST_QUALITY, RS2_RECORDING_MODE_COUNT }
 

Functions

rs2_contextrs2_create_recording_context (int api_version, const char *filename, const char *section, rs2_recording_mode mode, rs2_error **error)
 
rs2_contextrs2_create_mock_context (int api_version, const char *filename, const char *section, rs2_error **error)
 
rs2_contextrs2_create_mock_context_versioned (int api_version, const char *filename, const char *section, const char *min_api_version, rs2_error **error)
 
rs2_devicers2_create_software_device (rs2_error **error)
 
rs2_sensorrs2_software_device_add_sensor (rs2_device *dev, const char *sensor_name, rs2_error **error)
 
void rs2_software_sensor_on_video_frame (rs2_sensor *sensor, rs2_software_video_frame frame, rs2_error **error)
 
void rs2_software_sensor_on_motion_frame (rs2_sensor *sensor, rs2_software_motion_frame frame, rs2_error **error)
 
void rs2_software_sensor_on_pose_frame (rs2_sensor *sensor, rs2_software_pose_frame frame, rs2_error **error)
 
void rs2_software_sensor_on_notification (rs2_sensor *sensor, rs2_software_notification notif, rs2_error **error)
 
void rs2_software_sensor_set_metadata (rs2_sensor *sensor, rs2_frame_metadata_value value, rs2_metadata_type type, rs2_error **error)
 
void rs2_software_device_set_destruction_callback (const rs2_device *dev, rs2_software_device_destruction_callback_ptr on_notification, void *user, rs2_error **error)
 
void rs2_software_device_set_destruction_callback_cpp (const rs2_device *dev, rs2_software_device_destruction_callback *callback, rs2_error **error)
 
void rs2_software_device_create_matcher (rs2_device *dev, rs2_matchers matcher, rs2_error **error)
 
void rs2_software_device_register_info (rs2_device *dev, rs2_camera_info info, const char *val, rs2_error **error)
 
void rs2_software_device_update_info (rs2_device *dev, rs2_camera_info info, const char *val, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_video_stream (rs2_sensor *sensor, rs2_video_stream video_stream, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_video_stream_ex (rs2_sensor *sensor, rs2_video_stream video_stream, int is_default, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_motion_stream (rs2_sensor *sensor, rs2_motion_stream motion_stream, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_motion_stream_ex (rs2_sensor *sensor, rs2_motion_stream motion_stream, int is_default, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_pose_stream (rs2_sensor *sensor, rs2_pose_stream pose_stream, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_pose_stream_ex (rs2_sensor *sensor, rs2_pose_stream pose_stream, int is_default, rs2_error **error)
 
void rs2_software_sensor_add_read_only_option (rs2_sensor *sensor, rs2_option option, float val, rs2_error **error)
 
void rs2_software_sensor_update_read_only_option (rs2_sensor *sensor, rs2_option option, float val, rs2_error **error)
 
void rs2_software_sensor_add_option (rs2_sensor *sensor, rs2_option option, float min, float max, float step, float def, int is_writable, rs2_error **error)
 
void rs2_software_sensor_detach (rs2_sensor *sensor, rs2_error **error)
 
void rs2_start_collecting_fw_logs (rs2_device *dev, rs2_error **error)
 Starts collecting FW log messages in the device. More...
 
void rs2_stop_collecting_fw_logs (rs2_device *dev, rs2_error **error)
 Stops collecting FW log messages in the device. More...
 
rs2_firmware_log_messagers2_create_fw_log_message (rs2_device *dev, rs2_error **error)
 Creates RealSense firmware log message. More...
 
int rs2_get_fw_log (rs2_device *dev, rs2_firmware_log_message *fw_log_msg, rs2_error **error)
 Gets RealSense firmware log. More...
 
int rs2_get_flash_log (rs2_device *dev, rs2_firmware_log_message *fw_log_msg, rs2_error **error)
 Gets RealSense flash log - this is a fw log that has been written in the device during the previous shutdown of the device. More...
 
void rs2_delete_fw_log_message (rs2_firmware_log_message *msg)
 
const unsigned char * rs2_fw_log_message_data (rs2_firmware_log_message *msg, rs2_error **error)
 Gets RealSense firmware log message data. More...
 
int rs2_fw_log_message_size (rs2_firmware_log_message *msg, rs2_error **error)
 Gets RealSense firmware log message size. More...
 
unsigned int rs2_fw_log_message_timestamp (rs2_firmware_log_message *msg, rs2_error **error)
 Gets RealSense firmware log message timestamp. More...
 
rs2_log_severity rs2_fw_log_message_severity (const rs2_firmware_log_message *msg, rs2_error **error)
 Gets RealSense firmware log message severity. More...
 
int rs2_init_fw_log_parser (rs2_device *dev, const char *xml_content, rs2_error **error)
 Initializes RealSense firmware logs parser in device. More...
 
rs2_firmware_log_parsed_messagers2_create_fw_log_parsed_message (rs2_device *dev, rs2_error **error)
 Creates RealSense firmware log parsed message. More...
 
void rs2_delete_fw_log_parsed_message (rs2_firmware_log_parsed_message *fw_log_parsed_msg)
 Deletes RealSense firmware log parsed message. More...
 
int rs2_parse_firmware_log (rs2_device *dev, rs2_firmware_log_message *fw_log_msg, rs2_firmware_log_parsed_message *parsed_msg, rs2_error **error)
 Gets RealSense firmware log parser. More...
 
unsigned int rs2_get_number_of_fw_logs (rs2_device *dev, rs2_error **error)
 Returns number of fw logs already polled from device but not by user yet. More...
 
const char * rs2_get_fw_log_parsed_message (rs2_firmware_log_parsed_message *fw_log_parsed_msg, rs2_error **error)
 Gets RealSense firmware log parsed message. More...
 
const char * rs2_get_fw_log_parsed_file_name (rs2_firmware_log_parsed_message *fw_log_parsed_msg, rs2_error **error)
 Gets RealSense firmware log parsed message file name. More...
 
const char * rs2_get_fw_log_parsed_thread_name (rs2_firmware_log_parsed_message *fw_log_parsed_msg, rs2_error **error)
 Gets RealSense firmware log parsed message source (SoC) or thread name. More...
 
const char * rs2_get_fw_log_parsed_module_name (rs2_firmware_log_parsed_message *fw_log_parsed_msg, rs2_error **error)
 Gets RealSense firmware log parsed message module name. More...
 
rs2_log_severity rs2_get_fw_log_parsed_severity (rs2_firmware_log_parsed_message *fw_log_parsed_msg, rs2_error **error)
 Gets RealSense firmware log parsed message severity. More...
 
unsigned int rs2_get_fw_log_parsed_line (rs2_firmware_log_parsed_message *fw_log_parsed_msg, rs2_error **error)
 Gets RealSense firmware log parsed message relevant line (in the file that is returned by rs2_get_fw_log_parsed_file_name). More...
 
unsigned int rs2_get_fw_log_parsed_timestamp (rs2_firmware_log_parsed_message *fw_log_parsed_msg, rs2_error **error)
 Gets RealSense firmware log parsed message timestamp. More...
 
unsigned int rs2_get_fw_log_parsed_sequence_id (rs2_firmware_log_parsed_message *fw_log_parsed_msg, rs2_error **error)
 Gets RealSense firmware log parsed message sequence id - cyclic number of FW log with [0..15] range. More...
 
rs2_terminal_parserrs2_create_terminal_parser (const char *xml_content, rs2_error **error)
 Creates RealSense terminal parser. More...
 
void rs2_delete_terminal_parser (rs2_terminal_parser *terminal_parser)
 Deletes RealSense terminal parser. More...
 
rs2_raw_data_bufferrs2_terminal_parse_command (rs2_terminal_parser *terminal_parser, const char *command, unsigned int size_of_command, rs2_error **error)
 Parses terminal command via RealSense terminal parser. More...
 
rs2_raw_data_bufferrs2_terminal_parse_response (rs2_terminal_parser *terminal_parser, const char *command, unsigned int size_of_command, const void *response, unsigned int size_of_response, rs2_error **error)
 Parses terminal response via RealSense terminal parser. More...
 

Variables

const unsigned int signed_fw_size = 0x18031C
 
const unsigned int unsigned_fw_size = 0x200000
 

Detailed Description

Exposes RealSense internal functionality for C compilers.

Typedef Documentation

◆ rs2_motion_stream

All the parameters required to define a motion stream.

◆ rs2_pose_stream

All the parameters required to define a pose stream.

◆ rs2_recording_mode

librealsense Recorder is intended for effective unit-testing Currently supports three modes of operation:

◆ rs2_software_motion_frame

All the parameters required to define a motion frame.

◆ rs2_software_notification

All the parameters required to define a sensor notification.

◆ rs2_software_pose_frame

All the parameters required to define a pose frame.

◆ rs2_software_video_frame

All the parameters required to define a video frame.

◆ rs2_video_stream

All the parameters required to define a video stream.

Enumeration Type Documentation

◆ rs2_recording_mode

librealsense Recorder is intended for effective unit-testing Currently supports three modes of operation:

Enumerator
RS2_RECORDING_MODE_BLANK_FRAMES 
RS2_RECORDING_MODE_COMPRESSED 
RS2_RECORDING_MODE_BEST_QUALITY 
RS2_RECORDING_MODE_COUNT 

Function Documentation

◆ rs2_create_fw_log_message()

rs2_firmware_log_message* rs2_create_fw_log_message ( rs2_device dev,
rs2_error **  error 
)

Creates RealSense firmware log message.

Parameters
[in]devDevice from which the FW log will be taken using the created message
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
pointer to created empty firmware log message

◆ rs2_create_fw_log_parsed_message()

rs2_firmware_log_parsed_message* rs2_create_fw_log_parsed_message ( rs2_device dev,
rs2_error **  error 
)

Creates RealSense firmware log parsed message.

Parameters
[in]devDevice from which the FW log will be taken using the created message
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
pointer to created empty firmware log message

◆ rs2_create_mock_context()

rs2_context* rs2_create_mock_context ( int  api_version,
const char *  filename,
const char *  section,
rs2_error **  error 
)

Create librealsense context that given a file will respond to calls exactly as the recording did if the user calls a method that was either not called during recording or violates causality of the recording error will be thrown

Deprecated:
Parameters
[in]api_versionrealsense API version as provided by RS2_API_VERSION macro
[in]filenamestring representing the name of the file to play back from
[in]sectionstring representing the name of the section within existing recording
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
context object, should be released by rs2_delete_context

◆ rs2_create_mock_context_versioned()

rs2_context* rs2_create_mock_context_versioned ( int  api_version,
const char *  filename,
const char *  section,
const char *  min_api_version,
rs2_error **  error 
)

Create librealsense context that given a file will respond to calls exactly as the recording did if the user calls a method that was either not called during recording or violates causality of the recording error will be thrown

Deprecated:
Parameters
[in]api_versionrealsense API version as provided by RS2_API_VERSION macro
[in]filenamestring representing the name of the file to play back from
[in]sectionstring representing the name of the section within existing recording
[in]min_api_versionreject any file that was recorded before this version
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
context object, should be released by rs2_delete_context

◆ rs2_create_recording_context()

rs2_context* rs2_create_recording_context ( int  api_version,
const char *  filename,
const char *  section,
rs2_recording_mode  mode,
rs2_error **  error 
)

Create librealsense context that will try to record all operations over librealsense into a file

Deprecated:
Parameters
[in]api_versionrealsense API version as provided by RS2_API_VERSION macro
[in]filenamestring representing the name of the file to record
[in]sectionstring representing the name of the section within existing recording
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
context object, should be released by rs2_delete_context

◆ rs2_create_software_device()

rs2_device* rs2_create_software_device ( rs2_error **  error)

Create software device to enable use librealsense logic without getting data from backend but inject the data from outside

Parameters
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
software device object, should be released by rs2_delete_device

◆ rs2_create_terminal_parser()

rs2_terminal_parser* rs2_create_terminal_parser ( const char *  xml_content,
rs2_error **  error 
)

Creates RealSense terminal parser.

Parameters
[in]xml_contentcontent of the xml file needed for parsing
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
pointer to created terminal parser object

◆ rs2_delete_fw_log_message()

void rs2_delete_fw_log_message ( rs2_firmware_log_message msg)

Delete RealSense firmware log message

Parameters
[in]deviceRealsense firmware log message to delete

◆ rs2_delete_fw_log_parsed_message()

void rs2_delete_fw_log_parsed_message ( rs2_firmware_log_parsed_message fw_log_parsed_msg)

Deletes RealSense firmware log parsed message.

Parameters
[in]msgmessage to be deleted

◆ rs2_delete_terminal_parser()

void rs2_delete_terminal_parser ( rs2_terminal_parser terminal_parser)

Deletes RealSense terminal parser.

Parameters
[in]terminal_parserterminal parser to be deleted

◆ rs2_fw_log_message_data()

const unsigned char* rs2_fw_log_message_data ( rs2_firmware_log_message msg,
rs2_error **  error 
)

Gets RealSense firmware log message data.

Parameters
[in]msgfirmware log message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
pointer to start of the firmware log message data

◆ rs2_fw_log_message_severity()

rs2_log_severity rs2_fw_log_message_severity ( const rs2_firmware_log_message msg,
rs2_error **  error 
)

Gets RealSense firmware log message severity.

Parameters
[in]msgfirmware log message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
severity of the firmware log message data

◆ rs2_fw_log_message_size()

int rs2_fw_log_message_size ( rs2_firmware_log_message msg,
rs2_error **  error 
)

Gets RealSense firmware log message size.

Parameters
[in]msgfirmware log message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
size of the firmware log message data

◆ rs2_fw_log_message_timestamp()

unsigned int rs2_fw_log_message_timestamp ( rs2_firmware_log_message msg,
rs2_error **  error 
)

Gets RealSense firmware log message timestamp.

Parameters
[in]msgfirmware log message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
timestamp of the firmware log message

◆ rs2_get_flash_log()

int rs2_get_flash_log ( rs2_device dev,
rs2_firmware_log_message fw_log_msg,
rs2_error **  error 
)

Gets RealSense flash log - this is a fw log that has been written in the device during the previous shutdown of the device.

Parameters
[in]devDevice from which the FW log should be taken
[in]fw_log_msgFirmware log message object to be filled
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
true for success, false for failure - failure happens if no firmware log was sent by the hardware monitor

◆ rs2_get_fw_log()

int rs2_get_fw_log ( rs2_device dev,
rs2_firmware_log_message fw_log_msg,
rs2_error **  error 
)

Gets RealSense firmware log.

Parameters
[in]devDevice from which the FW log should be taken
[in]fw_log_msgFirmware log message object to be filled
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
true for success, false for failure - failure happens if no firmware log was sent by the hardware monitor

◆ rs2_get_fw_log_parsed_file_name()

const char* rs2_get_fw_log_parsed_file_name ( rs2_firmware_log_parsed_message fw_log_parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parsed message file name.

Parameters
[in]fw_log_parsed_msgfirmware log parsed message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
file name of the firmware log parsed message

◆ rs2_get_fw_log_parsed_line()

unsigned int rs2_get_fw_log_parsed_line ( rs2_firmware_log_parsed_message fw_log_parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parsed message relevant line (in the file that is returned by rs2_get_fw_log_parsed_file_name).

Parameters
[in]fw_log_parsed_msgfirmware log parsed message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
line number of the firmware log parsed message

◆ rs2_get_fw_log_parsed_message()

const char* rs2_get_fw_log_parsed_message ( rs2_firmware_log_parsed_message fw_log_parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parsed message.

Parameters
[in]fw_log_parsed_msgfirmware log parsed message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
message of the firmware log parsed message

◆ rs2_get_fw_log_parsed_module_name()

const char* rs2_get_fw_log_parsed_module_name ( rs2_firmware_log_parsed_message fw_log_parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parsed message module name.

Parameters
[in]fw_log_parsed_msgfirmware log parsed message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
module name of the firmware log parsed message

◆ rs2_get_fw_log_parsed_sequence_id()

unsigned int rs2_get_fw_log_parsed_sequence_id ( rs2_firmware_log_parsed_message fw_log_parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parsed message sequence id - cyclic number of FW log with [0..15] range.

Parameters
[in]fw_log_parsed_msgfirmware log parsed message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
sequence of the firmware log parsed message

◆ rs2_get_fw_log_parsed_severity()

rs2_log_severity rs2_get_fw_log_parsed_severity ( rs2_firmware_log_parsed_message fw_log_parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parsed message severity.

Parameters
[in]fw_log_parsed_msgfirmware log parsed message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
severity of the firmware log parsed message

◆ rs2_get_fw_log_parsed_thread_name()

const char* rs2_get_fw_log_parsed_thread_name ( rs2_firmware_log_parsed_message fw_log_parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parsed message source (SoC) or thread name.

Parameters
[in]fw_log_parsed_msgfirmware log parsed message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
source (SoC) or thread name of the firmware log parsed message

◆ rs2_get_fw_log_parsed_timestamp()

unsigned int rs2_get_fw_log_parsed_timestamp ( rs2_firmware_log_parsed_message fw_log_parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parsed message timestamp.

Parameters
[in]fw_log_parsed_msgfirmware log parsed message object
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
timestamp of the firmware log parsed message

◆ rs2_get_number_of_fw_logs()

unsigned int rs2_get_number_of_fw_logs ( rs2_device dev,
rs2_error **  error 
)

Returns number of fw logs already polled from device but not by user yet.

Parameters
[in]devDevice from which the FW log will be taken
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
number of fw logs already polled from device but not by user yet

◆ rs2_init_fw_log_parser()

int rs2_init_fw_log_parser ( rs2_device dev,
const char *  xml_content,
rs2_error **  error 
)

Initializes RealSense firmware logs parser in device.

Parameters
[in]devDevice from which the FW log will be taken
[in]xml_contentcontent of the xml file needed for parsing
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
true for success, false for failure - failure happens if opening the xml from the xml_path input fails

◆ rs2_parse_firmware_log()

int rs2_parse_firmware_log ( rs2_device dev,
rs2_firmware_log_message fw_log_msg,
rs2_firmware_log_parsed_message parsed_msg,
rs2_error **  error 
)

Gets RealSense firmware log parser.

Parameters
[in]devDevice from which the FW log will be taken
[in]fw_log_msgfirmware log message to be parsed
[in]parsed_msgfirmware log parsed message - place holder for the resulting parsed message
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
true for success, false for failure - failure happens if message could not be parsed

◆ rs2_software_device_add_sensor()

rs2_sensor* rs2_software_device_add_sensor ( rs2_device dev,
const char *  sensor_name,
rs2_error **  error 
)

Add sensor to the software device

Parameters
[in]devthe software device
[in]sensor_namethe name of the sensor
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
software sensor object, should be released by rs2_delete_sensor

◆ rs2_software_device_create_matcher()

void rs2_software_device_create_matcher ( rs2_device dev,
rs2_matchers  matcher,
rs2_error **  error 
)

Set the wanted matcher type that will be used by the syncer

Parameters
[in]devthe software device
[in]matchermatcher type
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_device_register_info()

void rs2_software_device_register_info ( rs2_device dev,
rs2_camera_info  info,
const char *  val,
rs2_error **  error 
)

Register a camera info value for the software device

Parameters
[in]devthe software device
[in]infoidentifier for the camera info to add.
[in]valstring value for this new camera info.
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_device_set_destruction_callback()

void rs2_software_device_set_destruction_callback ( const rs2_device dev,
rs2_software_device_destruction_callback_ptr  on_notification,
void *  user,
rs2_error **  error 
)

set callback to be notified when a specific software device is destroyed

Parameters
[in]devsoftware device
[in]on_notificationfunction pointer to register as callback
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_device_set_destruction_callback_cpp()

void rs2_software_device_set_destruction_callback_cpp ( const rs2_device dev,
rs2_software_device_destruction_callback callback,
rs2_error **  error 
)

set callback to be notified when a specific software device is destroyed

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

◆ rs2_software_device_update_info()

void rs2_software_device_update_info ( rs2_device dev,
rs2_camera_info  info,
const char *  val,
rs2_error **  error 
)

Update an existing camera info value for the software device

Parameters
[in]devthe software device
[in]infoidentifier for the camera info to add.
[in]valstring value for this new camera info.
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_motion_stream()

rs2_stream_profile* rs2_software_sensor_add_motion_stream ( rs2_sensor sensor,
rs2_motion_stream  motion_stream,
rs2_error **  error 
)

Add motion stream to sensor

Parameters
[in]sensorthe software sensor
[in]motion_streamall the stream components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_motion_stream_ex()

rs2_stream_profile* rs2_software_sensor_add_motion_stream_ex ( rs2_sensor sensor,
rs2_motion_stream  motion_stream,
int  is_default,
rs2_error **  error 
)

Add motion stream to sensor

Parameters
[in]sensorthe software sensor
[in]motion_streamall the stream components
[in]is_defaultwhether or not the stream should be a default stream for the device
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_option()

void rs2_software_sensor_add_option ( rs2_sensor sensor,
rs2_option  option,
float  min,
float  max,
float  step,
float  def,
int  is_writable,
rs2_error **  error 
)

Add an option to sensor

Parameters
[in]sensorthe software sensor
[in]optionthe wanted option
[in]minthe minimum value which will be accepted for this option
[in]maxthe maximum value which will be accepted for this option
[in]stepthe granularity of options which accept discrete values, or zero if the option accepts continuous values
[in]defthe initial value of the option
[in]is_writableshould the option be read-only or not
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_pose_stream()

rs2_stream_profile* rs2_software_sensor_add_pose_stream ( rs2_sensor sensor,
rs2_pose_stream  pose_stream,
rs2_error **  error 
)

Add pose stream to sensor

Parameters
[in]sensorthe software sensor
[in]pose_streamall the stream components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_pose_stream_ex()

rs2_stream_profile* rs2_software_sensor_add_pose_stream_ex ( rs2_sensor sensor,
rs2_pose_stream  pose_stream,
int  is_default,
rs2_error **  error 
)

Add pose stream to sensor

Parameters
[in]sensorthe software sensor
[in]pose_streamall the stream components
[in]is_defaultwhether or not the stream should be a default stream for the device
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_read_only_option()

void rs2_software_sensor_add_read_only_option ( rs2_sensor sensor,
rs2_option  option,
float  val,
rs2_error **  error 
)

Add read only option to sensor

Parameters
[in]sensorthe software sensor
[in]optionthe wanted option
[in]valthe initial value
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_video_stream()

rs2_stream_profile* rs2_software_sensor_add_video_stream ( rs2_sensor sensor,
rs2_video_stream  video_stream,
rs2_error **  error 
)

Add video stream to sensor

Parameters
[in]sensorthe software sensor
[in]video_streamall the stream components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_video_stream_ex()

rs2_stream_profile* rs2_software_sensor_add_video_stream_ex ( rs2_sensor sensor,
rs2_video_stream  video_stream,
int  is_default,
rs2_error **  error 
)

Add video stream to sensor

Parameters
[in]sensorthe software sensor
[in]video_streamall the stream components
[in]is_defaultwhether or not the stream should be a default stream for the device
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_detach()

void rs2_software_sensor_detach ( rs2_sensor sensor,
rs2_error **  error 
)

Sensors hold the parent device in scope via a shared_ptr. This function detaches that so that the software sensor doesn't keep the software device alive. Note that this is dangerous as it opens the door to accessing freed memory if care isn't taken.

Parameters
[in]sensorthe software sensor
[out]errorif non-null, recieves any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_on_motion_frame()

void rs2_software_sensor_on_motion_frame ( rs2_sensor sensor,
rs2_software_motion_frame  frame,
rs2_error **  error 
)

Inject motion frame to software sonsor

Parameters
[in]sensorthe software sensor
[in]frameall the frame components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_on_notification()

void rs2_software_sensor_on_notification ( rs2_sensor sensor,
rs2_software_notification  notif,
rs2_error **  error 
)

Inject notification to software sonsor

Parameters
[in]sensorthe software sensor
[in]notifall the notification components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_on_pose_frame()

void rs2_software_sensor_on_pose_frame ( rs2_sensor sensor,
rs2_software_pose_frame  frame,
rs2_error **  error 
)

Inject pose frame to software sonsor

Parameters
[in]sensorthe software sensor
[in]frameall the frame components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_on_video_frame()

void rs2_software_sensor_on_video_frame ( rs2_sensor sensor,
rs2_software_video_frame  frame,
rs2_error **  error 
)

Inject video frame to software sonsor

Parameters
[in]sensorthe software sensor
[in]frameall the frame components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_set_metadata()

void rs2_software_sensor_set_metadata ( rs2_sensor sensor,
rs2_frame_metadata_value  value,
rs2_metadata_type  type,
rs2_error **  error 
)

Set frame metadata for the upcoming frames

Parameters
[in]sensorthe software sensor
[in]valuemetadata key to set
[in]typemetadata value
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_update_read_only_option()

void rs2_software_sensor_update_read_only_option ( rs2_sensor sensor,
rs2_option  option,
float  val,
rs2_error **  error 
)

Update the read only option added to sensor

Parameters
[in]sensorthe software sensor
[in]optionthe wanted option
[in]valthe wanted value
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_start_collecting_fw_logs()

void rs2_start_collecting_fw_logs ( rs2_device dev,
rs2_error **  error 
)

Starts collecting FW log messages in the device.

Parameters
[in]devDevice that will start collecting log messages.
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are

◆ rs2_stop_collecting_fw_logs()

void rs2_stop_collecting_fw_logs ( rs2_device dev,
rs2_error **  error 
)

Stops collecting FW log messages in the device.

Parameters
[in]devDevice that will stop collecting log messages.
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are

◆ rs2_terminal_parse_command()

rs2_raw_data_buffer* rs2_terminal_parse_command ( rs2_terminal_parser terminal_parser,
const char *  command,
unsigned int  size_of_command,
rs2_error **  error 
)

Parses terminal command via RealSense terminal parser.

Parameters
[in]terminal_parserTerminal parser object
[in]commandcommand to be sent to the hw monitor of the device
[in]size_of_commandsize of command to be sent to the hw monitor of the device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
command to hw monitor, in hex

◆ rs2_terminal_parse_response()

rs2_raw_data_buffer* rs2_terminal_parse_response ( rs2_terminal_parser terminal_parser,
const char *  command,
unsigned int  size_of_command,
const void *  response,
unsigned int  size_of_response,
rs2_error **  error 
)

Parses terminal response via RealSense terminal parser.

Parameters
[in]terminal_parserTerminal parser object
[in]commandcommand sent to the hw monitor of the device
[in]size_of_commandsize of the command to sent to the hw monitor of the device
[in]responseresponse received by the hw monitor of the device
[in]size_of_responsesize of the response received by the hw monitor of the device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored.
Returns
answer parsed

Variable Documentation

◆ signed_fw_size

const unsigned int signed_fw_size = 0x18031C

Firmware size constants

◆ unsigned_fw_size

const unsigned int unsigned_fw_size = 0x200000