From 882a108e5ab405045bb92665ff295fd8d69e3e0a Mon Sep 17 00:00:00 2001 From: Remi Bettan Date: Tue, 17 Dec 2024 14:44:21 +0200 Subject: [PATCH 1/6] added values for gmsl and dds --- src/dds/rs-dds-device-proxy.cpp | 1 + src/ds/d400/d400-device.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/dds/rs-dds-device-proxy.cpp b/src/dds/rs-dds-device-proxy.cpp index bc01659712..cf4d7a60dc 100644 --- a/src/dds/rs-dds-device-proxy.cpp +++ b/src/dds/rs-dds-device-proxy.cpp @@ -170,6 +170,7 @@ dds_device_proxy::dds_device_proxy( std::shared_ptr< const device_info > const & if( j.nested( "product-line" ).get_ex( str ) ) register_info( RS2_CAMERA_INFO_PRODUCT_LINE, str ); register_info( RS2_CAMERA_INFO_CAMERA_LOCKED, j.nested( "locked" ).default_value( true ) ? "YES" : "NO" ); + register_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, "DDS" ); // Assumes dds_device initialization finished struct sensor_info diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index b390e9aac8..21f9a6ac62 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -965,6 +965,8 @@ namespace librealsense if (usb_modality) register_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, usb_type_str); + else + register_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, "GMSL"); std::string curr_version= _fw_version; From 2ce776c810c16cc81a03b36611c19f6068846407 Mon Sep 17 00:00:00 2001 From: Remi Bettan Date: Tue, 17 Dec 2024 15:15:06 +0200 Subject: [PATCH 2/6] API name added for connection type --- include/librealsense2/h/rs_sensor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/librealsense2/h/rs_sensor.h b/include/librealsense2/h/rs_sensor.h index e766eadb9a..0f65f032af 100644 --- a/include/librealsense2/h/rs_sensor.h +++ b/include/librealsense2/h/rs_sensor.h @@ -30,6 +30,7 @@ typedef enum rs2_camera_info { RS2_CAMERA_INFO_PRODUCT_ID , /**< Product ID as reported in the USB descriptor */ RS2_CAMERA_INFO_CAMERA_LOCKED , /**< True iff EEPROM is locked */ RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR , /**< Designated USB specification: USB2/USB3 */ + RS2_CAMERA_INFO_CONNECTION_TYPE = RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, /**< Other name for the USB connection type, adapted for non-usb connections */ RS2_CAMERA_INFO_PRODUCT_LINE , /**< Device product line D400, etc. */ RS2_CAMERA_INFO_ASIC_SERIAL_NUMBER , /**< ASIC serial number */ RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID , /**< Firmware update ID */ From f760a09727edb7bab491e28d17b7bf87c25496c9 Mon Sep 17 00:00:00 2001 From: Remi Bettan Date: Tue, 31 Dec 2024 14:30:50 +0200 Subject: [PATCH 3/6] cr --- src/dds/rs-dds-device-proxy.cpp | 2 +- src/ds/d400/d400-device.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dds/rs-dds-device-proxy.cpp b/src/dds/rs-dds-device-proxy.cpp index cf4d7a60dc..89a1bbe805 100644 --- a/src/dds/rs-dds-device-proxy.cpp +++ b/src/dds/rs-dds-device-proxy.cpp @@ -170,7 +170,7 @@ dds_device_proxy::dds_device_proxy( std::shared_ptr< const device_info > const & if( j.nested( "product-line" ).get_ex( str ) ) register_info( RS2_CAMERA_INFO_PRODUCT_LINE, str ); register_info( RS2_CAMERA_INFO_CAMERA_LOCKED, j.nested( "locked" ).default_value( true ) ? "YES" : "NO" ); - register_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, "DDS" ); + register_info(RS2_CAMERA_INFO_CONNECTION_TYPE, "DDS" ); // Assumes dds_device initialization finished struct sensor_info diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index 21f9a6ac62..b3a9a12918 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -966,7 +966,7 @@ namespace librealsense if (usb_modality) register_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, usb_type_str); else - register_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, "GMSL"); + register_info(RS2_CAMERA_INFO_CONNECTION_TYPE, "GMSL"); std::string curr_version= _fw_version; From 9519590680416681ab279cbbb05677b2cea10d23 Mon Sep 17 00:00:00 2001 From: Remi Bettan Date: Wed, 1 Jan 2025 11:37:54 +0200 Subject: [PATCH 4/6] connection type added to camera info API --- common/device-model.cpp | 49 +++++++++------------ include/librealsense2/h/rs_sensor.h | 2 +- include/librealsense2/hpp/rs_device.hpp | 13 +----- src/ds/d400/d400-device.cpp | 3 ++ src/ds/d500/d500-device.cpp | 3 ++ src/platform-camera.cpp | 1 + src/to-string.cpp | 1 + tools/data-collect/rs-data-collect.cpp | 10 ++++- tools/depth-quality/depth-quality-model.cpp | 14 ++++-- tools/fw-update/rs-fw-update.cpp | 17 ++++--- tools/realsense-viewer/realsense-viewer.cpp | 13 ++---- wrappers/python/pyrs_device.cpp | 12 ++++- 12 files changed, 71 insertions(+), 67 deletions(-) diff --git a/common/device-model.cpp b/common/device-model.cpp index f06677a7f4..115e955d99 100644 --- a/common/device-model.cpp +++ b/common/device-model.cpp @@ -2246,42 +2246,33 @@ namespace rs2 else { ImGui::Text(" %s", ss.str().c_str()); - - if (dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) - { - std::string desc = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR); - ss.str(""); - ss << " " << textual_icons::usb_type << " " << desc; - ImGui::SameLine(); - if (!starts_with(desc, "3.")) ImGui::PushStyleColor(ImGuiCol_Text, yellow); - else ImGui::PushStyleColor(ImGuiCol_Text, light_grey); - ImGui::Text(" %s", ss.str().c_str()); - ImGui::PopStyleColor(); - ss.str(""); - ss << "The camera was detected by the OS as connected to a USB " << desc << " port"; - ImGui::PushFont(window.get_font()); - ImGui::PushStyleColor(ImGuiCol_Text, light_grey); - if (ImGui::IsItemHovered()) - ImGui::SetTooltip(" %s", ss.str().c_str()); - ImGui::PopStyleColor(); - ImGui::PopFont(); - } - else if(dev.supports(RS2_CAMERA_INFO_PRODUCT_ID)) + if (dev.supports(RS2_CAMERA_INFO_CONNECTION_TYPE)) { - std::string device_pid = dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID); - if(device_pid == "ABCD")// Specific for D457 + auto connection_type = dev.get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); + + if (connection_type == std::string("USB") && dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) { - ss.str( "" ); - ss << " " << "GMSL"; + std::string desc = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR); + ss.str(""); + ss << " " << textual_icons::usb_type << " " << desc; ImGui::SameLine(); - ImGui::PushStyleColor(ImGuiCol_Text, white); + if (!starts_with(desc, "3.")) ImGui::PushStyleColor(ImGuiCol_Text, yellow); + else ImGui::PushStyleColor(ImGuiCol_Text, light_grey); ImGui::Text(" %s", ss.str().c_str()); ImGui::PopStyleColor(); + ss.str(""); + ss << "The camera was detected by the OS as connected to a USB " << desc << " port"; + ImGui::PushFont(window.get_font()); + ImGui::PushStyleColor(ImGuiCol_Text, light_grey); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip(" %s", ss.str().c_str()); + ImGui::PopStyleColor(); + ImGui::PopFont(); } - else if(device_pid == "DDS") + else { - ss.str( "" ); - ss << " " << "DDS"; + ss.str(""); + ss << " " << connection_type; ImGui::SameLine(); ImGui::PushStyleColor(ImGuiCol_Text, white); ImGui::Text(" %s", ss.str().c_str()); diff --git a/include/librealsense2/h/rs_sensor.h b/include/librealsense2/h/rs_sensor.h index 0f65f032af..30f54ea1ef 100644 --- a/include/librealsense2/h/rs_sensor.h +++ b/include/librealsense2/h/rs_sensor.h @@ -30,12 +30,12 @@ typedef enum rs2_camera_info { RS2_CAMERA_INFO_PRODUCT_ID , /**< Product ID as reported in the USB descriptor */ RS2_CAMERA_INFO_CAMERA_LOCKED , /**< True iff EEPROM is locked */ RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR , /**< Designated USB specification: USB2/USB3 */ - RS2_CAMERA_INFO_CONNECTION_TYPE = RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, /**< Other name for the USB connection type, adapted for non-usb connections */ RS2_CAMERA_INFO_PRODUCT_LINE , /**< Device product line D400, etc. */ RS2_CAMERA_INFO_ASIC_SERIAL_NUMBER , /**< ASIC serial number */ RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID , /**< Firmware update ID */ RS2_CAMERA_INFO_IP_ADDRESS , /**< IP address for remote camera. */ RS2_CAMERA_INFO_DFU_DEVICE_PATH , /**< DFU Device node path */ + RS2_CAMERA_INFO_CONNECTION_TYPE , /**< Connection type, for example USB, GMSL, DDS */ RS2_CAMERA_INFO_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */ } rs2_camera_info; const char* rs2_camera_info_to_string(rs2_camera_info info); diff --git a/include/librealsense2/hpp/rs_device.hpp b/include/librealsense2/hpp/rs_device.hpp index bc7af22454..f0a7d97721 100644 --- a/include/librealsense2/hpp/rs_device.hpp +++ b/include/librealsense2/hpp/rs_device.hpp @@ -54,17 +54,8 @@ namespace rs2 */ std::string get_type() const { - if( supports( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ) ) - return "USB"; - if( supports( RS2_CAMERA_INFO_PRODUCT_ID ) ) - { - std::string pid = get_info( RS2_CAMERA_INFO_PRODUCT_ID ); - if( pid == "ABCD" ) // Specific for D457 - return "GMSL"; - if( pid == "BBCD" ) // Specific for D457 Recovery DFU - return "GMSL"; - return pid; // for DDS devices, this will be "DDS" - } + if( supports( RS2_CAMERA_INFO_CONNECTION_TYPE ) ) + return get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); return {}; } diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index b3a9a12918..853cce9a09 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -964,7 +964,10 @@ namespace librealsense register_info(RS2_CAMERA_INFO_DFU_DEVICE_PATH, group.uvc_devices.front().dfu_device_path); if (usb_modality) + { + register_info(RS2_CAMERA_INFO_CONNECTION_TYPE, "USB"); register_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, usb_type_str); + } else register_info(RS2_CAMERA_INFO_CONNECTION_TYPE, "GMSL"); diff --git a/src/ds/d500/d500-device.cpp b/src/ds/d500/d500-device.cpp index e33c9b144c..ba79e6b91c 100644 --- a/src/ds/d500/d500-device.cpp +++ b/src/ds/d500/d500-device.cpp @@ -700,7 +700,10 @@ namespace librealsense register_info(RS2_CAMERA_INFO_CAMERA_LOCKED, _is_locked ? "YES" : "NO"); if (usb_modality) + { + register_info(RS2_CAMERA_INFO_CONNECTION_TYPE, "USB"); register_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, usb_type_str); + } register_features(); diff --git a/src/platform-camera.cpp b/src/platform-camera.cpp index e53ffb7cdf..d67410d759 100644 --- a/src/platform-camera.cpp +++ b/src/platform-camera.cpp @@ -97,6 +97,7 @@ platform_camera::platform_camera( std::shared_ptr< const device_info > const & d if( usb_spec_names.count( usb_mode ) && ( usb_undefined != usb_mode ) ) usb_type_str = usb_spec_names.at( usb_mode ); + register_info(RS2_CAMERA_INFO_CONNECTION_TYPE, "USB"); register_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR, usb_type_str ); register_info( RS2_CAMERA_INFO_SERIAL_NUMBER, uvc_infos.front().unique_id ); register_info( RS2_CAMERA_INFO_PHYSICAL_PORT, uvc_infos.front().device_path ); diff --git a/src/to-string.cpp b/src/to-string.cpp index 7bc1d95bf4..17a659b32b 100644 --- a/src/to-string.cpp +++ b/src/to-string.cpp @@ -591,6 +591,7 @@ const char * get_string( rs2_camera_info value ) CASE( FIRMWARE_UPDATE_ID ) CASE( IP_ADDRESS ) CASE( DFU_DEVICE_PATH ) + CASE( CONNECTION_TYPE ) default: assert( ! is_valid( value ) ); return UNKNOWN_VALUE; diff --git a/tools/data-collect/rs-data-collect.cpp b/tools/data-collect/rs-data-collect.cpp index fe892e709f..08686b2269 100644 --- a/tools/data-collect/rs-data-collect.cpp +++ b/tools/data-collect/rs-data-collect.cpp @@ -82,9 +82,15 @@ void data_collector::parse_and_configure(cli::value& config_file) configure_sensors(); // Report results + std::string connection_type = _dev->supports(RS2_CAMERA_INFO_CONNECTION_TYPE) ? + std::string(_dev->get_info(RS2_CAMERA_INFO_CONNECTION_TYPE)) : std::string(" "); + if (connection_type == "USB" && _dev->supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) + { + connection_type += " Type: "; + connection_type += _dev->get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR); + } std::cout << "\nDevice selected: \n\t" << _dev->get_info(RS2_CAMERA_INFO_NAME) - << (_dev->supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR) ? - std::string((stringify() << ". USB Type: " << _dev->get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR))) : "") + << ". " << connection_type << " " << "\n\tS.N: " << (_dev->supports(RS2_CAMERA_INFO_SERIAL_NUMBER) ? _dev->get_info(RS2_CAMERA_INFO_SERIAL_NUMBER) : "") << "\n\tFW Ver: " << _dev->get_info(RS2_CAMERA_INFO_FIRMWARE_VERSION) << "\n\nUser streams requested: " << user_requests.size() diff --git a/tools/depth-quality/depth-quality-model.cpp b/tools/depth-quality/depth-quality-model.cpp index b969f2cfb9..fb37b79f4d 100644 --- a/tools/depth-quality/depth-quality-model.cpp +++ b/tools/depth-quality/depth-quality-model.cpp @@ -47,20 +47,26 @@ namespace rs2 // Adjust settings according to USB type bool usb3_device = true; + bool usb_device = false; auto devices = _ctx.query_devices(); if (devices.size()) { auto dev = devices[0]; - if (dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) + if (dev.supports(RS2_CAMERA_INFO_CONNECTION_TYPE)) { - std::string usb_type = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR); - usb3_device = !(std::string::npos != usb_type.find("2.")); + auto connection_type = dev.get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); + if (connection_type == std::string("USB") && dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) + { + usb_device = true; + std::string usb_type = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR); + usb3_device = !(std::string::npos != usb_type.find("2.")); + } } } else return valid_config; - int requested_fps = usb3_device ? 30 : 15; + int requested_fps = (usb3_device || !usb_device) ? 30 : 15; // open Depth and Infrared streams using default profile { diff --git a/tools/fw-update/rs-fw-update.cpp b/tools/fw-update/rs-fw-update.cpp index b7dce0a1a0..d099b1737c 100644 --- a/tools/fw-update/rs-fw-update.cpp +++ b/tools/fw-update/rs-fw-update.cpp @@ -192,15 +192,14 @@ int write_fw_to_mipi_device( const rs2::device & dev, const std::vector< uint8_t bool is_mipi_device( const rs2::device & dev ) { - std::string usb_type = "unknown"; - - if( dev.supports( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ) ) - usb_type = dev.get_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ); - - bool d457_device = strcmp( dev.get_info( RS2_CAMERA_INFO_PRODUCT_ID ), "ABCD" ) == 0; - - // Currently only D457 model has MIPI connection - return d457_device && usb_type.compare( "unknown" ) == 0; + bool is_mipi_device = false; + if (dev.supports(RS2_CAMERA_INFO_CONNECTION_TYPE)) + { + auto connection_type = dev.get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); + if (connection_type == "GMSL") + is_mipi_device = true; + } + return is_mipi_device; } int main( int argc, char ** argv ) diff --git a/tools/realsense-viewer/realsense-viewer.cpp b/tools/realsense-viewer/realsense-viewer.cpp index 1bc1a9eac1..3a1df5b05c 100644 --- a/tools/realsense-viewer/realsense-viewer.cpp +++ b/tools/realsense-viewer/realsense-viewer.cpp @@ -469,16 +469,11 @@ int main(int argc, const char** argv) try auto dev = connected_devs[i]; std::string dev_type; - if( dev.supports( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ) ) + if (dev.supports(RS2_CAMERA_INFO_CONNECTION_TYPE)) { - dev_type = "USB"; - dev_type += dev.get_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ); - } - else if( dev.supports( RS2_CAMERA_INFO_PRODUCT_ID ) ) - { - dev_type = dev.get_info( RS2_CAMERA_INFO_PRODUCT_ID ); - if( dev_type == "ABCD" ) // Specific for D457 - dev_type = "GMSL"; + dev_type = dev.get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); + if (dev_type == "USB") + dev_type += dev.get_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ); } std::string line = rsutils::string::from() << dev.get_info( RS2_CAMERA_INFO_NAME ) << " (" << dev_type diff --git a/wrappers/python/pyrs_device.cpp b/wrappers/python/pyrs_device.cpp index 447d2e94a3..789e5c8935 100644 --- a/wrappers/python/pyrs_device.cpp +++ b/wrappers/python/pyrs_device.cpp @@ -54,8 +54,16 @@ void init_device(py::module &m) { if( self.supports( RS2_CAMERA_INFO_CAMERA_LOCKED ) && strcmp( "YES", self.get_info( RS2_CAMERA_INFO_CAMERA_LOCKED ) ) ) ss << " UNLOCKED"; - if( self.supports( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ) ) - ss << " on USB" << self.get_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ); + if (self.supports(RS2_CAMERA_INFO_CONNECTION_TYPE)) + { + auto connection_type = self.get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); + ss << " on "; + ss << connection_type; + if (connection_type == "USB") + if (self.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) + ss << self.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR); + } + else if( self.supports( RS2_CAMERA_INFO_PHYSICAL_PORT ) ) ss << " @ " << self.get_info( RS2_CAMERA_INFO_PHYSICAL_PORT ); ss << ")>"; From 0d713ce7aa9a1c97b33ee292b8b39227cc85897a Mon Sep 17 00:00:00 2001 From: Remi Bettan Date: Wed, 1 Jan 2025 14:30:23 +0200 Subject: [PATCH 5/6] cr --- common/device-model.cpp | 1 - tools/realsense-viewer/realsense-viewer.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/device-model.cpp b/common/device-model.cpp index 115e955d99..a9b04a1bef 100644 --- a/common/device-model.cpp +++ b/common/device-model.cpp @@ -2249,7 +2249,6 @@ namespace rs2 if (dev.supports(RS2_CAMERA_INFO_CONNECTION_TYPE)) { auto connection_type = dev.get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); - if (connection_type == std::string("USB") && dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) { std::string desc = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR); diff --git a/tools/realsense-viewer/realsense-viewer.cpp b/tools/realsense-viewer/realsense-viewer.cpp index 3a1df5b05c..57347bc1e6 100644 --- a/tools/realsense-viewer/realsense-viewer.cpp +++ b/tools/realsense-viewer/realsense-viewer.cpp @@ -472,7 +472,7 @@ int main(int argc, const char** argv) try if (dev.supports(RS2_CAMERA_INFO_CONNECTION_TYPE)) { dev_type = dev.get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); - if (dev_type == "USB") + if (dev_type == "USB" && dev.supports( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR )) dev_type += dev.get_info( RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR ); } From 5714a40e2c20c5e298983b4944233575c9becc3f Mon Sep 17 00:00:00 2001 From: Remi Bettan Date: Wed, 1 Jan 2025 15:26:35 +0200 Subject: [PATCH 6/6] cr --- tools/depth-quality/depth-quality-model.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/depth-quality/depth-quality-model.cpp b/tools/depth-quality/depth-quality-model.cpp index fb37b79f4d..5eeadad23f 100644 --- a/tools/depth-quality/depth-quality-model.cpp +++ b/tools/depth-quality/depth-quality-model.cpp @@ -46,8 +46,7 @@ namespace rs2 rs2::pipeline_profile active_profile; // Adjust settings according to USB type - bool usb3_device = true; - bool usb_device = false; + bool usb2_device = false; auto devices = _ctx.query_devices(); if (devices.size()) { @@ -57,16 +56,15 @@ namespace rs2 auto connection_type = dev.get_info(RS2_CAMERA_INFO_CONNECTION_TYPE); if (connection_type == std::string("USB") && dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) { - usb_device = true; std::string usb_type = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR); - usb3_device = !(std::string::npos != usb_type.find("2.")); + usb2_device = (std::string::npos != usb_type.find("2.")); } } } else return valid_config; - int requested_fps = (usb3_device || !usb_device) ? 30 : 15; + int requested_fps = usb2_device ? 15 : 30; // open Depth and Infrared streams using default profile {