Intel® RealSense™ Cross Platform API
Intel 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 Intel Corporation. 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 
102  {
103  rs2_error* e = nullptr;
105  error::handle(e);
106  }
107 
114  {
115  rs2_error* e = nullptr;
117  error::handle(e);
118  }
119 
126  {
127  rs2_error* e = nullptr;
129  error::handle(e);
130  }
131 
138  {
139  rs2_error* e = nullptr;
140  rs2_software_sensor_set_metadata(_sensor.get(), value, type, &e);
141  error::handle(e);
142  }
143 
150  void add_read_only_option(rs2_option option, float val)
151  {
152  rs2_error* e = nullptr;
153  rs2_software_sensor_add_read_only_option(_sensor.get(), option, val, &e);
154  error::handle(e);
155  }
156 
163  void set_read_only_option(rs2_option option, float val)
164  {
165  rs2_error* e = nullptr;
167  error::handle(e);
168  }
175  void add_option(rs2_option option, const option_range& range, bool is_writable=true)
176  {
177  rs2_error* e = nullptr;
178  rs2_software_sensor_add_option(_sensor.get(), option, range.min,
179  range.max, range.step, range.def, is_writable, &e);
180  error::handle(e);
181  }
182 
184  {
185  rs2_error * e = nullptr;
187  error::handle(e);
188  }
194  void detach()
195  {
196  rs2_error * e = nullptr;
198  error::handle(e);
199  }
200 
201  private:
202  friend class software_device;
203 
204  software_sensor(std::shared_ptr<rs2_sensor> s)
205  : rs2::sensor(s)
206  {
207  rs2_error* e = nullptr;
209  {
210  _sensor = nullptr;
211  }
213  }
214  };
215 
216 
217  class software_device : public device
218  {
219  std::shared_ptr<rs2_device> create_device_ptr(std::function<void(rs2_device*)> deleter)
220  {
221  rs2_error* e = nullptr;
222  std::shared_ptr<rs2_device> dev(
224  deleter);
225  error::handle(e);
226  return dev;
227  }
228 
229  public:
230  software_device(std::function<void(rs2_device*)> deleter = &rs2_delete_device)
231  : device(create_device_ptr(deleter))
232  {
233  this->set_destruction_callback([]{});
234  }
235 
236  software_device(std::string name)
237  : device(create_device_ptr(&rs2_delete_device))
238  {
240  }
241 
247  software_sensor add_sensor(std::string name)
248  {
249  rs2_error* e = nullptr;
250  std::shared_ptr<rs2_sensor> sensor(
251  rs2_software_device_add_sensor(_dev.get(), name.c_str(), &e),
253  error::handle(e);
254 
255  return software_sensor(sensor);
256  }
257 
262  template<class T>
263  void set_destruction_callback(T callback) const
264  {
265  rs2_error* e = nullptr;
267  new software_device_destruction_callback<T>(std::move(callback)), &e);
268  error::handle(e);
269  }
270 
278  void add_to(context& ctx)
279  {
280  rs2_error* e = nullptr;
281  rs2_context_add_software_device(ctx._context.get(), _dev.get(), &e);
282  error::handle(e);
283  }
284 
291  void register_info(rs2_camera_info info, const std::string& val)
292  {
293  rs2_error* e = nullptr;
294  rs2_software_device_register_info(_dev.get(), info, val.c_str(), &e);
295  error::handle(e);
296  }
297 
304  void update_info(rs2_camera_info info, const std::string& val)
305  {
306  rs2_error* e = nullptr;
307  rs2_software_device_update_info(_dev.get(), info, val.c_str(), &e);
308  error::handle(e);
309  }
310 
316  {
317  rs2_error* e = nullptr;
318  rs2_software_device_create_matcher(_dev.get(), matcher, &e);
319  error::handle(e);
320  }
321  };
322 
324  {
325  public:
326  explicit firmware_log_message(std::shared_ptr<rs2_firmware_log_message> msg) :
327  _fw_log_message(msg) {}
328 
330  rs2_error* e = nullptr;
331  rs2_log_severity severity = rs2_fw_log_message_severity(_fw_log_message.get(), &e);
332  error::handle(e);
333  return severity;
334  }
335  std::string get_severity_str() const {
337  }
338 
339  uint32_t get_timestamp() const
340  {
341  rs2_error* e = nullptr;
342  uint32_t timestamp = rs2_fw_log_message_timestamp(_fw_log_message.get(), &e);
343  error::handle(e);
344  return timestamp;
345  }
346 
347  int size() const
348  {
349  rs2_error* e = nullptr;
350  int size = rs2_fw_log_message_size(_fw_log_message.get(), &e);
351  error::handle(e);
352  return size;
353  }
354 
355  std::vector<uint8_t> data() const
356  {
357  rs2_error* e = nullptr;
358  auto size = rs2_fw_log_message_size(_fw_log_message.get(), &e);
359  error::handle(e);
360  std::vector<uint8_t> result;
361  if (size > 0)
362  {
363  auto start = rs2_fw_log_message_data(_fw_log_message.get(), &e);
364  error::handle(e);
365  result.insert(result.begin(), start, start + size);
366  }
367  return result;
368  }
369 
370  const std::shared_ptr<rs2_firmware_log_message> get_message() const { return _fw_log_message; }
371 
372  private:
373  std::shared_ptr<rs2_firmware_log_message> _fw_log_message;
374  };
375 
377  {
378  public:
379  explicit firmware_log_parsed_message(std::shared_ptr<rs2_firmware_log_parsed_message> msg) :
380  _parsed_fw_log(msg) {}
381 
382  std::string message() const
383  {
384  rs2_error* e = nullptr;
385  std::string msg(rs2_get_fw_log_parsed_message(_parsed_fw_log.get(), &e));
386  error::handle(e);
387  return msg;
388  }
389  std::string file_name() const
390  {
391  rs2_error* e = nullptr;
392  std::string file_name(rs2_get_fw_log_parsed_file_name(_parsed_fw_log.get(), &e));
393  error::handle(e);
394  return file_name;
395  }
396  std::string thread_name() const
397  {
398  rs2_error* e = nullptr;
399  std::string name(rs2_get_fw_log_parsed_thread_name(_parsed_fw_log.get(), &e));
400  error::handle(e);
401  return name;
402  }
403  std::string module_name() const
404  {
405  rs2_error * e = nullptr;
406  std::string name( rs2_get_fw_log_parsed_module_name( _parsed_fw_log.get(), &e ) );
407  error::handle( e );
408  return name;
409  }
410  std::string severity() const
411  {
412  rs2_error* e = nullptr;
413  rs2_log_severity sev = rs2_get_fw_log_parsed_severity(_parsed_fw_log.get(), &e);
414  error::handle(e);
415  return std::string(rs2_log_severity_to_string(sev));
416  }
417  uint32_t line() const
418  {
419  rs2_error* e = nullptr;
420  uint32_t line(rs2_get_fw_log_parsed_line(_parsed_fw_log.get(), &e));
421  error::handle(e);
422  return line;
423  }
424  uint32_t timestamp() const
425  {
426  rs2_error* e = nullptr;
427  uint32_t timestamp(rs2_get_fw_log_parsed_timestamp(_parsed_fw_log.get(), &e));
428  error::handle(e);
429  return timestamp;
430  }
431 
432  uint32_t sequence_id() const
433  {
434  rs2_error* e = nullptr;
435  uint32_t sequence(rs2_get_fw_log_parsed_sequence_id(_parsed_fw_log.get(), &e));
436  error::handle(e);
437  return sequence;
438  }
439 
440  const std::shared_ptr<rs2_firmware_log_parsed_message> get_message() const { return _parsed_fw_log; }
441 
442  private:
443  std::shared_ptr<rs2_firmware_log_parsed_message> _parsed_fw_log;
444  };
445 
446  class firmware_logger : public device
447  {
448  public:
450  : device(d.get())
451  {
452  rs2_error* e = nullptr;
453  if (rs2_is_device_extendable_to(_dev.get(), RS2_EXTENSION_FW_LOGGER, &e) == 0 && !e)
454  {
455  _dev.reset();
456  }
457  error::handle(e);
458  }
459 
461  {
462  rs2_error * e = nullptr;
463  rs2_start_collecting_fw_logs( _dev.get(), &e );
464  error::handle( e );
465  }
466 
468  {
469  rs2_error * e = nullptr;
470  rs2_stop_collecting_fw_logs( _dev.get(), &e );
471  error::handle( e );
472  }
473 
475  {
476  rs2_error* e = nullptr;
477  std::shared_ptr<rs2_firmware_log_message> msg(
478  rs2_create_fw_log_message(_dev.get(), &e),
480  error::handle(e);
481 
482  return firmware_log_message(msg);
483  }
484 
486  {
487  rs2_error* e = nullptr;
488  std::shared_ptr<rs2_firmware_log_parsed_message> msg(
491  error::handle(e);
492 
493  return firmware_log_parsed_message(msg);
494  }
495 
497  {
498  rs2_error* e = nullptr;
499  rs2_firmware_log_message* m = msg.get_message().get();
500  bool fw_log_pulling_status =
501  !!rs2_get_fw_log(_dev.get(), m, &e);
502 
503  error::handle(e);
504 
505  return fw_log_pulling_status;
506  }
507 
509  {
510  rs2_error* e = nullptr;
511  rs2_firmware_log_message* m = msg.get_message().get();
512  bool flash_log_pulling_status =
513  !!rs2_get_flash_log(_dev.get(), m, &e);
514 
515  error::handle(e);
516 
517  return flash_log_pulling_status;
518  }
519 
520  bool init_parser(const std::string& xml_content)
521  {
522  rs2_error* e = nullptr;
523 
524  bool parser_initialized = !!rs2_init_fw_log_parser(_dev.get(), xml_content.c_str(), &e);
525  error::handle(e);
526 
527  return parser_initialized;
528  }
529 
531  {
532  rs2_error* e = nullptr;
533 
534  bool parsingResult = !!rs2_parse_firmware_log(_dev.get(), msg.get_message().get(), parsed_msg.get_message().get(), &e);
535  error::handle(e);
536 
537  return parsingResult;
538  }
539 
540  unsigned int get_number_of_fw_logs() const
541  {
542  rs2_error* e = nullptr;
543  unsigned int num_of_fw_logs = rs2_get_number_of_fw_logs(_dev.get(), &e);
544  error::handle(e);
545 
546  return num_of_fw_logs;
547  }
548  };
549 
551  {
552  public:
553  terminal_parser(const std::string& xml_content)
554  {
555  rs2_error* e = nullptr;
556 
557  _terminal_parser = std::shared_ptr<rs2_terminal_parser>(
558  rs2_create_terminal_parser(xml_content.c_str(), &e),
560  error::handle(e);
561  }
562 
563  std::vector<uint8_t> parse_command(const std::string& command)
564  {
565  rs2_error* e = nullptr;
566 
567  std::shared_ptr<const rs2_raw_data_buffer> list(
568  rs2_terminal_parse_command(_terminal_parser.get(), command.c_str(), (unsigned int)command.size(), &e),
570  error::handle(e);
571 
572  auto size = rs2_get_raw_data_size(list.get(), &e);
573  error::handle(e);
574 
575  auto start = rs2_get_raw_data(list.get(), &e);
576 
577  std::vector<uint8_t> results;
578  results.insert(results.begin(), start, start + size);
579 
580  return results;
581  }
582 
583  std::string parse_response(const std::string& command, const std::vector<uint8_t>& response)
584  {
585  rs2_error* e = nullptr;
586 
587  std::shared_ptr<const rs2_raw_data_buffer> list(
588  rs2_terminal_parse_response(_terminal_parser.get(), command.c_str(), (unsigned int)command.size(),
589  (void*)response.data(), (unsigned int)response.size(), &e),
591  error::handle(e);
592 
593  auto size = rs2_get_raw_data_size(list.get(), &e);
594  error::handle(e);
595 
596  auto start = rs2_get_raw_data(list.get(), &e);
597 
598  std::string results;
599  results.insert(results.begin(), start, start + size);
600 
601  return results;
602  }
603 
604  private:
605  std::shared_ptr<rs2_terminal_parser> _terminal_parser;
606  };
607 
608 }
609 #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:449
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:474
Definition: rs_sensor.hpp:102
stream_profile add_pose_stream(rs2_pose_stream pose_stream, bool is_default=false)
Definition: rs_internal.hpp:85
Definition: rs_frame.hpp:345
std::vector< uint8_t > data() const
Definition: rs_internal.hpp:355
const std::shared_ptr< rs2_firmware_log_message > get_message() const
Definition: rs_internal.hpp:370
uint32_t line() const
Definition: rs_internal.hpp:417
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:553
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:563
void register_info(rs2_camera_info info, const std::string &val)
Definition: rs_internal.hpp:291
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:101
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:137
const std::shared_ptr< rs2_firmware_log_parsed_message > get_message() const
Definition: rs_internal.hpp:440
All the parameters required to define a pose frame.
Definition: rs_internal.h:101
bool get_firmware_log(rs2::firmware_log_message &msg) const
Definition: rs_internal.hpp:496
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:396
float min
Definition: rs_types.hpp:196
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:583
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:52
Definition: rs_context.hpp:11
Definition: rs_sensor.h:23
void on_motion_frame(rs2_software_motion_frame frame)
Definition: rs_internal.hpp:113
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
std::string get_severity_str() const
Definition: rs_internal.hpp:335
software_sensor add_sensor(std::string name)
Definition: rs_internal.hpp:247
software_device(std::function< void(rs2_device *)> deleter=&rs2_delete_device)
Definition: rs_internal.hpp:230
Definition: rs_internal.hpp:323
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:410
void set_read_only_option(rs2_option option, float val)
Definition: rs_internal.hpp:163
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:329
float max
Definition: rs_types.hpp:197
float step
Definition: rs_types.hpp:199
bool parse_log(const rs2::firmware_log_message &msg, const rs2::firmware_log_parsed_message &parsed_msg)
Definition: rs_internal.hpp:530
void start_collecting()
Definition: rs_internal.hpp:460
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:424
rs2::firmware_log_parsed_message create_parsed_message()
Definition: rs_internal.hpp:485
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:379
Definition: rs_types.h:162
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:540
firmware_log_message(std::shared_ptr< rs2_firmware_log_message > msg)
Definition: rs_internal.hpp:326
rs2_time_t rs2_get_time(rs2_error **error)
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:352
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:446
std::shared_ptr< rs2_context > _context
Definition: rs_context.hpp:228
uint32_t sequence_id() const
Definition: rs_internal.hpp:432
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:194
rs2_matchers
Specifies types of different matchers.
Definition: rs_types.h:200
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:550
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:508
const std::shared_ptr< rs2_device > & get() const
Definition: rs_device.hpp:162
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:207
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:315
All the parameters required to define a motion stream.
Definition: rs_internal.h:55
std::string module_name() const
Definition: rs_internal.hpp:403
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:304
int size() const
Definition: rs_internal.hpp:347
Definition: rs_internal.hpp:217
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:162
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)
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:183
void add_to(context &ctx)
Definition: rs_internal.hpp:278
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:123
long long rs2_metadata_type
Definition: rs_types.h:274
void on_pose_frame(rs2_software_pose_frame frame)
Definition: rs_internal.hpp:125
float def
Definition: rs_types.hpp:198
void rs2_delete_fw_log_message(rs2_firmware_log_message *msg)
void detach()
Definition: rs_internal.hpp:194
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:90
struct rs2_device rs2_device
Definition: rs_types.h:228
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:236
void add_option(rs2_option option, const option_range &range, bool is_writable=true)
Definition: rs_internal.hpp:175
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:467
Definition: rs_types.h:185
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:520
void set_destruction_callback(T callback) const
Definition: rs_internal.hpp:263
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:150
std::string file_name() const
Definition: rs_internal.hpp:389
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:76
const char * rs2_log_severity_to_string(rs2_log_severity info)
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:260
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:229
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:123
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:376
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:382
uint32_t get_timestamp() const
Definition: rs_internal.hpp:339
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