1 package com.intel.realsense.camera;
3 import android.util.Log;
14 private static final String TAG =
"librs_fwLogsThread";
23 mAreFwLogsRequested =
true;
26 if (
devices.getDeviceCount() > 0) {
31 mFwLoggerDevice = fwLoggerDevice;
32 if (mFwLogsParsingFilePath !=
"")
33 mIsParsingFileInitialized = mFwLoggerDevice.
initParser(mFwLogsParsingFilePath);
34 while (mAreFwLogsRequested) {
38 if (mIsParsingFileInitialized) {
40 logReceived = parsedMsg.getTimestamp() +
" - " +
41 parsedMsg.getSeverity() +
" " +
42 parsedMsg.getFileName() +
" " +
43 parsedMsg.getLine() +
" " +
44 parsedMsg.getThreadName() +
" " +
45 parsedMsg.getMessage();
46 Log.d(TAG, logReceived);
49 logReceived = logMsg.getTimestamp() +
" " +
50 logMsg.getSeverityStr() +
" ";
51 int logMsgSize = logMsg.getSize();
53 buffer = logMsg.getData(buffer);
54 for (
byte b : buffer) {
55 logReceived +=
String.format(
"%02X",
b) +
" ";
57 Log.d(TAG, logReceived);
72 mFwLogsParsingFilePath = fw_logging_file_path;
78 mAreFwLogsRequested =
false;
83 if(!mAllFlashLogsAlreadyPulled){
86 if (
devices.getDeviceCount() > 0) {
91 mFwLoggerDevice = fwLoggerDevice;
92 if (mFwLogsParsingFilePath !=
"")
93 mIsParsingFileInitialized = mFwLoggerDevice.
initParser(mFwLogsParsingFilePath);
94 Log.d(TAG,
"-------------------flash logs retrieval--------------------");
99 if (mIsParsingFileInitialized) {
101 logReceived = parsedMsg.getTimestamp() +
" - " +
102 parsedMsg.getSeverity() +
" " +
103 parsedMsg.getFileName() +
" " +
104 parsedMsg.getLine() +
" " +
105 parsedMsg.getThreadName() +
" " +
106 parsedMsg.getMessage();
107 Log.d(TAG, logReceived);
110 logReceived = logMsg.getTimestamp() +
" " +
111 logMsg.getSeverityStr() +
" ";
112 int logMsgSize = logMsg.getSize();
114 buffer = logMsg.getData(buffer);
115 for (
byte b : buffer) {
116 logReceived +=
String.format(
"%02X",
b) +
" ";
118 Log.d(TAG, logReceived);
122 Log.d(TAG,
"No more fw logs in flash");
123 mAllFlashLogsAlreadyPulled =
true;
128 Log.d(TAG,
"-------------------flash logs finished--------------------");
137 Log.d(TAG,
"Flash logs already pulled");
GLboolean GLboolean GLboolean b
::rosgraph_msgs::Log_< std::allocator< void > > Log
FwLogParsedMsg parseFwLog(FwLogMsg msg)
::std_msgs::String_< std::allocator< void > > String
String mFwLogsParsingFilePath
boolean mIsParsingFileInitialized
boolean initParser(String xml_path)
FwLogMsg getFwLogsFromFlash()
void getFwLogsFromFlash()
boolean mAllFlashLogsAlreadyPulled
boolean getFwLogPullingStatus()
void init(String fw_logging_file_path)
volatile boolean mAreFwLogsRequested