RealSense Cross Platform API
RealSense Cross-platform API
rs_internal.hpp
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 
4 #ifndef LIBREALSENSE_RS2_INTERNAL_HPP
5 #define LIBREALSENSE_RS2_INTERNAL_HPP
6 
7 #include "rs_types.hpp"
8 #include "rs_device.hpp"
9 #include "rs_context.hpp"
10 #include "../h/rs_internal.h"
11 
12 namespace rs2
13 {
14  namespace internal
15  {
19  inline double get_time()
20  {
21  rs2_error* e = nullptr;
22  auto time = rs2_get_time( &e);
23 
24  error::handle(e);
25 
26  return time;
27  }
28  }
29 
30  template<class T>
32  {
33  T on_destruction_function;
34  public:
35  explicit software_device_destruction_callback(T on_destruction) : on_destruction_function(on_destruction) {}
36 
37  void on_destruction() override
38  {
39  on_destruction_function();
40  }
41 
42  void release() override { delete this; }
43  };
44 
45  class software_sensor : public sensor
46  {
47  public:
53  stream_profile add_video_stream(rs2_video_stream video_stream, bool is_default=false)
54  {
55  rs2_error* e = nullptr;
56 
57  auto profile = rs2_software_sensor_add_video_stream_ex(_sensor.get(), video_stream, is_default, &e);
58  error::handle(e);
59 
60  stream_profile stream(profile);
61  return stream;
62  }
63 
69  stream_profile add_motion_stream(rs2_motion_stream motion_stream, bool is_default=false)
70  {
71  rs2_error* e = nullptr;
72 
73  auto profile = rs2_software_sensor_add_motion_stream_ex(_sensor.get(), motion_stream, is_default, &e);
74  error::handle(e);
75 
76  stream_profile stream(profile);
77  return stream;
78  }
79 
85  stream_profile add_pose_stream(rs2_pose_stream pose_stream, bool is_default=false)
86  {
87  rs2_error* e = nullptr;
88 
89  auto profile = rs2_software_sensor_add_pose_stream_ex(_sensor.get(), pose_stream, is_default, &e);
90  error::handle(e);
91 
92  stream_profile stream(profile);
93  return stream;
94  }
95 
101  stream_profile add_inference_stream(rs2_inference_stream inference_stream, bool is_default=false)
102  {
103  rs2_error* e = nullptr;
104 
105  auto profile = rs2_software_sensor_add_inference_stream_ex(_sensor.get(), inference_stream, is_default, &e);
106  error::handle(e);
107 
108  stream_profile stream(profile);
109  return stream;
110  }
111 
118  {
119  rs2_error* e = nullptr;
121  error::handle(e);
122  }
123 
130  {
131  rs2_error* e = nullptr;
133  error::handle(e);
134  }
135 
142  {
143  rs2_error* e = nullptr;
145  error::handle(e);
146  }
147 
154  {
155  rs2_error* e = nullptr;
156  rs2_software_sensor_set_metadata(_sensor.get(), value, type, &e);
157  error::handle(e);
158  }
159 
166  void add_read_only_option(rs2_option option, float val)
167  {
168  rs2_error* e = nullptr;
169  rs2_software_sensor_add_read_only_option(_sensor.get(), option, val, &e);
170  error::handle(e);
171  }
172 
179  void set_read_only_option(rs2_option option, float val)
180  {
181  rs2_error* e = nullptr;
183  error::handle(e);
184  }
191  void add_option(rs2_option option, const option_range& range, bool is_writable=true)
192  {
193  rs2_error* e = nullptr;
194  rs2_software_sensor_add_option(_sensor.get(), option, range.min,
195  range.max, range.step, range.def, is_writable, &e);
196  error::handle(e);
197  }
198 
200  {
201  rs2_error * e = nullptr;
203  error::handle(e);
204  }
210  void detach()
211  {
212  rs2_error * e = nullptr;
214  error::handle(e);
215  }
216 
217  private:
218  friend class software_device;
219 
220  software_sensor(std::shared_ptr<rs2_sensor> s)
221  : rs2::sensor(s)
222  {
223  rs2_error* e = nullptr;
225  {
226  _sensor = nullptr;
227  }
229  }
230  };
231 
232 
233  class software_device : public device
234  {
235  std::shared_ptr<rs2_device> create_device_ptr(std::function<void(rs2_device*)> deleter)
236  {
237  rs2_error* e = nullptr;
238  std::shared_ptr<rs2_device> dev(
240  deleter);
241  error::handle(e);
242  return dev;
243  }
244 
245  public:
246  software_device(std::function<void(rs2_device*)> deleter = &rs2_delete_device)
247  : device(create_device_ptr(deleter))
248  {
249  this->set_destruction_callback([]{});
250  }
251 
252  software_device(std::string name)
253  : device(create_device_ptr(&rs2_delete_device))
254  {
256  }
257 
263  software_sensor add_sensor(std::string name)
264  {
265  rs2_error* e = nullptr;
266  std::shared_ptr<rs2_sensor> sensor(
267  rs2_software_device_add_sensor(_dev.get(), name.c_str(), &e),
269  error::handle(e);
270 
271  return software_sensor(sensor);
272  }
273 
278  template<class T>
279  void set_destruction_callback(T callback) const
280  {
281  rs2_error* e = nullptr;
283  new software_device_destruction_callback<T>(std::move(callback)), &e);
284  error::handle(e);
285  }
286 
294  void add_to(context& ctx)
295  {
296  rs2_error* e = nullptr;
297  rs2_context_add_software_device(ctx._context.get(), _dev.get(), &e);
298  error::handle(e);
299  }
300 
307  void register_info(rs2_camera_info info, const std::string& val)
308  {
309  rs2_error* e = nullptr;
310  rs2_software_device_register_info(_dev.get(), info, val.c_str(), &e);
311  error::handle(e);
312  }
313 
320  void update_info(rs2_camera_info info, const std::string& val)
321  {
322  rs2_error* e = nullptr;
323  rs2_software_device_update_info(_dev.get(), info, val.c_str(), &e);
324  error::handle(e);
325  }
326 
332  {
333  rs2_error* e = nullptr;
334  rs2_software_device_create_matcher(_dev.get(), matcher, &e);
335  error::handle(e);
336  }
337  };
338 
340  {
341  public:
342  explicit firmware_log_message(std::shared_ptr<rs2_firmware_log_message> msg) :
343  _fw_log_message(msg) {}
344 
346  rs2_error* e = nullptr;
347  rs2_log_severity severity = rs2_fw_log_message_severity(_fw_log_message.get(), &e);
348  error::handle(e);
349  return severity;
350  }
351  std::string get_severity_str() const {
353  }
354 
355  uint32_t get_timestamp() const
356  {
357  rs2_error* e = nullptr;
358  uint32_t timestamp = rs2_fw_log_message_timestamp(_fw_log_message.get(), &e);
359  error::handle(e);
360  return timestamp;
361  }
362 
363  int size() const
364  {
365  rs2_error* e = nullptr;
366  int size = rs2_fw_log_message_size(_fw_log_message.get(), &e);
367  error::handle(e);
368  return size;
369  }
370 
371  std::vector<uint8_t> data() const
372  {
373  rs2_error* e = nullptr;
374  auto size = rs2_fw_log_message_size(_fw_log_message.get(), &e);
375  error::handle(e);
376  std::vector<uint8_t> result;
377  if (size > 0)
378  {
379  auto start = rs2_fw_log_message_data(_fw_log_message.get(), &e);
380  error::handle(e);
381  result.insert(result.begin(), start, start + size);
382  }
383  return result;
384  }
385 
386  const std::shared_ptr<rs2_firmware_log_message> get_message() const { return _fw_log_message; }
387 
388  private:
389  std::shared_ptr<rs2_firmware_log_message> _fw_log_message;
390  };
391 
393  {
394  public:
395  explicit firmware_log_parsed_message(std::shared_ptr<rs2_firmware_log_parsed_message> msg) :
396  _parsed_fw_log(msg) {}
397 
398  std::string message() const
399  {
400  rs2_error* e = nullptr;
401  std::string msg(rs2_get_fw_log_parsed_message(_parsed_fw_log.get(), &e));
402  error::handle(e);
403  return msg;
404  }
405  std::string file_name() const
406  {
407  rs2_error* e = nullptr;
408  std::string file_name(rs2_get_fw_log_parsed_file_name(_parsed_fw_log.get(), &e));
409  error::handle(e);
410  return file_name;
411  }
412  std::string thread_name() const
413  {
414  rs2_error* e = nullptr;
415  std::string name(rs2_get_fw_log_parsed_thread_name(_parsed_fw_log.get(), &e));
416  error::handle(e);
417  return name;
418  }
419  std::string module_name() const
420  {
421  rs2_error * e = nullptr;
422  std::string name( rs2_get_fw_log_parsed_module_name( _parsed_fw_log.get(), &e ) );
423  error::handle( e );
424  return name;
425  }
426  std::string severity() const
427  {
428  rs2_error* e = nullptr;
429  rs2_log_severity sev = rs2_get_fw_log_parsed_severity(_parsed_fw_log.get(), &e);
430  error::handle(e);
431  return std::string(rs2_log_severity_to_string(sev));
432  }
433  uint32_t line() const
434  {
435  rs2_error* e = nullptr;
436  uint32_t line(rs2_get_fw_log_parsed_line(_parsed_fw_log.get(), &e));
437  error::handle(e);
438  return line;
439  }
440  uint32_t timestamp() const
441  {
442  rs2_error* e = nullptr;
443  uint32_t timestamp(rs2_get_fw_log_parsed_timestamp(_parsed_fw_log.get(), &e));
444  error::handle(e);
445  return timestamp;
446  }
447 
448  uint32_t sequence_id() const
449  {
450  rs2_error* e = nullptr;
451  uint32_t sequence(rs2_get_fw_log_parsed_sequence_id(_parsed_fw_log.get(), &e));
452  error::handle(e);
453  return sequence;
454  }
455 
456  const std::shared_ptr<rs2_firmware_log_parsed_message> get_message() const { return _parsed_fw_log; }
457 
458  private:
459  std::shared_ptr<rs2_firmware_log_parsed_message> _parsed_fw_log;
460  };
461 
462  class firmware_logger : public device
463  {
464  public:
466  : device(d.get())
467  {
468  rs2_error* e = nullptr;
469  if (rs2_is_device_extendable_to(_dev.get(), RS2_EXTENSION_FW_LOGGER, &e) == 0 && !e)
470  {
471  _dev.reset();
472  }
473  error::handle(e);
474  }
475 
477  {
478  rs2_error * e = nullptr;
479  rs2_start_collecting_fw_logs( _dev.get(), &e );
480  error::handle( e );
481  }
482 
484  {
485  rs2_error * e = nullptr;
486  rs2_stop_collecting_fw_logs( _dev.get(), &e );
487  error::handle( e );
488  }
489 
491  {
492  rs2_error* e = nullptr;
493  std::shared_ptr<rs2_firmware_log_message> msg(
494  rs2_create_fw_log_message(_dev.get(), &e),
496  error::handle(e);
497 
498  return firmware_log_message(msg);
499  }
500 
502  {
503  rs2_error* e = nullptr;
504  std::shared_ptr<rs2_firmware_log_parsed_message> msg(
507  error::handle(e);
508 
509  return firmware_log_parsed_message(msg);
510  }
511 
513  {
514  rs2_error* e = nullptr;
515  rs2_firmware_log_message* m = msg.get_message().get();
516  bool fw_log_pulling_status =
517  !!rs2_get_fw_log(_dev.get(), m, &e);
518 
519  error::handle(e);
520 
521  return fw_log_pulling_status;
522  }
523 
525  {
526  rs2_error* e = nullptr;
527  rs2_firmware_log_message* m = msg.get_message().get();
528  bool flash_log_pulling_status =
529  !!rs2_get_flash_log(_dev.get(), m, &e);
530 
531  error::handle(e);
532 
533  return flash_log_pulling_status;
534  }
535 
536  bool init_parser(const std::string& xml_content)
537  {
538  rs2_error* e = nullptr;
539 
540  bool parser_initialized = !!rs2_init_fw_log_parser(_dev.get(), xml_content.c_str(), &e);
541  error::handle(e);
542 
543  return parser_initialized;
544  }
545 
547  {
548  rs2_error* e = nullptr;
549 
550  bool parsingResult = !!rs2_parse_firmware_log(_dev.get(), msg.get_message().get(), parsed_msg.get_message().get(), &e);
551  error::handle(e);
552 
553  return parsingResult;
554  }
555 
556  unsigned int get_number_of_fw_logs() const
557  {
558  rs2_error* e = nullptr;
559  unsigned int num_of_fw_logs = rs2_get_number_of_fw_logs(_dev.get(), &e);
560  error::handle(e);
561 
562  return num_of_fw_logs;
563  }
564  };
565 
567  {
568  public:
569  terminal_parser(const std::string& xml_content)
570  {
571  rs2_error* e = nullptr;
572 
573  _terminal_parser = std::shared_ptr<rs2_terminal_parser>(
574  rs2_create_terminal_parser(xml_content.c_str(), &e),
576  error::handle(e);
577  }
578 
579  std::vector<uint8_t> parse_command(const std::string& command)
580  {
581  rs2_error* e = nullptr;
582 
583  std::shared_ptr<const rs2_raw_data_buffer> list(
584  rs2_terminal_parse_command(_terminal_parser.get(), command.c_str(), (unsigned int)command.size(), &e),
586  error::handle(e);
587 
588  auto size = rs2_get_raw_data_size(list.get(), &e);
589  error::handle(e);
590 
591  auto start = rs2_get_raw_data(list.get(), &e);
592 
593  std::vector<uint8_t> results;
594  results.insert(results.begin(), start, start + size);
595 
596  return results;
597  }
598 
599  std::string parse_response(const std::string& command, const std::vector<uint8_t>& response)
600  {
601  rs2_error* e = nullptr;
602 
603  std::shared_ptr<const rs2_raw_data_buffer> list(
604  rs2_terminal_parse_response(_terminal_parser.get(), command.c_str(), (unsigned int)command.size(),
605  (void*)response.data(), (unsigned int)response.size(), &e),
607  error::handle(e);
608 
609  auto size = rs2_get_raw_data_size(list.get(), &e);
610  error::handle(e);
611 
612  auto start = rs2_get_raw_data(list.get(), &e);
613 
614  std::string results;
615  results.insert(results.begin(), start, start + size);
616 
617  return results;
618  }
619 
620  private:
621  std::shared_ptr<rs2_terminal_parser> _terminal_parser;
622  };
623 
624 }
625 #endif // LIBREALSENSE_RS2_INTERNAL_HPP
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_cpp(const rs2_device *dev, rs2_software_device_destruction_callback *callback, rs2_error **error)
Definition: rs_frame.hpp:22
firmware_logger(device d)
Definition: rs_internal.hpp:465
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::firmware_log_message create_message()
Definition: rs_internal.hpp:490
Definition: rs_sensor.hpp:103
stream_profile add_pose_stream(rs2_pose_stream pose_stream, bool is_default=false)
Definition: rs_internal.hpp:85
Definition: rs_frame.hpp:369
std::vector< uint8_t > data() const
Definition: rs_internal.hpp:371
const std::shared_ptr< rs2_firmware_log_message > get_message() const
Definition: rs_internal.hpp:386
uint32_t line() const
Definition: rs_internal.hpp:433
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:26
terminal_parser(const std::string &xml_content)
Definition: rs_internal.hpp:569
void rs2_stop_collecting_fw_logs(rs2_device *dev, rs2_error **error)
Stops collecting FW log messages in the device.
std::vector< uint8_t > parse_command(const std::string &command)
Definition: rs_internal.hpp:579
void register_info(rs2_camera_info info, const std::string &val)
Definition: rs_internal.hpp:307
rs2_stream_profile * rs2_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_option(rs2_sensor *sensor, rs2_option option, float min, float max, float step, float def, int is_writable, rs2_error **error)
void rs2_delete_device(rs2_device *device)
void on_video_frame(rs2_software_video_frame frame)
Definition: rs_internal.hpp:117
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.
All the parameters required to define a video stream.
Definition: rs_internal.h:41
void set_metadata(rs2_frame_metadata_value value, rs2_metadata_type type)
Definition: rs_internal.hpp:153
const std::shared_ptr< rs2_firmware_log_parsed_message > get_message() const
Definition: rs_internal.hpp:456
All the parameters required to define a pose frame.
Definition: rs_internal.h:111
bool get_firmware_log(rs2::firmware_log_message &msg) const
Definition: rs_internal.hpp:512
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
int rs2_fw_log_message_size(rs2_firmware_log_message *msg, rs2_error **error)
Gets RealSense firmware log message size.
Definition: rs_internal.hpp:31
software_device_destruction_callback(T on_destruction)
Definition: rs_internal.hpp:35
std::string thread_name() const
Definition: rs_internal.hpp:412
float min
Definition: rs_types.hpp:201
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...
std::string parse_response(const std::string &command, const std::vector< uint8_t > &response)
Definition: rs_internal.hpp:599
unsigned int rs2_fw_log_message_timestamp(rs2_firmware_log_message *msg, rs2_error **error)
Gets RealSense firmware log message timestamp.
Definition: rs_types.hpp:57
Definition: rs_context.hpp:11
Definition: rs_sensor.h:23
void on_motion_frame(rs2_software_motion_frame frame)
Definition: rs_internal.hpp:129
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
std::string get_severity_str() const
Definition: rs_internal.hpp:351
software_sensor add_sensor(std::string name)
Definition: rs_internal.hpp:263
software_device(std::function< void(rs2_device *)> deleter=&rs2_delete_device)
Definition: rs_internal.hpp:246
Definition: rs_internal.hpp:339
stream_profile add_motion_stream(rs2_motion_stream motion_stream, bool is_default=false)
Definition: rs_internal.hpp:69
Definition: rs_context.hpp:96
std::string severity() const
Definition: rs_internal.hpp:426
void set_read_only_option(rs2_option option, float val)
Definition: rs_internal.hpp:179
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
rs2_log_severity get_severity() const
Definition: rs_internal.hpp:345
float max
Definition: rs_types.hpp:202
float step
Definition: rs_types.hpp:204
bool parse_log(const rs2::firmware_log_message &msg, const rs2::firmware_log_parsed_message &parsed_msg)
Definition: rs_internal.hpp:546
void start_collecting()
Definition: rs_internal.hpp:476
void rs2_delete_fw_log_parsed_message(rs2_firmware_log_parsed_message *fw_log_parsed_msg)
Deletes RealSense firmware log parsed message.
uint32_t timestamp() const
Definition: rs_internal.hpp:440
rs2::firmware_log_parsed_message create_parsed_message()
Definition: rs_internal.hpp:501
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_...
firmware_log_parsed_message(std::shared_ptr< rs2_firmware_log_parsed_message > msg)
Definition: rs_internal.hpp:395
Definition: rs_types.h:175
void rs2_software_sensor_detach(rs2_sensor *sensor, rs2_error **error)
rs2_stream_profile * rs2_software_sensor_add_video_stream_ex(rs2_sensor *sensor, rs2_video_stream video_stream, int is_default, 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...
unsigned int get_number_of_fw_logs() const
Definition: rs_internal.hpp:556
firmware_log_message(std::shared_ptr< rs2_firmware_log_message > msg)
Definition: rs_internal.hpp:342
rs2_time_t rs2_get_time(rs2_error **error)
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:388
rs2_log_severity rs2_fw_log_message_severity(const rs2_firmware_log_message *msg, rs2_error **error)
Gets RealSense firmware log message severity.
Definition: rs_internal.hpp:462
std::shared_ptr< rs2_context > _context
Definition: rs_context.hpp:245
uint32_t sequence_id() const
Definition: rs_internal.hpp:448
All the parameters required to define a pose stream.
Definition: rs_internal.h:66
Definition: rs_internal.hpp:45
void rs2_delete_sensor(rs2_sensor *sensor)
Definition: rs_types.hpp:199
rs2_matchers
Specifies types of different matchers.
Definition: rs_types.h:226
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.
Definition: rs_internal.hpp:566
int rs2_is_device_extendable_to(const rs2_device *device, rs2_extension extension, rs2_error **error)
bool get_flash_log(rs2::firmware_log_message &msg) const
Definition: rs_internal.hpp:524
const std::shared_ptr< rs2_device > & get() const
Definition: rs_device.hpp:164
void rs2_software_sensor_on_pose_frame(rs2_sensor *sensor, rs2_software_pose_frame frame, rs2_error **error)
std::shared_ptr< rs2_device > _dev
Definition: rs_device.hpp:209
rs2_device * rs2_create_software_device(rs2_error **error)
void rs2_software_sensor_add_read_only_option(rs2_sensor *sensor, rs2_option option, float val, rs2_error **error)
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 create_matcher(rs2_matchers matcher)
Definition: rs_internal.hpp:331
All the parameters required to define a motion stream.
Definition: rs_internal.h:55
std::string module_name() const
Definition: rs_internal.hpp:419
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_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_start_collecting_fw_logs(rs2_device *dev, rs2_error **error)
Starts collecting FW log messages in the device.
void update_info(rs2_camera_info info, const std::string &val)
Definition: rs_internal.hpp:320
int size() const
Definition: rs_internal.hpp:363
Definition: rs_internal.hpp:233
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.
static void handle(rs2_error *e)
Definition: rs_types.hpp:167
void release() override
Definition: rs_internal.hpp:42
rs2_sensor * rs2_software_device_add_sensor(rs2_device *dev, const char *sensor_name, rs2_error **error)
void rs2_software_sensor_update_read_only_option(rs2_sensor *sensor, rs2_option option, float val, rs2_error **error)
stream_profile add_inference_stream(rs2_inference_stream inference_stream, bool is_default=false)
Definition: rs_internal.hpp:101
void rs2_software_sensor_on_notification(rs2_sensor *sensor, rs2_software_notification notif, rs2_error **error)
void on_notification(rs2_software_notification notif)
Definition: rs_internal.hpp:199
void add_to(context &ctx)
Definition: rs_internal.hpp:294
void rs2_software_device_create_matcher(rs2_device *dev, rs2_matchers matcher, rs2_error **error)
int rs2_is_sensor_extendable_to(const rs2_sensor *sensor, rs2_extension extension, rs2_error **error)
void rs2_delete_terminal_parser(rs2_terminal_parser *terminal_parser)
Deletes RealSense terminal parser.
int rs2_init_fw_log_parser(rs2_device *dev, const char *xml_content, rs2_error **error)
Initializes RealSense firmware logs parser in device.
All the parameters required to define a sensor notification.
Definition: rs_internal.h:133
long long rs2_metadata_type
Definition: rs_types.h:341
void on_pose_frame(rs2_software_pose_frame frame)
Definition: rs_internal.hpp:141
float def
Definition: rs_types.hpp:203
void rs2_delete_fw_log_message(rs2_firmware_log_message *msg)
void detach()
Definition: rs_internal.hpp:210
void rs2_context_add_software_device(rs2_context *ctx, rs2_device *dev, rs2_error **error)
All the parameters required to define a motion frame.
Definition: rs_internal.h:100
struct rs2_device rs2_device
Definition: rs_types.h:292
rs2_stream_profile * rs2_software_sensor_add_inference_stream_ex(rs2_sensor *sensor, rs2_inference_stream inference_stream, int is_default, rs2_error **error)
void rs2_software_sensor_on_motion_frame(rs2_sensor *sensor, rs2_software_motion_frame frame, rs2_error **error)
software_device(std::string name)
Definition: rs_internal.hpp:252
void add_option(rs2_option option, const option_range &range, bool is_writable=true)
Definition: rs_internal.hpp:191
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 stop_collecting()
Definition: rs_internal.hpp:483
Definition: rs_types.h:198
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.
bool init_parser(const std::string &xml_content)
Definition: rs_internal.hpp:536
void set_destruction_callback(T callback) const
Definition: rs_internal.hpp:279
rs2_firmware_log_message * rs2_create_fw_log_message(rs2_device *dev, rs2_error **error)
Creates RealSense firmware log message.
void add_read_only_option(rs2_option option, float val)
Definition: rs_internal.hpp:166
std::string file_name() const
Definition: rs_internal.hpp:405
void rs2_software_sensor_on_video_frame(rs2_sensor *sensor, rs2_software_video_frame frame, rs2_error **error)
All the parameters required to define a video frame.
Definition: rs_internal.h:86
const char * rs2_log_severity_to_string(rs2_log_severity info)
All the parameters required to define an inference stream.
Definition: rs_internal.h:76
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.
struct rs2_firmware_log_message rs2_firmware_log_message
Definition: rs_types.h:327
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.
const unsigned char * rs2_fw_log_message_data(rs2_firmware_log_message *msg, rs2_error **error)
Gets RealSense firmware log message data.
struct rs2_error rs2_error
Definition: rs_types.h:293
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_device_register_info(rs2_device *dev, rs2_camera_info info, const char *val, rs2_error **error)
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:135
rs2_terminal_parser * rs2_create_terminal_parser(const char *xml_content, rs2_error **error)
Creates RealSense terminal parser.
Definition: rs_device.hpp:19
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.
int rs2_get_fw_log(rs2_device *dev, rs2_firmware_log_message *fw_log_msg, rs2_error **error)
Gets RealSense firmware log.
stream_profile add_video_stream(rs2_video_stream video_stream, bool is_default=false)
Definition: rs_internal.hpp:53
double get_time()
Definition: rs_internal.hpp:19
Definition: rs_internal.hpp:392
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:29
std::string message() const
Definition: rs_internal.hpp:398
uint32_t get_timestamp() const
Definition: rs_internal.hpp:355
void rs2_software_device_update_info(rs2_device *dev, rs2_camera_info info, const char *val, rs2_error **error)
void on_destruction() override
Definition: rs_internal.hpp:37