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

Eth misc #12346

Merged
merged 5 commits into from
Nov 2, 2023
Merged

Eth misc #12346

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
12 changes: 8 additions & 4 deletions common/metadata-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ namespace rs2

class windows_metadata_helper : public metadata_helper
{
using super = metadata_helper;

public:
static bool parse_device_id(const std::string& id, device_id* res)
{
Expand Down Expand Up @@ -239,11 +241,13 @@ namespace rs2

bool is_enabled(std::string id) const override
{
bool res = false;

device_id did;
if (parse_device_id(id, &did))
foreach_device_path({ did }, [&res, did](const device_id&, std::wstring path) {
if( ! parse_device_id( id, &did ) )
// If it's not parsed, it's not a valid USB device; return the default
return super::is_enabled( id );

bool res = false;
foreach_device_path({ did }, [&res, did](const device_id&, std::wstring path) {

HKEY key;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, path.c_str(), 0, KEY_READ | KEY_WOW64_64KEY, &key) == ERROR_SUCCESS)
Expand Down
2 changes: 1 addition & 1 deletion common/metadata-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace rs2

static bool can_support_metadata(const std::string& product)
{
return product == "D400";
return product == "D400" || product == "D500";
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have supported products that don't support metadata? Platform camera?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess that's the only one that's left...

}

// This is the command-line parameter that gets passed to another process (running as admin) in order to enable metadata -- see WinMain
Expand Down
3 changes: 2 additions & 1 deletion scripts/realsense_metadata_win10.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ $MultiPinDevices =
"USB\VID_8086&PID_0B5B&MI_00",# D405
"USB\VID_8086&PID_0B5C&MI_00",# D455
"USB\VID_8086&PID_0B64&MI_00",# L515
"USB\VID_8086&PID_0B68&MI_00" # L535
"USB\VID_8086&PID_0B68&MI_00",# L535
"USB\VID_8086&PID_0B56&MI_00" # D555e

#Inhibit system warnings and erros, such as permissions or missing values
$ErrorActionPreference = "silentlycontinue"
Expand Down
7 changes: 6 additions & 1 deletion third-party/realdds/src/dds-device-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,12 @@ void dds_device::impl::open( const dds_stream_profiles & profiles )
{ "stream-profiles", stream_profiles },
};

write_control_message( j );
nlohmann::json reply;
write_control_message( j, &reply );

if( rsutils::json::get( reply, status_key, status_ok ) != status_ok )
throw std::runtime_error( "failed to open stream: "
+ rsutils::json::get< std::string >( reply, explanation_key, "no explanation" ) );
}


Expand Down
5 changes: 5 additions & 0 deletions unit-tests/dds/metadata-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
color_stream.init_options( [] )
color_stream.set_intrinsics( d435i.color_stream_intrinsics() )

def on_control( server, id, control, reply ):
# the control has already been output to debug by the calling code, as will the reply
return True # otherwise the control will be flagged as error

device_server.on_control( on_control )
device_server.init( [color_stream], [], {} )


Expand Down
Loading