Skip to content

Commit

Permalink
fix bug in fw logs api - wrong use of ptr to ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
remibettan committed Jul 5, 2020
1 parent fdf89fd commit 3abe221
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/librealsense2/h/rs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ rs2_firmware_log_message* rs2_create_fw_log_message(rs2_device* dev, rs2_error**
* \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);
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
Expand All @@ -372,7 +372,7 @@ int rs2_get_fw_log(rs2_device* dev, rs2_firmware_log_message** fw_log_msg, rs2_e
* \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);
int rs2_get_flash_log(rs2_device* dev, rs2_firmware_log_message* fw_log_msg, rs2_error** error);

/**
* Delete RealSense firmware log message
Expand Down
4 changes: 2 additions & 2 deletions include/librealsense2/hpp/rs_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ namespace rs2
rs2_error* e = nullptr;
rs2_firmware_log_message* m = msg.get_message().get();
bool fw_log_pulling_status =
rs2_get_fw_log(_dev.get(), &(m), &e);
rs2_get_fw_log(_dev.get(), m, &e);

error::handle(e);

Expand All @@ -524,7 +524,7 @@ namespace rs2
rs2_error* e = nullptr;
rs2_firmware_log_message* m = msg.get_message().get();
bool flash_log_pulling_status =
rs2_get_flash_log(_dev.get(), &(m), &e);
rs2_get_flash_log(_dev.get(), m, &e);

error::handle(e);

Expand Down
8 changes: 4 additions & 4 deletions src/rs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3119,7 +3119,7 @@ rs2_firmware_log_message* rs2_create_fw_log_message(rs2_device* dev, rs2_error**
}
HANDLE_EXCEPTIONS_AND_RETURN(nullptr, dev)

int rs2_get_fw_log(rs2_device* dev, rs2_firmware_log_message** fw_log_msg, rs2_error** error) BEGIN_API_CALL
int rs2_get_fw_log(rs2_device* dev, rs2_firmware_log_message* fw_log_msg, rs2_error** error) BEGIN_API_CALL
{
VALIDATE_NOT_NULL(dev);
VALIDATE_NOT_NULL(fw_log_msg);
Expand All @@ -3129,13 +3129,13 @@ int rs2_get_fw_log(rs2_device* dev, rs2_firmware_log_message** fw_log_msg, rs2_e
bool result = fw_loggerable->get_fw_log(binary_data);
if (result)
{
(*(*fw_log_msg)->firmware_log_binary_data.get()) = binary_data;
*(fw_log_msg->firmware_log_binary_data).get() = binary_data;
}
return result? 1 : 0;
}
HANDLE_EXCEPTIONS_AND_RETURN(0, dev, fw_log_msg)

int rs2_get_flash_log(rs2_device* dev, rs2_firmware_log_message** fw_log_msg, rs2_error** error)BEGIN_API_CALL
int rs2_get_flash_log(rs2_device* dev, rs2_firmware_log_message* fw_log_msg, rs2_error** error)BEGIN_API_CALL
{
VALIDATE_NOT_NULL(dev);
VALIDATE_NOT_NULL(fw_log_msg);
Expand All @@ -3145,7 +3145,7 @@ int rs2_get_flash_log(rs2_device* dev, rs2_firmware_log_message** fw_log_msg, rs
bool result = fw_loggerable->get_flash_log(binary_data);
if (result)
{
(*(*fw_log_msg)->firmware_log_binary_data.get()) = binary_data;
*(fw_log_msg->firmware_log_binary_data).get() = binary_data;
}
return result ? 1 : 0;
}
Expand Down

0 comments on commit 3abe221

Please sign in to comment.