4#ifndef LIBREALSENSE_RS2_INTERNAL_HPP
5#define LIBREALSENSE_RS2_INTERNAL_HPP
33 T on_destruction_function;
39 on_destruction_function();
45 class software_sensor :
public sensor
179 range.
max, range.
step, range.
def, is_writable, &e);
204 software_sensor(std::shared_ptr<rs2_sensor> s)
219 std::shared_ptr<rs2_device> create_device_ptr(std::function<
void(
rs2_device*)> deleter)
222 std::shared_ptr<rs2_device> dev(
231 :
device(create_device_ptr(deleter))
250 std::shared_ptr<rs2_sensor>
sensor(
327 _fw_log_message(msg) {}
355 std::vector<uint8_t>
data()
const
360 std::vector<uint8_t> result;
365 result.insert(result.begin(), start, start +
size);
370 const std::shared_ptr<rs2_firmware_log_message>
get_message()
const {
return _fw_log_message; }
373 std::shared_ptr<rs2_firmware_log_message> _fw_log_message;
380 _parsed_fw_log(msg) {}
440 const std::shared_ptr<rs2_firmware_log_parsed_message>
get_message()
const {
return _parsed_fw_log; }
443 std::shared_ptr<rs2_firmware_log_parsed_message> _parsed_fw_log;
477 std::shared_ptr<rs2_firmware_log_message> msg(
488 std::shared_ptr<rs2_firmware_log_parsed_message> msg(
500 bool fw_log_pulling_status =
505 return fw_log_pulling_status;
512 bool flash_log_pulling_status =
517 return flash_log_pulling_status;
527 return parser_initialized;
537 return parsingResult;
546 return num_of_fw_logs;
557 _terminal_parser = std::shared_ptr<rs2_terminal_parser>(
567 std::shared_ptr<const rs2_raw_data_buffer> list(
577 std::vector<uint8_t> results;
578 results.insert(results.begin(), start, start + size);
583 std::string
parse_response(
const std::string& command,
const std::vector<uint8_t>& response)
587 std::shared_ptr<const rs2_raw_data_buffer> list(
589 (
void*)response.data(), (
unsigned int)response.size(), &e),
599 results.insert(results.begin(), start, start + size);
605 std::shared_ptr<rs2_terminal_parser> _terminal_parser;
std::shared_ptr< rs2_context > _context
Definition rs_context.hpp:228
const std::shared_ptr< rs2_device > & get() const
Definition rs_device.hpp:162
std::shared_ptr< rs2_device > _dev
Definition rs_device.hpp:207
device()
Definition rs_device.hpp:154
friend class rs2::context
Definition rs_device.hpp:202
static void handle(rs2_error *e)
Definition rs_types.hpp:162
Definition rs_internal.hpp:324
uint32_t get_timestamp() const
Definition rs_internal.hpp:339
std::vector< uint8_t > data() const
Definition rs_internal.hpp:355
rs2_log_severity get_severity() const
Definition rs_internal.hpp:329
std::string get_severity_str() const
Definition rs_internal.hpp:335
int size() const
Definition rs_internal.hpp:347
firmware_log_message(std::shared_ptr< rs2_firmware_log_message > msg)
Definition rs_internal.hpp:326
const std::shared_ptr< rs2_firmware_log_message > get_message() const
Definition rs_internal.hpp:370
Definition rs_internal.hpp:377
std::string file_name() const
Definition rs_internal.hpp:389
std::string thread_name() const
Definition rs_internal.hpp:396
firmware_log_parsed_message(std::shared_ptr< rs2_firmware_log_parsed_message > msg)
Definition rs_internal.hpp:379
uint32_t timestamp() const
Definition rs_internal.hpp:424
std::string message() const
Definition rs_internal.hpp:382
std::string severity() const
Definition rs_internal.hpp:410
uint32_t sequence_id() const
Definition rs_internal.hpp:432
std::string module_name() const
Definition rs_internal.hpp:403
const std::shared_ptr< rs2_firmware_log_parsed_message > get_message() const
Definition rs_internal.hpp:440
uint32_t line() const
Definition rs_internal.hpp:417
rs2::firmware_log_message create_message()
Definition rs_internal.hpp:474
firmware_logger(device d)
Definition rs_internal.hpp:449
void stop_collecting()
Definition rs_internal.hpp:467
bool get_firmware_log(rs2::firmware_log_message &msg) const
Definition rs_internal.hpp:496
rs2::firmware_log_parsed_message create_parsed_message()
Definition rs_internal.hpp:485
bool init_parser(const std::string &xml_content)
Definition rs_internal.hpp:520
void start_collecting()
Definition rs_internal.hpp:460
bool parse_log(const rs2::firmware_log_message &msg, const rs2::firmware_log_parsed_message &parsed_msg)
Definition rs_internal.hpp:530
bool get_flash_log(rs2::firmware_log_message &msg) const
Definition rs_internal.hpp:508
unsigned int get_number_of_fw_logs() const
Definition rs_internal.hpp:540
Definition rs_frame.hpp:346
Definition rs_sensor.hpp:103
sensor()
Definition rs_sensor.hpp:313
std::shared_ptr< rs2_sensor > _sensor
Definition rs_sensor.hpp:352
Definition rs_internal.hpp:32
software_device_destruction_callback(T on_destruction)
Definition rs_internal.hpp:35
void on_destruction() override
Definition rs_internal.hpp:37
void release() override
Definition rs_internal.hpp:42
software_device(std::function< void(rs2_device *)> deleter=&rs2_delete_device)
Definition rs_internal.hpp:230
software_sensor add_sensor(std::string name)
Definition rs_internal.hpp:247
void set_destruction_callback(T callback) const
Definition rs_internal.hpp:263
software_device(std::string name)
Definition rs_internal.hpp:236
void add_to(context &ctx)
Definition rs_internal.hpp:278
void register_info(rs2_camera_info info, const std::string &val)
Definition rs_internal.hpp:291
void update_info(rs2_camera_info info, const std::string &val)
Definition rs_internal.hpp:304
void create_matcher(rs2_matchers matcher)
Definition rs_internal.hpp:315
Definition rs_internal.hpp:46
void on_pose_frame(rs2_software_pose_frame frame)
Definition rs_internal.hpp:125
stream_profile add_pose_stream(rs2_pose_stream pose_stream, bool is_default=false)
Definition rs_internal.hpp:85
void set_metadata(rs2_frame_metadata_value value, rs2_metadata_type type)
Definition rs_internal.hpp:137
void add_option(rs2_option option, const option_range &range, bool is_writable=true)
Definition rs_internal.hpp:175
void set_read_only_option(rs2_option option, float val)
Definition rs_internal.hpp:163
stream_profile add_video_stream(rs2_video_stream video_stream, bool is_default=false)
Definition rs_internal.hpp:53
void add_read_only_option(rs2_option option, float val)
Definition rs_internal.hpp:150
void detach()
Definition rs_internal.hpp:194
friend class software_device
Definition rs_internal.hpp:202
void on_video_frame(rs2_software_video_frame frame)
Definition rs_internal.hpp:101
void on_notification(rs2_software_notification notif)
Definition rs_internal.hpp:183
void on_motion_frame(rs2_software_motion_frame frame)
Definition rs_internal.hpp:113
stream_profile add_motion_stream(rs2_motion_stream motion_stream, bool is_default=false)
Definition rs_internal.hpp:69
Definition rs_frame.hpp:23
std::vector< uint8_t > parse_command(const std::string &command)
Definition rs_internal.hpp:563
std::string parse_response(const std::string &command, const std::vector< uint8_t > &response)
Definition rs_internal.hpp:583
terminal_parser(const std::string &xml_content)
Definition rs_internal.hpp:553
Definition rs_internal.hpp:15
double get_time()
Definition rs_internal.hpp:19
Definition rs_processing_gl.hpp:13
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
rs2_time_t rs2_get_time(rs2_error **error)
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
void rs2_context_add_software_device(rs2_context *ctx, rs2_device *dev, rs2_error **error)
void rs2_delete_device(rs2_device *device)
int rs2_is_device_extendable_to(const rs2_device *device, rs2_extension extension, rs2_error **error)
rs2_frame_metadata_value
Per-Frame-Metadata is the set of read-only properties that might be exposed for each individual frame...
Definition rs_frame.h:30
Exposes RealSense internal functionality for C compilers.
rs2_firmware_log_message * rs2_create_fw_log_message(rs2_device *dev, rs2_error **error)
Creates RealSense firmware log message.
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.
void rs2_software_device_update_info(rs2_device *dev, rs2_camera_info info, const char *val, rs2_error **error)
rs2_stream_profile * rs2_software_sensor_add_pose_stream_ex(rs2_sensor *sensor, rs2_pose_stream pose_stream, int is_default, rs2_error **error)
unsigned int rs2_fw_log_message_timestamp(rs2_firmware_log_message *msg, rs2_error **error)
Gets RealSense firmware log message timestamp.
void rs2_delete_fw_log_parsed_message(rs2_firmware_log_parsed_message *fw_log_parsed_msg)
Deletes RealSense firmware log parsed message.
void rs2_software_sensor_set_metadata(rs2_sensor *sensor, rs2_frame_metadata_value value, rs2_metadata_type type, 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)
rs2_firmware_log_parsed_message * rs2_create_fw_log_parsed_message(rs2_device *dev, rs2_error **error)
Creates RealSense firmware log parsed message.
void rs2_software_sensor_on_pose_frame(rs2_sensor *sensor, rs2_software_pose_frame frame, rs2_error **error)
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.
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....
void rs2_software_sensor_on_notification(rs2_sensor *sensor, rs2_software_notification notif, rs2_error **error)
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.
void rs2_software_device_create_matcher(rs2_device *dev, rs2_matchers matcher, rs2_error **error)
void rs2_start_collecting_fw_logs(rs2_device *dev, rs2_error **error)
Starts collecting FW log messages in the device.
void rs2_software_device_set_destruction_callback_cpp(const rs2_device *dev, rs2_software_device_destruction_callback *callback, rs2_error **error)
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.
rs2_device * rs2_create_software_device(rs2_error **error)
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.
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.
void rs2_software_sensor_detach(rs2_sensor *sensor, rs2_error **error)
void rs2_software_sensor_update_read_only_option(rs2_sensor *sensor, rs2_option option, float val, rs2_error **error)
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_...
int rs2_get_fw_log(rs2_device *dev, rs2_firmware_log_message *fw_log_msg, rs2_error **error)
Gets RealSense firmware log.
rs2_stream_profile * rs2_software_sensor_add_motion_stream_ex(rs2_sensor *sensor, rs2_motion_stream motion_stream, int is_default, rs2_error **error)
void rs2_software_sensor_on_video_frame(rs2_sensor *sensor, rs2_software_video_frame frame, rs2_error **error)
int rs2_init_fw_log_parser(rs2_device *dev, const char *xml_content, rs2_error **error)
Initializes RealSense firmware logs parser in device.
int rs2_fw_log_message_size(rs2_firmware_log_message *msg, rs2_error **error)
Gets RealSense firmware log message size.
void rs2_software_sensor_add_read_only_option(rs2_sensor *sensor, rs2_option option, float val, rs2_error **error)
rs2_sensor * rs2_software_device_add_sensor(rs2_device *dev, const char *sensor_name, rs2_error **error)
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 s...
void rs2_delete_fw_log_message(rs2_firmware_log_message *msg)
rs2_stream_profile * rs2_software_sensor_add_video_stream_ex(rs2_sensor *sensor, rs2_video_stream video_stream, int is_default, rs2_error **error)
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.
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.
void rs2_stop_collecting_fw_logs(rs2_device *dev, rs2_error **error)
Stops collecting FW log messages in the device.
rs2_terminal_parser * rs2_create_terminal_parser(const char *xml_content, rs2_error **error)
Creates RealSense terminal parser.
void rs2_delete_terminal_parser(rs2_terminal_parser *terminal_parser)
Deletes RealSense terminal parser.
rs2_log_severity rs2_fw_log_message_severity(const rs2_firmware_log_message *msg, rs2_error **error)
Gets RealSense firmware log message severity.
const unsigned char * rs2_fw_log_message_data(rs2_firmware_log_message *msg, rs2_error **error)
Gets RealSense firmware log message data.
void rs2_software_device_register_info(rs2_device *dev, rs2_camera_info info, const char *val, rs2_error **error)
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.
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.
void rs2_software_sensor_on_motion_frame(rs2_sensor *sensor, rs2_software_motion_frame frame, rs2_error **error)
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls,...
Definition rs_option.h:27
int rs2_is_sensor_extendable_to(const rs2_sensor *sensor, rs2_extension extension, rs2_error **error)
void rs2_delete_sensor(rs2_sensor *sensor)
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_CAMERA_INFO_NAME
Definition rs_sensor.h:23
rs2_log_severity
Severity of the librealsense logger.
Definition rs_types.h:123
struct rs2_device rs2_device
Definition rs_types.h:229
struct rs2_firmware_log_message rs2_firmware_log_message
Definition rs_types.h:261
@ RS2_EXTENSION_FW_LOGGER
Definition rs_types.h:186
@ RS2_EXTENSION_SOFTWARE_SENSOR
Definition rs_types.h:162
const char * rs2_log_severity_to_string(rs2_log_severity info)
struct rs2_error rs2_error
Definition rs_types.h:230
rs2_matchers
Specifies types of different matchers.
Definition rs_types.h:202
long long rs2_metadata_type
Definition rs_types.h:275
Definition rs_types.hpp:195
float def
Definition rs_types.hpp:198
float step
Definition rs_types.hpp:199
float max
Definition rs_types.hpp:197
float min
Definition rs_types.hpp:196
All the parameters required to define a motion stream.
Definition rs_internal.h:56
All the parameters required to define a pose stream.
Definition rs_internal.h:67
Definition rs_types.hpp:53
All the parameters required to define a motion frame.
Definition rs_internal.h:91
All the parameters required to define a sensor notification.
Definition rs_internal.h:124
All the parameters required to define a pose frame.
Definition rs_internal.h:102
All the parameters required to define a video frame.
Definition rs_internal.h:77
All the parameters required to define a video stream.
Definition rs_internal.h:42