From 4640f37f385cf10a1f675b3e0a995fe57ecc5d34 Mon Sep 17 00:00:00 2001 From: Eran Date: Tue, 24 Oct 2023 11:37:59 +0300 Subject: [PATCH] wait for a reply for dds-device open-streams --- third-party/realdds/src/dds-device-impl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/third-party/realdds/src/dds-device-impl.cpp b/third-party/realdds/src/dds-device-impl.cpp index f1a066073ea..9759e269f90 100644 --- a/third-party/realdds/src/dds-device-impl.cpp +++ b/third-party/realdds/src/dds-device-impl.cpp @@ -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" ) ); }