Skip to content

Commit

Permalink
fix PR comments - added pid to the error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomer Ashuach committed Aug 29, 2021
1 parent d7b91d2 commit fe7cbc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/ds5/ds5-fw-update-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ namespace librealsense
bool ds_update_device::check_fw_compatibility(const std::vector<uint8_t>& image) const
{
std::string fw_version = extract_firmware_version_string((const void*)image.data(), image.size());

auto device_pid = _usb_device->get_info().pid;
auto it = ds::device_to_fw_min_version.find(_usb_device->get_info().pid);
if (it == ds::device_to_fw_min_version.end())
throw std::runtime_error("Minimum firmware version has not been defined for this device!");
throw std::runtime_error(to_string() << "Min and Max firmware versions have not been defined for this device: " << device_pid);

return (firmware_version(fw_version) >= firmware_version(it->second));
}
Expand Down
6 changes: 3 additions & 3 deletions src/ivcam/sr300-fw-update-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ namespace librealsense
bool sr300_update_device::check_fw_compatibility(const std::vector<uint8_t>& image) const
{
std::string fw_version = extract_firmware_version_string((const void*)image.data(), image.size());

auto min_max_fw_it = device_to_fw_min_max_version.find(_usb_device->get_info().pid);
auto device_pid = _usb_device->get_info().pid;
auto min_max_fw_it = device_to_fw_min_max_version.find(device_pid);
if (min_max_fw_it == device_to_fw_min_max_version.end())
throw std::runtime_error("Min and Max firmware versions have not been defined for this device!");
throw std::runtime_error(to_string() << "Min and Max firmware versions have not been defined for this device: " << device_pid);

// advanced SR3XX devices do not fit the "old" fw versions and
// legacy SR3XX devices do not fit the "new" fw versions
Expand Down
4 changes: 2 additions & 2 deletions src/l500/l500-fw-update-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ namespace librealsense
bool l500_update_device::check_fw_compatibility(const std::vector<uint8_t>& image) const
{
std::string fw_version = extract_firmware_version_string((const void*)image.data(), image.size());

auto device_pid = _usb_device->get_info().pid;
auto min_max_fw_it = ivcam2::device_to_fw_min_max_version.find(_usb_device->get_info().pid);
if (min_max_fw_it == ivcam2::device_to_fw_min_max_version.end())
throw std::runtime_error("Min and Max firmware versions have not been defined for this device!");
throw std::runtime_error(to_string() << "Min and Max firmware versions have not been defined for this device: " << device_pid);

// Limit L515 to FW versions within the 1.5.1.3-1.99.99.99 range to differenciate from the other products
return (firmware_version(fw_version) >= firmware_version(min_max_fw_it->second.first)) &&
Expand Down

0 comments on commit fe7cbc3

Please sign in to comment.