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

Allow physical port retrieval from recovery devices #8784

Merged
merged 2 commits into from
Apr 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 11 additions & 6 deletions src/fw-update/fw-update-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace librealsense
}

update_device::update_device(const std::shared_ptr<context>& ctx, bool register_device_notifications, std::shared_ptr<platform::usb_device> usb_device)
: _context(ctx), _usb_device(usb_device)
: _context(ctx), _usb_device(usb_device), _physical_port( usb_device->get_info().id )
{
if (auto messenger = _usb_device->open(FW_UPDATE_INTERFACE_NUMBER))
{
Expand Down Expand Up @@ -271,9 +271,10 @@ namespace librealsense
{
switch (info)
{
case RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID: return get_serial_number();
case RS2_CAMERA_INFO_NAME: return get_name();
case RS2_CAMERA_INFO_PRODUCT_LINE: return get_product_line();
case RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID: return get_serial_number();
case RS2_CAMERA_INFO_NAME: return get_name();
case RS2_CAMERA_INFO_PRODUCT_LINE: return get_product_line();
case RS2_CAMERA_INFO_PHYSICAL_PORT: return _physical_port;
default:
throw std::runtime_error("update_device does not support " + std::string(rs2_camera_info_to_string(info)));
}
Expand All @@ -285,8 +286,12 @@ namespace librealsense
{
case RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID:
case RS2_CAMERA_INFO_NAME:
case RS2_CAMERA_INFO_PRODUCT_LINE:return true;
default: return false;
case RS2_CAMERA_INFO_PRODUCT_LINE:
case RS2_CAMERA_INFO_PHYSICAL_PORT:
return true;

default:
return false;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/fw-update/fw-update-device.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ namespace librealsense
std::vector<uint8_t> _serial_number_buffer;
std::string _highest_fw_version;
std::string _last_fw_version;
std::string _physical_port;
bool _is_dfu_locked = false;
};
}