Skip to content

add check for D500 device before HWMC - #14170

Merged
Nir-Az merged 2 commits into
realsenseai:developmentfrom
Noy-Zini:fix-hwmc-0xBB-only-for-D555
Aug 17, 2025
Merged

Nir-Az merged 2 commits into
realsenseai:developmentfrom
Noy-Zini:fix-hwmc-0xBB-only-for-D555

Conversation

@Noy-Zini

Copy link
Copy Markdown
Contributor

Tracked on: [RSDSO-20433]

@Noy-Zini
Noy-Zini requested a review from Nir-Az July 28, 2025 13:55
Comment thread common/dds-model.cpp Outdated

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"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. lets please check specifically D555 Camera name
  2. Maybe the readability with be more clear with something like:
if !(supports && D555)
    return false

@Nir-Az
Nir-Az requested a review from Copilot July 29, 2025 12:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread common/dds-model.cpp Outdated
Comment on lines +107 to +113
if (!_device.supports(RS2_CAMERA_INFO_PRODUCT_LINE) || !(std::string(_device.get_info(RS2_CAMERA_INFO_PRODUCT_LINE)) == "D500"))
return false;

Copilot AI Jul 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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;

Copilot uses AI. Check for mistakes.
Comment thread common/dds-model.cpp Outdated

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"))

Copilot AI Jul 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic string "D500" should be defined as a constant to improve maintainability and reduce the risk of typos in future changes.

Suggested change
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))

Copilot uses AI. Check for mistakes.
@Nir-Az

Nir-Az commented Aug 10, 2025

Copy link
Copy Markdown
Collaborator

@Noy-Zini reminder

@Noy-Zini
Noy-Zini force-pushed the fix-hwmc-0xBB-only-for-D555 branch from 40c227c to 2bcd33e Compare August 17, 2025 07:14
@Noy-Zini
Noy-Zini requested a review from Nir-Az August 17, 2025 11:02
@Nir-Az Nir-Az closed this Aug 17, 2025
@Nir-Az Nir-Az reopened this Aug 17, 2025
@Nir-Az
Nir-Az merged commit 1fabccc into realsenseai:development Aug 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants