4
device
crate-kit edited this page 2026-11-14 04:21:21 +00:00
Table of contents
pmossdp > device
Module: device
Contents
Structs
SsdpDevice- Appareil annoncé par unSsdpServer, avec ses métadonnées SSDP.
pmossdp::device::SsdpDevice
Struct
Appareil annoncé par un SsdpServer, avec ses métadonnées SSDP.
SsdpDevice::new fabrique les types de notification (NT) habituels d'un appareil racine ;
ils peuvent être complétés avec add_notification_type. Les
types uuid:<uuid> et celui de l'appareil sont toujours présents ; seul upnp:rootdevice peut
être retiré, avec without_root_device, pour une entité qui n'est
pas un appareil UPnP.
Exemple
use pmossdp::SsdpDevice;
let mut device = SsdpDevice::new(
"0f3c9a52-7b1e-4c43-9d57-2a1b6e0c8f10".into(),
"urn:schemas-upnp-org:device:MediaRenderer:1".into(),
"http://192.168.1.10:8080/desc.xml".into(),
"Linux UPnP/1.1 MonApp/1.0".into(),
);
device.add_notification_type("urn:schemas-upnp-org:service:AVTransport:1".into());
assert_eq!(device.notification_types().len(), 4);
assert_eq!(device.uuid(), "0f3c9a52-7b1e-4c43-9d57-2a1b6e0c8f10");
Methods:
fn new(uuid: String, device_type: String, location: String, server: String) -> Self- Crée un appareil dont les types de notification sontuuid:<uuid>,upnp:rootdeviceetfn without_root_device(self: Self) -> Self- Retireupnp:rootdevicedes types annoncés.fn with_config_id(self: Self, config_id: u32) -> Self- Déclare l'appareil UPnP 1.1 : ses annonces, réponses etbyebyeportent alorsfn with_fixed_location(self: Self) -> Self- Garde laLOCATIONtelle qu'elle a été donnée sur tous les réseaux, au lieu d'y mettrefn add_notification_type(self: & mut Self, nt: String)- Ajoute un type de notification (par exemple celui d'un service), sauf s'il est déjà présent.fn uuid(self: &Self) -> &str- UUID de l'appareil, sans le préfixeuuid:.fn device_type(self: &Self) -> &str- Type de l'appareil, par exempleurn:schemas-upnp-org:device:MediaRenderer:1.fn location(self: &Self) -> &str- URL de la description XML de l'appareil (LOCATION).fn location_for(self: &Self, local: Ipv4Addr) -> String- LaLOCATIONà donner à un point de contrôle qui joint cette machine parlocal: cellefn server(self: &Self) -> &str- Identification du logiciel (SERVER).fn notification_types(self: &Self) -> &[String]- Types de notification (NT) annoncés par l'appareil, dans l'ordre d'annonce.fn config_id(self: &Self) -> Option<u32>-CONFIGID.UPNP.ORGdéclaré parwith_config_id, s'il y en a un.
Traits: Eq
Trait Implementations:
- Clone
fn clone(self: &Self) -> Self
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- PartialEq
fn eq(self: &Self, other: &Self) -> bool