eclipse-iceoryx / iceoryx2

Eclipse iceoryx2™ - true zero-copy inter-process-communication in pure Rust
https://iceoryx.io
Apache License 2.0
527 stars 26 forks source link

user-defined service properties #231

Closed elfenpiff closed 3 months ago

elfenpiff commented 3 months ago

Brief feature description

Services may have properties that correspond to sensors or other constraints that cannot be represented in the context of iceoryx2. Therefore, the user needs the ability to set user-defined properties.

Detailed information

let service = zero_copy::Service::new(&service_name)
  // START: user-defined service properties
    .custom_property("CameraResolution", "1920x1080")
    .custom_property("Framerate", "60")
  // END: user-defined service properties
    .publish_subscribe::<TransmissionData>()
    .open_or_create()?;

The user-defined service properties can be read via the services static config:

let camera_resolution = service.static_config()
                               .custom_property("CameraResolution");
elBoberido commented 3 months ago

Is the restriction to byte string literals necessary? Why not accept any valid UTF8 string?

elfenpiff commented 3 months ago

@elBoberido just to test if you pay attention.