Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fw logs with travis #6666

Merged
merged 44 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e21bdcc
fw_logger class started
May 5, 2020
783fd9a
API and example added - FW logs received without any filter and witho…
May 6, 2020
39326f0
FW logs parsed, using new line as delimiter
May 13, 2020
367cb72
Design change - fw logs returned to user as structure, even without p…
May 17, 2020
7ead7a1
FW logs parsing works
May 18, 2020
a599428
FW logs corrected to work with C API - remaining work for the parsing…
May 20, 2020
e3b6c97
API change - Getting logs one by one - parser not operable
May 25, 2020
f09c831
get_severity added, firmware_log_message struct improved
May 25, 2020
8e1e606
fw logs messages parsed one by one, API added for timestamp, line, se…
May 27, 2020
5c651e9
fw log message provided as input to get firmware logs
May 27, 2020
cc747b2
Flash logs work - work to do in fw logger device - see comment
May 31, 2020
dd69928
fw logs and flash logs implemented
May 31, 2020
2586328
Parser made member of fw_logger, need to solve case for parsing witho…
Jun 2, 2020
c2f47de
rs-fw-logger tool using new API
Jun 3, 2020
91e53b5
fw logs api functions moved to dedicated header files
Jun 3, 2020
0a69827
parse_log api change so that boolean value would be returned
Jun 3, 2020
c8bbb53
correct flash log example - to be deleted ater on
Jun 3, 2020
8588721
flash logs pulling coorected to be same as fw logs
Jun 9, 2020
a8b9b7f
fw logger extension added to the ds5 devices, opcode removed from ctor
Jun 15, 2020
0b14689
xml content sent to api instead of xml path
Jun 15, 2020
0a03822
modify fw-logger tool so that it could pull also flash logs
Jun 16, 2020
6fc4ee7
fw logs code corrections
Jun 17, 2020
08be3e7
pids map added to fw logger, sr300 missing
Jun 17, 2020
8f037b1
removing flash logs example as it is already in rs-fw-logger tool
Jun 17, 2020
45ef2ff
adding fw logs support for sr300
Jun 17, 2020
a8d11e8
removing not needed examples
Jun 17, 2020
939d364
removing not needed unit tests
Jun 17, 2020
cc9bfa7
api functions names got shorter - fw instead of firmware
Jun 17, 2020
8b858ba
fw-logger tool readme updated, fw_logger_device improved
Jun 17, 2020
7c835f7
new line added at end of files
Jun 17, 2020
fe906ba
tabs and typo corrections
Jun 18, 2020
f243dec
add fw and flash logs support for sr300
Jun 18, 2020
6228b58
tabs and log removed
Jun 18, 2020
b4bda5c
commands sent from each device ctor
Jun 18, 2020
76470ea
rs-fw-logger code correction
Jun 18, 2020
4d645d6
remove unnecessary includes
Jun 18, 2020
d32d694
moving api code of fw logs and terminal_parser to rs_internal
Jun 18, 2020
410e553
Resolve conflict with dev
ev-mp Jun 18, 2020
ac54c4e
correcting slash directions
Jun 18, 2020
ea05d7f
fix linux build
Jun 21, 2020
7b08009
tabs to spaces
Jun 22, 2020
408f2e1
correct stoi call for linux build
Jun 22, 2020
4281307
relax unit-tests criteria for specific pipeline cases
ev-mp Jun 22, 2020
5c27565
Temporal work-around for HW Monitor injection for SR300
ev-mp Jun 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ target_sources(${LRS_TARGET}
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_internal.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_pipeline.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_config.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/h/rs_terminal_parser.h"

"${CMAKE_CURRENT_LIST_DIR}/librealsense2/hpp/rs_types.hpp"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/hpp/rs_context.hpp"
Expand All @@ -30,7 +29,6 @@ target_sources(${LRS_TARGET}
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/hpp/rs_options.hpp"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/hpp/rs_internal.hpp"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/hpp/rs_pipeline.hpp"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/hpp/rs_terminal_parser.hpp"

"${CMAKE_CURRENT_LIST_DIR}/librealsense2/rsutil.h"
"${CMAKE_CURRENT_LIST_DIR}/librealsense2/rs_advanced_mode.h"
Expand Down
195 changes: 195 additions & 0 deletions include/librealsense2/h/rs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,201 @@ void rs2_software_sensor_add_option(rs2_sensor* sensor, rs2_option option, float
*/
void rs2_software_sensor_detach(rs2_sensor* sensor, rs2_error** error);


/**
* \brief Creates RealSense firmware log message.
* \param[in] dev Device from which the FW log will be taken using the created message
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return pointer to created empty firmware log message
*/
rs2_firmware_log_message* rs2_create_fw_log_message(rs2_device* dev, rs2_error** error);

/**
* \brief Gets RealSense firmware log.
* \param[in] dev Device from which the FW log should be taken
* \param[in] fw_log_msg Firmware log message object to be filled
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return true for success, false for failure - failure happens if no firmware log was sent by the hardware monitor
*/
int rs2_get_fw_log(rs2_device* dev, rs2_firmware_log_message** fw_log_msg, rs2_error** error);

/**
* \brief Gets RealSense flash log - this is a fw log that has been written in the device during the previous shutdown of the device
* \param[in] dev Device from which the FW log should be taken
* \param[in] fw_log_msg Firmware log message object to be filled
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return true for success, false for failure - failure happens if no firmware log was sent by the hardware monitor
*/
int rs2_get_flash_log(rs2_device* dev, rs2_firmware_log_message** fw_log_msg, rs2_error** error);

/**
* Delete RealSense firmware log message
* \param[in] device Realsense firmware log message to delete
*/
void rs2_delete_fw_log_message(rs2_firmware_log_message* msg);

/**
* \brief Gets RealSense firmware log message data.
* \param[in] msg firmware log message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return pointer to start of the firmware log message data
*/
const unsigned char* rs2_fw_log_message_data(rs2_firmware_log_message* msg, rs2_error** error);

/**
* \brief Gets RealSense firmware log message size.
* \param[in] msg firmware log message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return size of the firmware log message data
*/
int rs2_fw_log_message_size(rs2_firmware_log_message* msg, rs2_error** error);


/**
* \brief Gets RealSense firmware log message timestamp.
* \param[in] msg firmware log message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return timestamp of the firmware log message
*/
unsigned int rs2_fw_log_message_timestamp(rs2_firmware_log_message* msg, rs2_error** error);

/**
* \brief Gets RealSense firmware log message severity.
* \param[in] msg firmware log message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return severity of the firmware log message data
*/
rs2_log_severity rs2_fw_log_message_severity(const rs2_firmware_log_message* msg, rs2_error** error);

/**
* \brief Initializes RealSense firmware logs parser in device.
* \param[in] dev Device from which the FW log will be taken
* \param[in] xml_content content of the xml file needed for parsing
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return true for success, false for failure - failure happens if opening the xml from the xml_path input fails
*/
int rs2_init_fw_log_parser(rs2_device* dev, const char* xml_content, rs2_error** error);


/**
* \brief Creates RealSense firmware log parsed message.
* \param[in] dev Device from which the FW log will be taken using the created message
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return pointer to created empty firmware log message
*/
rs2_firmware_log_parsed_message* rs2_create_fw_log_parsed_message(rs2_device* dev, rs2_error** error);

/**
* \brief Deletes RealSense firmware log parsed message.
* \param[in] msg message to be deleted
*/
void rs2_delete_fw_log_parsed_message(rs2_firmware_log_parsed_message* fw_log_parsed_msg);


/**
* \brief Gets RealSense firmware log parser
* \param[in] dev Device from which the FW log will be taken
* \param[in] fw_log_msg firmware log message to be parsed
* \param[in] parsed_msg firmware log parsed message - place holder for the resulting parsed message
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return true for success, false for failure - failure happens if message could not be parsed
*/
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);

/**
* Delete RealSense firmware log parsed message
* \param[in] device Realsense firmware log parsed message to delete
*/
void rs2_delete_fw_log_parsed_message(rs2_firmware_log_parsed_message* fw_log_parsed_msg);

/**
* \brief Gets RealSense firmware log parsed message.
* \param[in] fw_log_parsed_msg firmware log parsed message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return message of the firmware log parsed message
*/
const char* rs2_get_fw_log_parsed_message(rs2_firmware_log_parsed_message* fw_log_parsed_msg, rs2_error** error);

/**
* \brief Gets RealSense firmware log parsed message file name.
* \param[in] fw_log_parsed_msg firmware log parsed message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return file name of the firmware log parsed message
*/
const char* rs2_get_fw_log_parsed_file_name(rs2_firmware_log_parsed_message* fw_log_parsed_msg, rs2_error** error);

/**
* \brief Gets RealSense firmware log parsed message thread name.
* \param[in] fw_log_parsed_msg firmware log parsed message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return thread name of the firmware log parsed message
*/
const char* rs2_get_fw_log_parsed_thread_name(rs2_firmware_log_parsed_message* fw_log_parsed_msg, rs2_error** error);

/**
* \brief Gets RealSense firmware log parsed message severity.
* \param[in] fw_log_parsed_msg firmware log parsed message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return severity of the firmware log parsed message
*/
rs2_log_severity rs2_get_fw_log_parsed_severity(rs2_firmware_log_parsed_message* fw_log_parsed_msg, rs2_error** error);

/**
* \brief Gets RealSense firmware log parsed message relevant line (in the file that is returned by rs2_get_fw_log_parsed_file_name).
* \param[in] fw_log_parsed_msg firmware log parsed message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return line number of the firmware log parsed message
*/
unsigned int rs2_get_fw_log_parsed_line(rs2_firmware_log_parsed_message* fw_log_parsed_msg, rs2_error** error);

/**
* \brief Gets RealSense firmware log parsed message timestamp
* \param[in] fw_log_parsed_msg firmware log parsed message object
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return timestamp of the firmware log parsed message
*/
unsigned int rs2_get_fw_log_parsed_timestamp(rs2_firmware_log_parsed_message* fw_log_parsed_msg, rs2_error** error);

/**
* \brief Creates RealSense terminal parser.
* \param[in] xml_content content of the xml file needed for parsing
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return pointer to created terminal parser object
*/
rs2_terminal_parser* rs2_create_terminal_parser(const char* xml_content, rs2_error** error);

/**
* \brief Deletes RealSense terminal parser.
* \param[in] terminal_parser terminal parser to be deleted
*/
void rs2_delete_terminal_parser(rs2_terminal_parser* terminal_parser);

/**
* \brief Parses terminal command via RealSense terminal parser
* \param[in] terminal_parser Terminal parser object
* \param[in] command command to be sent to the hw monitor of the device
* \param[in] size_of_command size of command to be sent to the hw monitor of the device
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return command to hw monitor, in hex
*/
rs2_raw_data_buffer* rs2_terminal_parse_command(rs2_terminal_parser* terminal_parser,
const char* command, unsigned int size_of_command, rs2_error** error);

/**
* \brief Parses terminal response via RealSense terminal parser
* \param[in] terminal_parser Terminal parser object
* \param[in] command command sent to the hw monitor of the device
* \param[in] size_of_command size of the command to sent to the hw monitor of the device
* \param[in] response response received by the hw monitor of the device
* \param[in] size_of_response size of the response received by the hw monitor of the device
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return answer parsed
*/
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);


#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 4 additions & 0 deletions include/librealsense2/h/rs_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ typedef enum rs2_extension
RS2_EXTENSION_FISHEYE_SENSOR,
RS2_EXTENSION_DEPTH_HUFFMAN_DECODER,
RS2_EXTENSION_SERIALIZABLE,
RS2_EXTENSION_FW_LOGGER,
RS2_EXTENSION_COUNT
} rs2_extension;
const char* rs2_extension_type_to_string(rs2_extension type);
Expand Down Expand Up @@ -244,6 +245,9 @@ typedef struct rs2_options_list rs2_options_list;
typedef struct rs2_devices_changed_callback rs2_devices_changed_callback;
typedef struct rs2_notification rs2_notification;
typedef struct rs2_notifications_callback rs2_notifications_callback;
typedef struct rs2_firmware_log_message rs2_firmware_log_message;
typedef struct rs2_firmware_log_parsed_message rs2_firmware_log_parsed_message;
typedef struct rs2_firmware_log_parser rs2_firmware_log_parser;
typedef struct rs2_terminal_parser rs2_terminal_parser;
typedef void (*rs2_log_callback_ptr)(rs2_log_severity, rs2_log_message const *, void * arg);
typedef void (*rs2_notification_callback_ptr)(rs2_notification*, void*);
Expand Down
2 changes: 1 addition & 1 deletion include/librealsense2/hpp/rs_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ namespace rs2

results.insert(results.begin(), start, start + size);

return results;
return results;
}

// Update an updatable device to the provided unsigned firmware. This call is executed on the caller's thread.
Expand Down
Loading