Skip to content

Conversation

@maloel
Copy link
Contributor

@maloel maloel commented Jan 11, 2024

It's really hard to see, but when we pass in settings to the context they must be either empty or an object. But json initializes to null and librealsense correctly throws.

This fixes two use-cases which were missed before, in rs-terminal and rs-enumerate-devices -- especially outside of DDS mode which usually force an object.

Tracked on [HSD-15015096962]

@maloel maloel requested a review from OhadMeir January 11, 2024 12:25

// Obtain a list of devices currently present on the system
json settings;
json settings = json::object();
Copy link
Contributor

@OhadMeir OhadMeir Jan 11, 2024

Choose a reason for hiding this comment

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

Should we update all occurrences of json j; to json j = json::object() or is it relevant only to the settings usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Relevant only to the settings

@OhadMeir
Copy link
Contributor

"It's really hard to see ..."

Can we test it here? Prevent further cases of null json

@maloel
Copy link
Contributor Author

maloel commented Jan 11, 2024

Can we test it here? Prevent further cases of null json

No, I think it's a valid complaint that the settings should make sense -- and sending null is not valid...

@maloel maloel merged commit 61601c6 into IntelRealSense:development Jan 11, 2024
@maloel maloel deleted the settings branch January 11, 2024 12:48
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.

2 participants