Skip to content

Commit

Permalink
PR IntelRealSense#12567 from Eran: fix non-DDS settings initializatio…
Browse files Browse the repository at this point in the history
…n in rs-terminal and -enumerate-devices
  • Loading branch information
maloel authored Jan 11, 2024
2 parents c1ee96c + cf9cde9 commit 61601c6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
14 changes: 8 additions & 6 deletions tools/enumerate-devices/rs-enumerate-devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,16 @@ int main(int argc, char** argv) try
}

// Obtain a list of devices currently present on the system
json settings;
json settings = json::object();
#ifdef BUILD_WITH_DDS
json dds;
if( domain_arg.isSet() )
dds["domain"] = domain_arg.getValue();
if( only_sw_arg.isSet() )
if( domain_arg.isSet() || only_sw_arg.isSet() )
{
json dds = json::object();
if( domain_arg.isSet() )
dds["domain"] = domain_arg.getValue();
dds["enabled"]; // null: remove global dds:false or dds/enabled:false, if any
settings["dds"] = std::move( dds );
settings["dds"] = std::move( dds );
}
#endif
settings["format-conversion"] = format_arg.getValue();
context ctx( settings.dump() );
Expand Down
15 changes: 9 additions & 6 deletions tools/terminal/rs-terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using namespace std;
using namespace TCLAP;
using rsutils::json;


vector<uint8_t> build_raw_command_data(const command& command, const vector<string>& params)
Expand Down Expand Up @@ -197,14 +198,16 @@ int main(int argc, char** argv)
// parse command.xml
rs2::log_to_file(RS2_LOG_SEVERITY_WARN, "librealsense.log");

rsutils::json settings;
json settings = json::object();
#ifdef BUILD_WITH_DDS
rsutils::json dds;
if( domain_arg.isSet() )
dds["domain"] = domain_arg.getValue();
if( only_sw_arg.isSet() )
if( domain_arg.isSet() || only_sw_arg.isSet() )
{
json dds = json::object();
if( domain_arg.isSet() )
dds["domain"] = domain_arg.getValue();
dds["enabled"]; // null: remove global dds:false or dds/enabled:false, if any
settings["dds"] = std::move( dds );
settings["dds"] = std::move( dds );
}
#endif
if( only_sw_arg.getValue() )
settings["device-mask"] = RS2_PRODUCT_LINE_SW_ONLY | RS2_PRODUCT_LINE_ANY;
Expand Down

0 comments on commit 61601c6

Please sign in to comment.