6 #include <android/log.h> 12 #include "../../../tools/fw-logger/fw-logs-parser.h" 13 #include "../../../include/librealsense2/hpp/rs_context.hpp" 15 #define TAG "rs_fw_log" 19 __android_log_print(ANDROID_LOG_INFO,
TAG,
"%s", message.c_str());
28 res +=
"0123456789ABCDEF"[n % 16];
32 std::reverse(res.begin(), res.end());
46 std::unique_ptr<fw_logger::fw_logs_parser> fw_log_parser;
47 auto use_xml_file =
false;
69 std::vector<uint8_t>
input;
72 input = {0x14, 0x00, 0xab, 0xcd, op_code, 0x00, 0x00, 0x00,
73 0xf4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
74 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
76 std::stringstream dev_info;
82 std::this_thread::sleep_for(std::chrono::milliseconds(
_sample_rate));
85 std::vector<std::string> fw_log_lines = {
""};
86 if (raw_data.size() <= 4)
93 fw_log_lines = fw_log_parser->get_fw_log_lines(fw_logs_binary_data);
97 std::stringstream sstr;
98 sstr <<
"FW_Log_Data:";
99 for (
size_t i = 0;
i < raw_data.size(); ++
i)
100 sstr <<
hexify(raw_data[
i]) <<
" ";
102 fw_log_lines.push_back(sstr.str());
105 for (
auto&
line : fw_log_lines)
112 std::stringstream
cerr;
122 log(
"StartReadingFwLogs");
128 log(
"StopReadingFwLogs");
GLenum GLuint GLenum GLsizei const GLchar * message
device_list query_devices() const
android_fw_logger(std::string xml_path="", int sample_rate=100)
GLsizei const GLchar *const * string
const std::string & get_failed_args() const
std::string hexify(unsigned char n)
GLenum GLenum GLenum input
void log(std::string message)
std::vector< uint8_t > logs_buffer
int stoi(const std::string &value)
const std::string & get_failed_function() const