diff --git a/srcRs/DustDDS/src/main.rs b/srcRs/DustDDS/src/main.rs index 2b69116f..04928ba0 100644 --- a/srcRs/DustDDS/src/main.rs +++ b/srcRs/DustDDS/src/main.rs @@ -28,7 +28,7 @@ use dust_dds::{ }; use rand::{Rng, random, thread_rng}; use std::{ - fmt::Debug, + fmt::{Debug, Display}, io::Write, process::{ExitCode, Termination}, sync::mpsc::Receiver, @@ -330,6 +330,16 @@ impl Options { } } +impl Display for AccessScope { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(match self { + AccessScope::I => "INSTANCE_PRESENTATION_QOS", + AccessScope::T => "TOPIC_PRESENTATION_QOS", + AccessScope::G => "GROUP_PRESENTATION_QOS", + }) + } +} + struct Listener; impl DomainParticipantListener for Listener { async fn on_inconsistent_topic( @@ -809,6 +819,11 @@ fn main() -> Result<(), Return> { let options = Options::parse(); options.validate()?; + if let Some(access_scope) = options.access_scope { + println!(" Presentation Access Scope {} : not supported", access_scope); + return Err(InitializeError(String::from("")).into()); + } + let participant = initialize(&options)?; if options.publish { let data_writer = init_publisher(&participant, options.clone())?;