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:
Luke D. Jones
2022-12-11 11:50:47 +13:00
parent e3ecaa92bd
commit 1cbffedaeb
134 changed files with 8249 additions and 4390 deletions

View File

@@ -15,7 +15,8 @@ trait Anime {
/// Set whether the AniMe is displaying images/data
fn set_on_off(&self, status: bool) -> zbus::Result<()>;
/// Writes a data stream of length. Will force system thread to exit until it is restarted
/// Writes a data stream of length. Will force system thread to exit until
/// it is restarted
fn write(&self, input: AnimeDataBuffer) -> zbus::Result<()>;
/// Get status of if the AniMe LEDs are on
@@ -26,7 +27,8 @@ trait Anime {
#[dbus_proxy(property)]
fn boot_enabled(&self) -> zbus::Result<bool>;
/// Notify listeners of the status of AniMe LED power and factory system-status animations
/// Notify listeners of the status of AniMe LED power and factory
/// system-status animations
#[dbus_proxy(signal)]
fn power_states(&self, data: AnimePowerStates) -> zbus::Result<()>;
}

View File

@@ -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(())
}

View File

@@ -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/Platform' 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/Platform' from service
//! 'org.asuslinux.Daemon' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!

View File

@@ -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/Charge' 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/Charge' from service
//! 'org.asuslinux.Daemon' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!

View File

@@ -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/Profile' 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/Profile' from service
//! 'org.asuslinux.Daemon' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
@@ -19,10 +20,8 @@
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use rog_profiles::{
fan_curve_set::{CurveData, FanCurveSet},
Profile,
};
use rog_profiles::fan_curve_set::{CurveData, FanCurveSet};
use rog_profiles::Profile;
use zbus::dbus_proxy;
#[dbus_proxy(
@@ -56,16 +55,18 @@ trait Profile {
/// currently in if profile == None. Will also activate the fan curve.
fn set_fan_curve(&self, profile: Profile, curve: CurveData) -> zbus::Result<()>;
/// Reset the stored (self) and device curve to the defaults of the platform.
/// Reset the stored (self) and device curve to the defaults of the
/// platform.
///
/// Each platform_profile has a different default and the defualt can be read
/// only for the currently active profile.
/// Each platform_profile has a different default and the defualt can be
/// read only for the currently active profile.
fn set_active_curve_to_defaults(&self) -> zbus::Result<()>;
/// Reset the stored (self) and device curve to the defaults of the platform.
/// Reset the stored (self) and device curve to the defaults of the
/// platform.
///
/// Each platform_profile has a different default and the defualt can be read
/// only for the currently active profile.
/// Each platform_profile has a different default and the defualt can be
/// read only for the currently active profile.
fn reset_profile_curves(&self, profile: Profile) -> zbus::fdo::Result<()>;
/// NotifyProfile signal

View File

@@ -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/Supported' 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/Supported' from service
//! 'org.asuslinux.Daemon' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!