Repository navigation
add check for D500 device before HWMC - #14170
Conversation
|
|
||
| bool dds_model::check_DDS_support() | ||
| { | ||
| if (!_device.supports(RS2_CAMERA_INFO_PRODUCT_LINE) || !(std::string(_device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)) == "D500")) |
There was a problem hiding this comment.
- lets please check specifically D555 Camera name
- Maybe the readability with be more clear with something like:
if !(supports && D555)
return false
There was a problem hiding this comment.
Pull Request Overview
This PR adds a device validation check to the DDS (Distributed Data Service) model, specifically requiring D500 devices before proceeding with DDS support validation. The change ensures that DDS functionality is only enabled for compatible D500 hardware.
- Adds a device type check that validates the product line is "D500" before enabling DDS support
- Returns false early if the device doesn't support product line info or isn't a D500 model
| if (!_device.supports(RS2_CAMERA_INFO_PRODUCT_LINE) || !(std::string(_device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)) == "D500")) | ||
| return false; | ||
|
|
There was a problem hiding this comment.
Calling _device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE) without first checking if it's supported could throw an exception. The supports() check should be separated from the string comparison to avoid calling get_info() on an unsupported parameter.
| if (!_device.supports(RS2_CAMERA_INFO_PRODUCT_LINE) || !(std::string(_device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)) == "D500")) | |
| return false; | |
| if (!_device.supports(RS2_CAMERA_INFO_PRODUCT_LINE)) | |
| return false; | |
| if (std::string(_device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)) != "D500") | |
| return false; |
|
|
||
| bool dds_model::check_DDS_support() | ||
| { | ||
| if (!_device.supports(RS2_CAMERA_INFO_PRODUCT_LINE) || !(std::string(_device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)) == "D500")) |
There was a problem hiding this comment.
The magic string "D500" should be defined as a constant to improve maintainability and reduce the risk of typos in future changes.
| if (!_device.supports(RS2_CAMERA_INFO_PRODUCT_LINE) || !(std::string(_device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)) == "D500")) | |
| if (!_device.supports(RS2_CAMERA_INFO_PRODUCT_LINE) || !(std::string(_device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)) == rs2::PRODUCT_LINE_D500)) |
|
@Noy-Zini reminder |
40c227c to
2bcd33e
Compare
Tracked on: [RSDSO-20433]