-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Api connection type #13612
Api connection type #13612
Changes from 4 commits
882a108
2ce776c
f760a09
9519590
0d713ce
5714a40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -964,7 +964,12 @@ 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"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this list D457 Recovery DFU PID as GMSL as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The behavior for D457 Recovery DFU PID will not be changed. |
||
|
||
std::string curr_version= _fw_version; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,20 +47,26 @@ namespace rs2 | |
|
||
// Adjust settings according to USB type | ||
bool usb3_device = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exception use case is usb2. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "As I understand it, DDS/GMSL/USB3 should set 30 right?" this is the current code meaning - I assumed it is right There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current code works, but I think the logic is more complicated than needed. |
||
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 | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. && support...? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation looks off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok