Merge rog-supported in to rog-platform

This commit is contained in:
Luke D. Jones
2022-08-12 17:45:29 +12:00
parent b20bde8116
commit d35707f2e4
29 changed files with 44 additions and 70 deletions

27
Cargo.lock generated
View File

@@ -80,8 +80,8 @@ dependencies = [
"notify-rust",
"rog_aura",
"rog_dbus",
"rog_platform",
"rog_profiles",
"rog_supported",
"serde_json",
"smol",
"zbus",
@@ -98,8 +98,8 @@ dependencies = [
"rog_anime",
"rog_aura",
"rog_dbus",
"rog_platform",
"rog_profiles",
"rog_supported",
"sysfs-class",
"tinybmp",
"toml",
@@ -553,7 +553,6 @@ dependencies = [
"rog_dbus",
"rog_platform",
"rog_profiles",
"rog_supported",
"serde",
"serde_derive",
"serde_json",
@@ -571,7 +570,7 @@ dependencies = [
"dirs 4.0.0",
"rog_anime",
"rog_dbus",
"rog_supported",
"rog_platform",
"serde",
"serde_derive",
"serde_json",
@@ -1962,8 +1961,8 @@ dependencies = [
"notify-rust",
"rog_aura",
"rog_dbus",
"rog_platform",
"rog_profiles",
"rog_supported",
"serde",
"serde_derive",
"serde_json",
@@ -2005,8 +2004,8 @@ version = "4.2.1"
dependencies = [
"rog_anime",
"rog_aura",
"rog_platform",
"rog_profiles",
"rog_supported",
"zbus",
"zbus_macros",
"zvariant",
@@ -2017,9 +2016,14 @@ name = "rog_platform"
version = "0.1.0"
dependencies = [
"log",
"rog_aura",
"rusb",
"serde",
"serde_derive",
"sysfs-class",
"udev",
"zvariant",
"zvariant_derive",
]
[[package]]
@@ -2033,17 +2037,6 @@ dependencies = [
"zvariant_derive",
]
[[package]]
name = "rog_supported"
version = "4.2.1"
dependencies = [
"rog_aura",
"serde",
"serde_derive",
"zvariant",
"zvariant_derive",
]
[[package]]
name = "rusb"
version = "0.9.1"

View File

@@ -1,5 +1,5 @@
[workspace]
members = ["asusctl", "asus-notify", "daemon", "daemon-user", "rog-platform", "rog-supported", "rog-dbus", "rog-anime", "rog-aura", "rog-profiles", "rog-control-center"]
members = ["asusctl", "asus-notify", "daemon", "daemon-user", "rog-platform", "rog-dbus", "rog-anime", "rog-aura", "rog-profiles", "rog-control-center"]
[profile.release]
# thin = 57s, asusd = 9.0M

View File

@@ -12,7 +12,7 @@ zbus = "^2.2"
serde_json = "^1.0"
rog_dbus = { path = "../rog-dbus" }
rog_aura = { path = "../rog-aura" }
rog_supported = { path = "../rog-supported" }
rog_platform = { path = "../rog-platform" }
rog_profiles = { path = "../rog-profiles" }
smol = "^1.2"

View File

@@ -12,7 +12,7 @@ rog_anime = { path = "../rog-anime" }
rog_aura = { path = "../rog-aura" }
rog_dbus = { path = "../rog-dbus" }
rog_profiles = { path = "../rog-profiles" }
rog_supported = { path = "../rog-supported" }
rog_platform = { path = "../rog-platform" }
daemon = { path = "../daemon" }
gumdrop = "^0.8"
toml = "^0.5.8"

View File

@@ -14,12 +14,8 @@ use rog_anime::{AnimTime, AnimeDataBuffer, AnimeDiagonal, AnimeGif, AnimeImage,
use rog_aura::usb::{AuraDev1866, AuraDev19b6, AuraDevTuf, AuraDevice, AuraPowerDev};
use rog_aura::{self, AuraEffect};
use rog_dbus::RogDbusClientBlocking;
use rog_platform::supported::*;
use rog_profiles::error::ProfileError;
use rog_supported::SupportedFunctions;
use rog_supported::{
AnimeSupportedFunctions, LedSupportedFunctions, PlatformProfileFunctions,
RogBiosSupportedFunctions,
};
use crate::aura_cli::LedBrightness;
use crate::cli_opts::*;
@@ -102,7 +98,7 @@ fn print_versions() {
println!(" rog-aura v{}", rog_aura::VERSION);
println!(" rog-dbus v{}", rog_dbus::VERSION);
println!(" rog-profiles v{}", rog_profiles::VERSION);
println!("rog-supported v{}", rog_supported::VERSION);
println!("rog-platform v{}", rog_platform::VERSION);
}
fn print_laptop_info() {

View File

@@ -21,7 +21,7 @@ serde_derive = "^1.0"
rog_anime = { path = "../rog-anime" }
rog_dbus = { path = "../rog-dbus" }
rog_supported = { path = "../rog-supported" }
rog_platform = { path = "../rog-platform" }
dirs = "^4.0"

View File

@@ -16,7 +16,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
println!(" user daemon v{}", rog_user::VERSION);
println!(" rog-anime v{}", rog_anime::VERSION);
println!(" rog-dbus v{}", rog_dbus::VERSION);
println!("rog-supported v{}", rog_supported::VERSION);
println!("rog-platform v{}", rog_platform::VERSION);
let (client, _) = RogDbusClientBlocking::new()?;
let supported = client.proxies().supported().supported_functions()?;

View File

@@ -20,7 +20,6 @@ path = "src/daemon.rs"
[dependencies]
rog_anime = { path = "../rog-anime", features = ["dbus"] }
rog_aura = { path = "../rog-aura", features = ["dbus"] }
rog_supported = { path = "../rog-supported" }
rog_platform = { path = "../rog-platform" }
rog_profiles = { path = "../rog-profiles" }
rog_dbus = { path = "../rog-dbus" }

View File

@@ -13,8 +13,7 @@ use rog_anime::{
},
ActionData, AnimeDataBuffer, AnimePacketType, AnimeType,
};
use rog_platform::{hid_raw::HidRaw, usb_raw::USBRaw};
use rog_supported::AnimeSupportedFunctions;
use rog_platform::{hid_raw::HidRaw, supported::AnimeSupportedFunctions, usb_raw::USBRaw};
use smol::{stream::StreamExt, Executor};
use std::sync::atomic::{AtomicBool, Ordering};
use std::{

View File

@@ -11,8 +11,7 @@ use rog_aura::{
AuraEffect, LedBrightness, LED_MSG_LEN,
};
use rog_aura::{AuraZone, Direction, Speed, GRADIENT};
use rog_platform::{hid_raw::HidRaw, keyboard_led::KeyboardLed};
use rog_supported::LedSupportedFunctions;
use rog_platform::{hid_raw::HidRaw, keyboard_led::KeyboardLed, supported::LedSupportedFunctions};
use smol::{stream::StreamExt, Executor};
use std::collections::BTreeMap;
use std::sync::Arc;

View File

@@ -3,7 +3,7 @@ use crate::{config::Config, error::RogError, GetSupported};
use async_trait::async_trait;
use log::{info, warn};
use logind_zbus::manager::ManagerProxy;
use rog_supported::ChargeSupportedFunctions;
use rog_platform::supported::ChargeSupportedFunctions;
use smol::stream::StreamExt;
use smol::Executor;
use std::fs::OpenOptions;

View File

@@ -4,9 +4,9 @@ use crate::error::RogError;
use crate::{CtrlTask, GetSupported};
use async_trait::async_trait;
use log::{info, warn};
use rog_platform::supported::PlatformProfileFunctions;
use rog_profiles::error::ProfileError;
use rog_profiles::{FanCurveProfiles, Profile};
use rog_supported::PlatformProfileFunctions;
use smol::Executor;
use super::config::ProfileConfig;

View File

@@ -2,7 +2,7 @@ use crate::{config::Config, error::RogError, GetSupported};
use async_trait::async_trait;
use log::{error, info, warn};
use rog_platform::platform::AsusPlatform;
use rog_supported::RogBiosSupportedFunctions;
use rog_platform::supported::RogBiosSupportedFunctions;
use std::fs::OpenOptions;
use std::io::BufRead;
use std::io::{Read, Write};

View File

@@ -9,10 +9,7 @@ use crate::{
ctrl_profiles::controller::CtrlPlatformProfile, ctrl_rog_bios::CtrlRogBios, GetSupported,
};
use rog_supported::{
AnimeSupportedFunctions, ChargeSupportedFunctions, LedSupportedFunctions,
PlatformProfileFunctions, RogBiosSupportedFunctions,
};
use rog_platform::supported::*;
#[derive(Serialize, Deserialize, Type)]
pub struct SupportedFunctions {

View File

@@ -59,7 +59,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
info!(" rog-aura v{}", rog_aura::VERSION);
info!(" rog-dbus v{}", rog_dbus::VERSION);
info!(" rog-profiles v{}", rog_profiles::VERSION);
info!("rog-supported v{}", rog_supported::VERSION);
info!("rog-platform v{}", rog_platform::VERSION);
let mut executor = Executor::new();

View File

@@ -15,7 +15,7 @@ eframe= { git = "https://github.com/emilk/egui" }
rog_dbus = { path = "../rog-dbus" }
rog_aura = { path = "../rog-aura" }
rog_profiles = { path = "../rog-profiles" }
rog_supported = { path = "../rog-supported" }
rog_platform = { path = "../rog-platform" }
# supergfxctl = { git = "https://gitlab.com/asus-linux/supergfxctl.git" }
smol = "^1.2"

View File

@@ -8,7 +8,7 @@ use std::{
};
use egui::{Button, RichText};
use rog_supported::SupportedFunctions;
use rog_platform::supported::SupportedFunctions;
use crate::{
config::Config, error::Result, page_states::PageDataStates, Page, RogDbusClientBlocking,

View File

@@ -8,8 +8,8 @@ use std::{
use egui::Vec2;
use rog_aura::{layouts::KeyLayout, usb::AuraPowerDev, AuraEffect, AuraModeNum};
use rog_platform::supported::SupportedFunctions;
use rog_profiles::{fan_curve_set::FanCurveSet, FanCurvePU, Profile};
use rog_supported::SupportedFunctions;
use crate::{error::Result, RogDbusClientBlocking};

View File

@@ -4,8 +4,8 @@ use crate::{
RogApp, RogDbusClientBlocking,
};
use egui::Ui;
use rog_platform::supported::SupportedFunctions;
use rog_profiles::Profile;
use rog_supported::SupportedFunctions;
impl<'a> RogApp<'a> {
pub fn fan_curve_page(&mut self, ctx: &egui::Context) {

View File

@@ -1,5 +1,5 @@
use egui::{RichText, Ui};
use rog_supported::SupportedFunctions;
use rog_platform::supported::SupportedFunctions;
use crate::{page_states::PageDataStates, RogDbusClientBlocking};

View File

@@ -5,7 +5,7 @@ use std::sync::{
use egui::{RichText, Ui};
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, Colour, Speed};
use rog_supported::SupportedFunctions;
use rog_platform::supported::SupportedFunctions;
use crate::{
page_states::{AuraState, PageDataStates},

View File

@@ -3,7 +3,7 @@ use rog_aura::{
usb::{AuraDev1866, AuraDev19b6, AuraDevTuf, AuraDevice, AuraPowerDev},
AuraZone,
};
use rog_supported::SupportedFunctions;
use rog_platform::supported::SupportedFunctions;
use crate::{page_states::PageDataStates, RogDbusClientBlocking};

View File

@@ -1,7 +1,7 @@
use crate::{page_states::PageDataStates, RogDbusClientBlocking};
use egui::Ui;
use rog_platform::supported::SupportedFunctions;
use rog_profiles::Profile;
use rog_supported::SupportedFunctions;
pub fn platform_profile(states: &mut PageDataStates, dbus: &RogDbusClientBlocking, ui: &mut Ui) {
ui.heading("Platform profile");

View File

@@ -13,7 +13,7 @@ edition = "2018"
rog_anime = { path = "../rog-anime" }
rog_aura = { path = "../rog-aura" }
rog_profiles = { path = "../rog-profiles" }
rog_supported = { path = "../rog-supported" }
rog_platform = { path = "../rog-platform" }
zbus = "^2.2"
zbus_macros = "^2.0"
zvariant = "^3.0"

View File

@@ -19,7 +19,7 @@
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use rog_supported::SupportedFunctions;
use rog_platform::supported::SupportedFunctions;
use zbus_macros::dbus_proxy;
#[dbus_proxy(

View File

@@ -7,6 +7,13 @@ edition = "2021"
[dependencies]
log = "*"
rog_aura = { path = "../rog-aura" }
serde = "^1.0"
serde_derive = "^1.0"
zvariant = "^3.0"
zvariant_derive = "^3.0"
udev = "^0.6"
rusb = "^0.9"
sysfs-class = "^0.1"

View File

@@ -2,6 +2,7 @@ pub mod error;
pub mod hid_raw;
pub mod keyboard_led;
pub mod platform;
pub mod supported;
pub mod usb_raw;
use std::path::Path;
@@ -9,6 +10,8 @@ use std::path::Path;
use error::{PlatformError, Result};
use udev::Device;
pub static VERSION: &str = env!("CARGO_PKG_VERSION");
#[macro_export]
macro_rules! attr_bool {
($hasser:ident, $getter:ident, $setter:ident, $attr_name:literal) => {

View File

@@ -1,5 +1,3 @@
pub static VERSION: &str = env!("CARGO_PKG_VERSION");
use rog_aura::{usb::AuraDevice, AuraModeNum, AuraZone};
use serde_derive::{Deserialize, Serialize};
use std::fmt;

View File

@@ -1,17 +0,0 @@
[package]
name = "rog_supported"
version = "4.2.1"
license = "MPL-2.0"
readme = "README.md"
authors = ["Luke <luke@ljones.dev>"]
repository = "https://gitlab.com/asus-linux/asus-nb-ctrl"
homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl"
description = "Helper to determine what is supported by asus laptops"
edition = "2018"
[dependencies]
rog_aura = { path = "../rog-aura" }
serde = "^1.0"
serde_derive = "^1.0"
zvariant = "^3.0"
zvariant_derive = "^3.0"