mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 09:23:19 +01:00
Rename dbus. Add asus_armoury client source
This commit is contained in:
33
rog-dbus/src/asus_armoury/attr_enum_int.rs
Normal file
33
rog-dbus/src/asus_armoury/attr_enum_int.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
//! Path for iface is such as "/xyz/ljones/asus_armoury/boot_sound"
|
||||
use zbus::proxy;
|
||||
#[proxy(
|
||||
interface = "xyz.ljones.AsusArmoury",
|
||||
default_service = "xyz.ljones.Asusd"
|
||||
)]
|
||||
pub trait AsusArmoury {
|
||||
/// CurrentValue property
|
||||
#[zbus(property)]
|
||||
fn current_value(&self) -> zbus::Result<i32>;
|
||||
#[zbus(property)]
|
||||
fn set_current_value(&self, value: i32) -> zbus::Result<()>;
|
||||
|
||||
/// DefaultValue property
|
||||
#[zbus(property)]
|
||||
fn default_value(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// MaxValue property
|
||||
#[zbus(property)]
|
||||
fn max_value(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// MinValue property
|
||||
#[zbus(property)]
|
||||
fn min_value(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// Name property
|
||||
#[zbus(property)]
|
||||
fn name(&self) -> zbus::Result<String>;
|
||||
|
||||
/// ScalarIncrement property
|
||||
#[zbus(property)]
|
||||
fn scalar_increment(&self) -> zbus::Result<i32>;
|
||||
}
|
||||
25
rog-dbus/src/asus_armoury/attr_enum_str.rs
Normal file
25
rog-dbus/src/asus_armoury/attr_enum_str.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
//! Path for iface is such as "/xyz/ljones/asus_armoury/boot_sound"
|
||||
use zbus::proxy;
|
||||
#[proxy(
|
||||
interface = "xyz.ljones.AsusArmoury",
|
||||
default_service = "xyz.ljones.Asusd"
|
||||
)]
|
||||
pub trait AsusArmoury {
|
||||
/// CurrentValue property
|
||||
#[zbus(property)]
|
||||
fn current_value(&self) -> zbus::Result<String>;
|
||||
#[zbus(property)]
|
||||
fn set_current_value(&self, value: String) -> zbus::Result<()>;
|
||||
|
||||
/// DefaultValue property
|
||||
#[zbus(property)]
|
||||
fn default_value(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Name property
|
||||
#[zbus(property)]
|
||||
fn name(&self) -> zbus::Result<String>;
|
||||
|
||||
/// PossibleValues property
|
||||
#[zbus(property)]
|
||||
fn possible_values(&self) -> zbus::Result<Vec<String>>;
|
||||
}
|
||||
25
rog-dbus/src/asus_armoury/attr_int.rs
Normal file
25
rog-dbus/src/asus_armoury/attr_int.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use zbus::proxy;
|
||||
#[proxy(
|
||||
interface = "xyz.ljones.AsusArmoury",
|
||||
default_service = "xyz.ljones.Asusd",
|
||||
default_path = "/xyz/ljones/asus_armoury/boot_sound"
|
||||
)]
|
||||
pub trait AsusArmoury {
|
||||
/// CurrentValue property
|
||||
#[zbus(property)]
|
||||
fn current_value(&self) -> zbus::Result<i32>;
|
||||
#[zbus(property)]
|
||||
fn set_current_value(&self, value: i32) -> zbus::Result<()>;
|
||||
|
||||
/// DefaultValue property
|
||||
#[zbus(property)]
|
||||
fn default_value(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// Name property
|
||||
#[zbus(property)]
|
||||
fn name(&self) -> zbus::Result<String>;
|
||||
|
||||
/// PossibleValues property
|
||||
#[zbus(property)]
|
||||
fn possible_values(&self) -> zbus::Result<Vec<i32>>;
|
||||
}
|
||||
3
rog-dbus/src/asus_armoury/mod.rs
Normal file
3
rog-dbus/src/asus_armoury/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub mod attr_enum_int;
|
||||
pub mod attr_enum_str;
|
||||
pub mod attr_int;
|
||||
@@ -1,5 +1,6 @@
|
||||
pub use asusd::{DBUS_IFACE, DBUS_NAME, DBUS_PATH};
|
||||
|
||||
pub mod asus_armoury;
|
||||
pub mod scsi_aura;
|
||||
pub mod zbus_anime;
|
||||
pub mod zbus_aura;
|
||||
@@ -11,7 +12,7 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
pub fn list_iface_blocking() -> Result<Vec<String>, Box<dyn std::error::Error>> {
|
||||
let conn = zbus::blocking::Connection::system()?;
|
||||
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "org.asuslinux.Daemon", "/")?;
|
||||
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "xyz.ljones.Asusd", "/")?;
|
||||
let interfaces = f.get_managed_objects()?;
|
||||
let mut ifaces = Vec::new();
|
||||
for v in interfaces.iter() {
|
||||
@@ -24,7 +25,7 @@ pub fn list_iface_blocking() -> Result<Vec<String>, Box<dyn std::error::Error>>
|
||||
|
||||
pub fn has_iface_blocking(iface: &str) -> Result<bool, Box<dyn std::error::Error>> {
|
||||
let conn = zbus::blocking::Connection::system()?;
|
||||
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "org.asuslinux.Daemon", "/")?;
|
||||
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "xyz.ljones.Asusd", "/")?;
|
||||
let interfaces = f.get_managed_objects()?;
|
||||
for v in interfaces.iter() {
|
||||
for k in v.1.keys() {
|
||||
@@ -38,7 +39,7 @@ pub fn has_iface_blocking(iface: &str) -> Result<bool, Box<dyn std::error::Error
|
||||
|
||||
pub async fn has_iface(iface: &str) -> Result<bool, Box<dyn std::error::Error>> {
|
||||
let conn = zbus::Connection::system().await?;
|
||||
let f = zbus::fdo::ObjectManagerProxy::new(&conn, "org.asuslinux.Daemon", "/").await?;
|
||||
let f = zbus::fdo::ObjectManagerProxy::new(&conn, "xyz.ljones.Asusd", "/").await?;
|
||||
let interfaces = f.get_managed_objects().await?;
|
||||
for v in interfaces.iter() {
|
||||
for k in v.1.keys() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! # D-Bus interface proxy for: `org.asuslinux.ScsiAura`
|
||||
//! # D-Bus interface proxy for: `xyz.ljones.ScsiAura`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `5.0.1` from D-Bus introspection
|
||||
//! data. Source: `Interface '/org/asuslinux/M3D0AP048745_scsi' from service
|
||||
//! 'org.asuslinux.Daemon' on system bus`.
|
||||
//! data. Source: `Interface '/xyz/ljones/M3D0AP048745_scsi' from service
|
||||
//! 'xyz.ljones.Asusd' on system bus`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
@@ -23,9 +23,9 @@
|
||||
use rog_scsi::{AuraEffect, AuraMode};
|
||||
use zbus::proxy;
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.ScsiAura",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux"
|
||||
interface = "xyz.ljones.ScsiAura",
|
||||
default_service = "xyz.ljones.Asusd",
|
||||
default_path = "/xyz/ljones"
|
||||
)]
|
||||
pub trait ScsiAura {
|
||||
/// AllModeData method
|
||||
|
||||
@@ -3,9 +3,9 @@ use rog_anime::{Animations, AnimeDataBuffer, DeviceState as AnimeDeviceState};
|
||||
use zbus::proxy;
|
||||
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Anime",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux"
|
||||
interface = "xyz.ljones.Anime",
|
||||
default_service = "xyz.ljones.Asusd",
|
||||
default_path = "/xyz/ljones"
|
||||
)]
|
||||
pub trait Anime {
|
||||
/// DeviceState method
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! # `DBus` interface proxy for: `org.asuslinux.Daemon`
|
||||
//! # `DBus` interface proxy for: `xyz.ljones.Asusd`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection
|
||||
//! data. Source: `Interface '/org/asuslinux/Aura' from service
|
||||
//! 'org.asuslinux.Daemon' on system bus`.
|
||||
//! data. Source: `Interface '/xyz/ljones/Aura' from service
|
||||
//! 'xyz.ljones.Asusd' on system bus`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
@@ -30,9 +30,9 @@ use zbus::{proxy, Result};
|
||||
const BLOCKING_TIME: u64 = 33; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 FPS
|
||||
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Aura",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux/Aura"
|
||||
interface = "xyz.ljones.Aura",
|
||||
default_service = "xyz.ljones.Asusd",
|
||||
default_path = "/xyz/ljones/Aura"
|
||||
)]
|
||||
pub trait Aura {
|
||||
/// AllModeData method
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! # `DBus` interface proxy for: `org.asuslinux.Daemon`
|
||||
//! # `DBus` interface proxy for: `xyz.ljones.Asusd`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection
|
||||
//! data. Source: `Interface '/org/asuslinux/Profile' from service
|
||||
//! 'org.asuslinux.Daemon' on system bus`.
|
||||
//! data. Source: `Interface '/xyz/ljones/Profile' from service
|
||||
//! 'xyz.ljones.Asusd' on system bus`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
@@ -26,9 +26,9 @@ use rog_profiles::FanCurvePU;
|
||||
use zbus::proxy;
|
||||
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.FanCurves",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux"
|
||||
interface = "xyz.ljones.FanCurves",
|
||||
default_service = "xyz.ljones.Asusd",
|
||||
default_path = "/xyz/ljones"
|
||||
)]
|
||||
pub trait FanCurves {
|
||||
/// Get the fan-curve data for the currently active PlatformProfile
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! # `DBus` interface proxy for: `org.asuslinux.Daemon`
|
||||
//! # `DBus` interface proxy for: `xyz.ljones.Asusd`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection
|
||||
//! data. Source: `Interface '/org/asuslinux/Platform' from service
|
||||
//! 'org.asuslinux.Daemon' on system bus`.
|
||||
//! data. Source: `Interface '/xyz/ljones/Platform' from service
|
||||
//! 'xyz.ljones.Asusd' on system bus`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
@@ -25,9 +25,9 @@ use rog_platform::platform::{GpuMode, Properties, ThrottlePolicy};
|
||||
use zbus::proxy;
|
||||
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Platform",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux"
|
||||
interface = "xyz.ljones.Platform",
|
||||
default_service = "xyz.ljones.Asusd",
|
||||
default_path = "/xyz/ljones"
|
||||
)]
|
||||
pub trait Platform {
|
||||
#[zbus(property)]
|
||||
|
||||
@@ -2,9 +2,9 @@ use rog_slash::SlashMode;
|
||||
use zbus::proxy;
|
||||
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Slash",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux"
|
||||
interface = "xyz.ljones.Slash",
|
||||
default_service = "xyz.ljones.Asusd",
|
||||
default_path = "/xyz/ljones"
|
||||
)]
|
||||
pub trait Slash {
|
||||
/// EnableDisplay property
|
||||
|
||||
Reference in New Issue
Block a user