#[non_exhaustive]pub struct DeviceAnnounce {
pub id: String,
pub name: String,
pub model: String,
pub serial: String,
pub api_version: Option<u32>,
pub ip: Option<String>,
pub mac: Option<String>,
pub user_name: Option<String>,
pub manufacturer: Option<String>,
}Expand description
Periodic announcement published by the camera service.
Carries enough of the device’s identity for a client to tell two cameras of the same model apart: the user-defined name, the serial and the address.
#[non_exhaustive]: build one with DeviceAnnounce::new and assign the
optional fields, so that adding the next field is not a breaking change.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringService-assigned device id, also the {id} segment of every key
expression in keys. For GigE Vision it is gige_device_id.
name: StringHuman-readable name: the user-defined name, else the model.
model: StringThe camera’s model name.
serial: StringSerial number as the device reports it; empty when it reports none.
Services before API version 3 put the device id here instead.
api_version: Option<u32>Zenoh API version supported by this service.
None when deserializing from older services that do not include the
field — handled gracefully by the app (warns but still discovers).
ip: Option<String>Current IPv4 address in dotted-quad form. None for transports without
one (USB3 Vision) and from services before API version 3.
mac: Option<String>MAC address as AA:BB:CC:DD:EE:FF. None for transports without one.
user_name: Option<String>User-defined device name (the GigE Vision Discovery ACK’s user-defined name field), when one is set.
manufacturer: Option<String>Manufacturer name, when the device reports one.
Implementations§
Source§impl DeviceAnnounce
impl DeviceAnnounce
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
model: impl Into<String>,
serial: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, model: impl Into<String>, serial: impl Into<String>, ) -> Self
An announce carrying the required fields and the current
API_VERSION, with every optional identity field unset.
Sourcepub fn for_gige(
mac: &[u8; 6],
ip: Ipv4Addr,
model: Option<&str>,
serial: Option<&str>,
user_name: Option<&str>,
manufacturer: Option<&str>,
) -> Self
pub fn for_gige( mac: &[u8; 6], ip: Ipv4Addr, model: Option<&str>, serial: Option<&str>, user_name: Option<&str>, manufacturer: Option<&str>, ) -> Self
The announce for a GigE Vision camera, from the fields of its Discovery ACK.
The one place the GigE identity rule lives, so the service and Studio’s
embedded backend announce the same camera identically: id is
gige_device_id, name is the user-defined name, else the model,
else the address, and serial is the device’s own (empty when absent).