firmware_logger_device.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "core/extension.h"
7 #include "device.h"
8 #include <vector>
9 #include "fw-logs/fw-log-data.h"
10 #include "fw-logs/fw-logs-parser.h"
11 
12 namespace librealsense
13 {
15  {
16  public:
17  virtual bool get_fw_log(fw_logs::fw_logs_binary_data& binary_data) = 0;
18  virtual bool get_flash_log(fw_logs::fw_logs_binary_data& binary_data) = 0;
19  virtual unsigned int get_number_of_fw_logs() const = 0;
20  virtual bool init_parser(std::string xml_content) = 0;
21  virtual bool parse_log(const fw_logs::fw_logs_binary_data* fw_log_msg, fw_logs::fw_log_data* parsed_msg) = 0;
22  virtual ~firmware_logger_extensions() = default;
23  };
25 
27  {
28  public:
29  firmware_logger_device(std::shared_ptr<context> ctx, const platform::backend_device_group group,
30  std::shared_ptr<hw_monitor> hardware_monitor,
31  const command& fw_logs_command, const command& flash_logs_command);
32 
33  bool get_fw_log(fw_logs::fw_logs_binary_data& binary_data) override;
34  bool get_flash_log(fw_logs::fw_logs_binary_data& binary_data) override;
35 
36  unsigned int get_number_of_fw_logs() const override;
37 
38  bool init_parser(std::string xml_content) override;
39  bool parse_log(const fw_logs::fw_logs_binary_data* fw_log_msg, fw_logs::fw_log_data* parsed_msg) override;
40 
41  // Temporal solution for HW_Monitor injection
42  void assign_hw_monitor(std::shared_ptr<hw_monitor> hardware_monitor)
43  { _hw_monitor = hardware_monitor; }
44 
45  private:
46 
47  void get_fw_logs_from_hw_monitor();
48  void get_flash_logs_from_hw_monitor();
49 
52 
53  std::shared_ptr<hw_monitor> _hw_monitor;
54 
55  std::queue<fw_logs::fw_logs_binary_data> _fw_logs;
56  std::queue<fw_logs::fw_logs_binary_data> _flash_logs;
57 
59 
62 
63  };
64 
65 }
virtual bool parse_log(const fw_logs::fw_logs_binary_data *fw_log_msg, fw_logs::fw_log_data *parsed_msg)=0
void assign_hw_monitor(std::shared_ptr< hw_monitor > hardware_monitor)
virtual bool get_flash_log(fw_logs::fw_logs_binary_data &binary_data)=0
std::queue< fw_logs::fw_logs_binary_data > _flash_logs
virtual bool get_fw_log(fw_logs::fw_logs_binary_data &binary_data)=0
unsigned short uint16_t
Definition: stdint.h:79
GLsizei const GLchar *const * string
GLboolean GLuint group
Definition: glext.h:5688
std::shared_ptr< hw_monitor > _hw_monitor
virtual bool init_parser(std::string xml_content)=0
std::queue< fw_logs::fw_logs_binary_data > _fw_logs
MAP_EXTENSION(RS2_EXTENSION_POINTS, librealsense::points)
virtual unsigned int get_number_of_fw_logs() const =0


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:14