implementation de ConnectionManager
This commit is contained in:
9290
pmo_src.txt
9290
pmo_src.txt
File diff suppressed because it is too large
Load Diff
@@ -108,30 +108,8 @@ use variables::{
|
||||
TRANSPORTPLAYSPEED, TRANSPORTSTATE, TRANSPORTSTATUS
|
||||
};
|
||||
|
||||
/// Service AVTransport:1 conforme à la spécification UPnP AV.
|
||||
///
|
||||
/// Ce service permet de contrôler le transport de médias **audio** sur un MediaRenderer.
|
||||
///
|
||||
/// # Initialisation
|
||||
///
|
||||
/// Le service est initialisé paresseusement (lazy) au premier accès via la macro
|
||||
/// [`define_service!`]. Toutes les variables d'état et actions sont automatiquement
|
||||
/// enregistrées.
|
||||
///
|
||||
/// # Exemples
|
||||
///
|
||||
/// ```rust
|
||||
/// use pmoupnp::mediarenderer::avtransport::AVTTRANSPORT;
|
||||
///
|
||||
/// let service = &*AVTTRANSPORT;
|
||||
/// assert_eq!(service.name(), "AVTransport");
|
||||
/// assert_eq!(service.version(), 1);
|
||||
/// ```
|
||||
///
|
||||
/// # Voir aussi
|
||||
///
|
||||
/// - Module [`actions`] : Définition de toutes les actions UPnP
|
||||
/// - Module [`variables`] : Définition de toutes les variables d'état
|
||||
// Service AVTransport:1 conforme à la spécification UPnP AV pour MediaRenderer audio
|
||||
// Voir la documentation du module pour plus de détails
|
||||
define_service! {
|
||||
pub static AVTTRANSPORT = "AVTransport" {
|
||||
variables: [
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
use crate::mediarenderer::connectionmanager::variables::CURRENTCONNECTIONIDS;
|
||||
use crate::define_action;
|
||||
|
||||
define_action! {
|
||||
pub static GETCURRENTCONNECTIONIDS = "GetCurrentConnectionIDs" {
|
||||
out "ConnectionIDs" => CURRENTCONNECTIONIDS,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
use crate::mediarenderer::connectionmanager::variables::{
|
||||
A_ARG_TYPE_CONNECTIONID, A_ARG_TYPE_RCSID, A_ARG_TYPE_AVTRANSPORTID,
|
||||
A_ARG_TYPE_PROTOCOLINFO, A_ARG_TYPE_DIRECTION, A_ARG_TYPE_CONNECTIONSTATUS
|
||||
};
|
||||
use crate::define_action;
|
||||
|
||||
define_action! {
|
||||
pub static GETCURRENTCONNECTIONINFO = "GetCurrentConnectionInfo" {
|
||||
in "ConnectionID" => A_ARG_TYPE_CONNECTIONID,
|
||||
out "RcsID" => A_ARG_TYPE_RCSID,
|
||||
out "AVTransportID" => A_ARG_TYPE_AVTRANSPORTID,
|
||||
out "ProtocolInfo" => A_ARG_TYPE_PROTOCOLINFO,
|
||||
out "PeerConnectionManager" => A_ARG_TYPE_PROTOCOLINFO,
|
||||
out "PeerConnectionID" => A_ARG_TYPE_CONNECTIONID,
|
||||
out "Direction" => A_ARG_TYPE_DIRECTION,
|
||||
out "Status" => A_ARG_TYPE_CONNECTIONSTATUS,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::mediarenderer::connectionmanager::variables::{SOURCEPROTOCOLINFO, SINKPROTOCOLINFO};
|
||||
use crate::define_action;
|
||||
|
||||
define_action! {
|
||||
pub static GETPROTOCOLINFO = "GetProtocolInfo" {
|
||||
out "Source" => SOURCEPROTOCOLINFO,
|
||||
out "Sink" => SINKPROTOCOLINFO,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
mod getprotocolinfo;
|
||||
mod getcurrentconnectionids;
|
||||
mod getcurrentconnectioninfo;
|
||||
|
||||
pub use getprotocolinfo::GETPROTOCOLINFO;
|
||||
pub use getcurrentconnectionids::GETCURRENTCONNECTIONIDS;
|
||||
pub use getcurrentconnectioninfo::GETCURRENTCONNECTIONINFO;
|
||||
89
pmoupnp/src/mediarenderer/connectionmanager/mod.rs
Normal file
89
pmoupnp/src/mediarenderer/connectionmanager/mod.rs
Normal file
@@ -0,0 +1,89 @@
|
||||
//! # ConnectionManager Service - Service de gestion des connexions UPnP
|
||||
//!
|
||||
//! Ce module implémente le service ConnectionManager:1 selon la spécification UPnP AV.
|
||||
//! Le service ConnectionManager gère les connexions entre MediaServer et MediaRenderer,
|
||||
//! et expose les protocoles et formats supportés.
|
||||
//!
|
||||
//! ## Fonctionnalités
|
||||
//!
|
||||
//! Le service ConnectionManager permet :
|
||||
//! - **Énumération des protocoles** : GetProtocolInfo
|
||||
//! - **Gestion des connexions** : GetCurrentConnectionIDs, GetCurrentConnectionInfo
|
||||
//! - Support des formats audio (MP3, FLAC, WAV, etc.)
|
||||
//!
|
||||
//! ## Conformité UPnP
|
||||
//!
|
||||
//! Cette implémentation suit la spécification **UPnP ConnectionManager:1 Service Template**.
|
||||
//! Toutes les actions obligatoires (Required) sont implémentées :
|
||||
//!
|
||||
//! - ✅ GetProtocolInfo
|
||||
//! - ✅ GetCurrentConnectionIDs
|
||||
//! - ✅ GetCurrentConnectionInfo
|
||||
//!
|
||||
//! ## Variables d'état
|
||||
//!
|
||||
//! Le service expose les variables d'état conformes à la spécification :
|
||||
//!
|
||||
//! ### Informations de protocole
|
||||
//! - [`SOURCEPROTOCOLINFO`] : Protocoles source (vide pour un renderer)
|
||||
//! - [`SINKPROTOCOLINFO`] : Protocoles sink supportés (http-get:*:audio/mpeg:*, etc.)
|
||||
//! - [`CURRENTCONNECTIONIDS`] : IDs des connexions actives
|
||||
//!
|
||||
//! ### Arguments
|
||||
//! - [`A_ARG_TYPE_CONNECTIONID`] : ID de connexion
|
||||
//! - [`A_ARG_TYPE_CONNECTIONSTATUS`] : Statut de connexion
|
||||
//! - [`A_ARG_TYPE_DIRECTION`] : Direction (Input/Output)
|
||||
//! - [`A_ARG_TYPE_PROTOCOLINFO`] : Information de protocole
|
||||
//! - [`A_ARG_TYPE_RCSID`] : ID RenderingControl
|
||||
//! - [`A_ARG_TYPE_AVTRANSPORTID`] : ID AVTransport
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! ```rust
|
||||
//! use pmoupnp::mediarenderer::connectionmanager::CONNECTIONMANAGER;
|
||||
//!
|
||||
//! // Accéder au service
|
||||
//! let service = &*CONNECTIONMANAGER;
|
||||
//! println!("Service: {}", service.name());
|
||||
//! println!("Type: {}", service.service_type());
|
||||
//! ```
|
||||
//!
|
||||
//! ## Références
|
||||
//!
|
||||
//! - [UPnP ConnectionManager:1 Service Template](https://upnp.org/specs/av/UPnP-av-ConnectionManager-v1-Service.pdf)
|
||||
//! - [UPnP AV Architecture](https://upnp.org/specs/av/)
|
||||
|
||||
use crate::define_service;
|
||||
|
||||
pub mod variables;
|
||||
pub mod actions;
|
||||
|
||||
use actions::{GETCURRENTCONNECTIONIDS, GETCURRENTCONNECTIONINFO, GETPROTOCOLINFO};
|
||||
use variables::{
|
||||
A_ARG_TYPE_AVTRANSPORTID, A_ARG_TYPE_CONNECTIONID, A_ARG_TYPE_CONNECTIONSTATUS,
|
||||
A_ARG_TYPE_DIRECTION, A_ARG_TYPE_PROTOCOLINFO, A_ARG_TYPE_RCSID,
|
||||
CURRENTCONNECTIONIDS, SINKPROTOCOLINFO, SOURCEPROTOCOLINFO
|
||||
};
|
||||
|
||||
// Service ConnectionManager:1 conforme à la spécification UPnP AV pour MediaRenderer audio
|
||||
// Voir la documentation du module pour plus de détails
|
||||
define_service! {
|
||||
pub static CONNECTIONMANAGER = "ConnectionManager" {
|
||||
variables: [
|
||||
A_ARG_TYPE_AVTRANSPORTID,
|
||||
A_ARG_TYPE_CONNECTIONID,
|
||||
A_ARG_TYPE_CONNECTIONSTATUS,
|
||||
A_ARG_TYPE_DIRECTION,
|
||||
A_ARG_TYPE_PROTOCOLINFO,
|
||||
A_ARG_TYPE_RCSID,
|
||||
CURRENTCONNECTIONIDS,
|
||||
SINKPROTOCOLINFO,
|
||||
SOURCEPROTOCOLINFO,
|
||||
],
|
||||
actions: [
|
||||
GETCURRENTCONNECTIONIDS,
|
||||
GETCURRENTCONNECTIONINFO,
|
||||
GETPROTOCOLINFO,
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::define_variable;
|
||||
|
||||
define_variable! {
|
||||
pub static A_ARG_TYPE_AVTRANSPORTID: I4 = "A_ARG_TYPE_AVTransportID"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::define_variable;
|
||||
|
||||
define_variable! {
|
||||
pub static A_ARG_TYPE_CONNECTIONID: I4 = "A_ARG_TYPE_ConnectionID"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
use crate::define_variable;
|
||||
|
||||
define_variable! {
|
||||
pub static A_ARG_TYPE_CONNECTIONSTATUS: String = "A_ARG_TYPE_ConnectionStatus" {
|
||||
allowed: ["OK", "ContentFormatMismatch", "InsufficientBandwidth", "UnreliableChannel", "Unknown"],
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
use crate::define_variable;
|
||||
|
||||
define_variable! {
|
||||
pub static A_ARG_TYPE_DIRECTION: String = "A_ARG_TYPE_Direction" {
|
||||
allowed: ["Input", "Output"],
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::define_variable;
|
||||
|
||||
define_variable! {
|
||||
pub static A_ARG_TYPE_PROTOCOLINFO: String = "A_ARG_TYPE_ProtocolInfo"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::define_variable;
|
||||
|
||||
define_variable! {
|
||||
pub static A_ARG_TYPE_RCSID: I4 = "A_ARG_TYPE_RcsID"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
use crate::define_variable;
|
||||
|
||||
define_variable! {
|
||||
pub static CURRENTCONNECTIONIDS: String = "CurrentConnectionIDs" {
|
||||
evented: true,
|
||||
}
|
||||
}
|
||||
19
pmoupnp/src/mediarenderer/connectionmanager/variables/mod.rs
Normal file
19
pmoupnp/src/mediarenderer/connectionmanager/variables/mod.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
mod sourceprotocolinfo;
|
||||
mod sinkprotocolinfo;
|
||||
mod currentconnectionids;
|
||||
mod a_arg_type_connectionid;
|
||||
mod a_arg_type_connectionstatus;
|
||||
mod a_arg_type_direction;
|
||||
mod a_arg_type_protocolinfo;
|
||||
mod a_arg_type_rcsid;
|
||||
mod a_arg_type_avtransportid;
|
||||
|
||||
pub use sourceprotocolinfo::SOURCEPROTOCOLINFO;
|
||||
pub use sinkprotocolinfo::SINKPROTOCOLINFO;
|
||||
pub use currentconnectionids::CURRENTCONNECTIONIDS;
|
||||
pub use a_arg_type_connectionid::A_ARG_TYPE_CONNECTIONID;
|
||||
pub use a_arg_type_connectionstatus::A_ARG_TYPE_CONNECTIONSTATUS;
|
||||
pub use a_arg_type_direction::A_ARG_TYPE_DIRECTION;
|
||||
pub use a_arg_type_protocolinfo::A_ARG_TYPE_PROTOCOLINFO;
|
||||
pub use a_arg_type_rcsid::A_ARG_TYPE_RCSID;
|
||||
pub use a_arg_type_avtransportid::A_ARG_TYPE_AVTRANSPORTID;
|
||||
@@ -0,0 +1,8 @@
|
||||
use crate::define_variable;
|
||||
|
||||
// Pour un MediaRenderer audio, liste les protocoles/formats audio supportés
|
||||
define_variable! {
|
||||
pub static SINKPROTOCOLINFO: String = "SinkProtocolInfo" {
|
||||
evented: true,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
use crate::define_variable;
|
||||
|
||||
define_variable! {
|
||||
pub static SOURCEPROTOCOLINFO: String = "SourceProtocolInfo" {
|
||||
evented: true,
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
pub mod avtransport;
|
||||
pub mod connectionmanager;
|
||||
pub mod renderingcontrol;
|
||||
|
||||
@@ -57,30 +57,8 @@ pub mod actions;
|
||||
use actions::{GETMUTE, GETVOLUME, SETMUTE, SETVOLUME};
|
||||
use variables::{A_ARG_TYPE_CHANNEL, A_ARG_TYPE_INSTANCE_ID, MUTE, VOLUME};
|
||||
|
||||
/// Service RenderingControl:1 conforme à la spécification UPnP AV.
|
||||
///
|
||||
/// Ce service permet de contrôler les paramètres de rendu audio sur un MediaRenderer.
|
||||
///
|
||||
/// # Initialisation
|
||||
///
|
||||
/// Le service est initialisé paresseusement (lazy) au premier accès via la macro
|
||||
/// [`define_service!`]. Toutes les variables d'état et actions sont automatiquement
|
||||
/// enregistrées.
|
||||
///
|
||||
/// # Exemples
|
||||
///
|
||||
/// ```rust
|
||||
/// use pmoupnp::mediarenderer::renderingcontrol::RENDERINGCONTROL;
|
||||
///
|
||||
/// let service = &*RENDERINGCONTROL;
|
||||
/// assert_eq!(service.name(), "RenderingControl");
|
||||
/// assert_eq!(service.version(), 1);
|
||||
/// ```
|
||||
///
|
||||
/// # Voir aussi
|
||||
///
|
||||
/// - Module [`actions`] : Définition de toutes les actions UPnP
|
||||
/// - Module [`variables`] : Définition de toutes les variables d'état
|
||||
// Service RenderingControl:1 conforme à la spécification UPnP AV pour MediaRenderer audio
|
||||
// Voir la documentation du module pour plus de détails
|
||||
define_service! {
|
||||
pub static RENDERINGCONTROL = "RenderingControl" {
|
||||
variables: [
|
||||
|
||||
1
pmoupnp/webapp/.gitignore
vendored
1
pmoupnp/webapp/.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
Reference in New Issue
Block a user