mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Advanced Aura feature
Groundwork for 'advanced' aura modes Add single zone + Doom light flash Fix mocking for ROGCC Better prepare & change to mapping of keyboard layouts to models and functions Refactor and begin using new key layout stuff Enable first arg to rogcc to set layout in mocking feature mode Complete refactor of key layouts, and to RON serde
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
//! # DBus interface proxy for: `org.asuslinux.Daemon`
|
||||
//!
|
||||
//! 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`.
|
||||
//! 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`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
@@ -21,12 +22,13 @@
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use zbus::dbus_proxy;
|
||||
use zbus::{blocking::Connection, Result};
|
||||
use rog_aura::advanced::UsbPackets;
|
||||
use rog_aura::usb::AuraPowerDev;
|
||||
use rog_aura::{AuraEffect, AuraModeNum, LedBrightness};
|
||||
use zbus::blocking::Connection;
|
||||
use zbus::{dbus_proxy, Result};
|
||||
|
||||
use rog_aura::{usb::AuraPowerDev, AuraEffect, AuraModeNum, LedBrightness, PerKeyRaw};
|
||||
|
||||
const BLOCKING_TIME: u64 = 40; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 FPS
|
||||
const BLOCKING_TIME: u64 = 33; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 FPS
|
||||
|
||||
#[dbus_proxy(
|
||||
interface = "org.asuslinux.Daemon",
|
||||
@@ -53,7 +55,10 @@ trait Led {
|
||||
|
||||
fn set_leds_power(&self, options: AuraPowerDev, enabled: bool) -> zbus::Result<()>;
|
||||
|
||||
fn per_key_raw(&self, data: PerKeyRaw) -> zbus::fdo::Result<()>;
|
||||
/// On machine that have some form of either per-key keyboard or per-zone
|
||||
/// this can be used to write custom effects over dbus. The input is a
|
||||
/// nested `Vec<Vec<8>>` where `Vec<u8>` is a raw USB packet
|
||||
fn direct_addressing_raw(&self, data: UsbPackets) -> zbus::fdo::Result<()>;
|
||||
|
||||
/// NotifyLed signal
|
||||
#[dbus_proxy(signal)]
|
||||
@@ -95,8 +100,8 @@ impl<'a> LedProxyPerkey<'a> {
|
||||
/// Intentionally blocks for 10ms after sending to allow the block to
|
||||
/// be written to the keyboard EC. This should not be async.
|
||||
#[inline]
|
||||
pub fn set_per_key(&self, per_key_raw: PerKeyRaw) -> Result<()> {
|
||||
self.0.per_key_raw(per_key_raw)?;
|
||||
pub fn direct_addressing_raw(&self, direct_raw: UsbPackets) -> Result<()> {
|
||||
self.0.direct_addressing_raw(direct_raw)?;
|
||||
std::thread::sleep(std::time::Duration::from_millis(BLOCKING_TIME));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user