mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Final round of fixes for new version
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rog-daemon"
|
||||
version = "0.10.0"
|
||||
version = "0.11.0"
|
||||
license = "MPL-2.0"
|
||||
readme = "README.md"
|
||||
authors = ["Luke <luke@ljones.dev>"]
|
||||
@@ -18,7 +18,7 @@ name = "rog-core"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
rog-aura = { path = "../aura" }
|
||||
rog-client = { path = "../rog-client" }
|
||||
rusb = "^0.5.5"
|
||||
|
||||
# cli and logging
|
||||
|
||||
@@ -9,12 +9,13 @@ const INIT: u8 = 0xc2;
|
||||
const APPLY: u8 = 0xc3;
|
||||
const SET: u8 = 0xc4;
|
||||
|
||||
use log::error;
|
||||
use rog_aura::error::AuraError;
|
||||
use log::{error, warn};
|
||||
use rog_client::error::AuraError;
|
||||
use rusb::DeviceHandle;
|
||||
use std::error::Error;
|
||||
use std::time::Duration;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug)]
|
||||
pub enum AnimatrixCommand {
|
||||
Apply,
|
||||
@@ -33,9 +34,10 @@ impl AniMeWriter {
|
||||
pub fn new() -> Result<AniMeWriter, Box<dyn Error>> {
|
||||
// We don't expect this ID to ever change
|
||||
let mut dev_handle = AniMeWriter::get_device(0x0b05, 0x193b).map_err(|err| {
|
||||
error!("Could not get AniMe display handle: {:?}", err);
|
||||
warn!("Could not get AniMe display handle: {:?}", err);
|
||||
err
|
||||
})?;
|
||||
dev_handle.reset()?;
|
||||
// This config seems to be the required device config for writing
|
||||
dev_handle.set_active_configuration(1).unwrap_or(());
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use rog_aura::BuiltInModeBytes;
|
||||
use rog_client::BuiltInModeBytes;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::{Read, Write};
|
||||
|
||||
@@ -11,7 +11,7 @@ use dbus::{channel::Sender, nonblock::Process};
|
||||
|
||||
use dbus_tokio::connection;
|
||||
use log::{error, info, warn};
|
||||
use rog_aura::{DBUS_IFACE, DBUS_PATH};
|
||||
use rog_client::{DBUS_IFACE, DBUS_PATH};
|
||||
use std::error::Error;
|
||||
use std::sync::{mpsc, Arc};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::{config::Config, led_control::AuraCommand, rogcore::RogCore};
|
||||
use rog_aura::{error::AuraError, BuiltInModeByte};
|
||||
use rog_client::{error::AuraError, BuiltInModeByte};
|
||||
//use keycode::{KeyMap, KeyMappingId, KeyState, KeyboardState};
|
||||
use crate::virt_device::ConsumerKeys;
|
||||
use log::{info, warn};
|
||||
@@ -25,7 +25,7 @@ pub(crate) fn match_laptop() -> LaptopBase {
|
||||
supported_modes: vec![
|
||||
BuiltInModeByte::Single,
|
||||
BuiltInModeByte::Breathing,
|
||||
BuiltInModeByte::Cycle,
|
||||
BuiltInModeByte::Strobe,
|
||||
],
|
||||
support_animatrix: false,
|
||||
// backlight: Backlight::new("intel_backlight").unwrap(),
|
||||
@@ -61,16 +61,16 @@ fn choose_1866_device(prod: u16) -> LaptopBase {
|
||||
laptop.supported_modes = vec![
|
||||
BuiltInModeByte::Single,
|
||||
BuiltInModeByte::Breathing,
|
||||
BuiltInModeByte::Cycle,
|
||||
BuiltInModeByte::Strobe,
|
||||
BuiltInModeByte::Rainbow,
|
||||
BuiltInModeByte::Star,
|
||||
BuiltInModeByte::Rain,
|
||||
BuiltInModeByte::Random,
|
||||
BuiltInModeByte::Highlight,
|
||||
BuiltInModeByte::Laser,
|
||||
BuiltInModeByte::Ripple,
|
||||
BuiltInModeByte::Pulse,
|
||||
BuiltInModeByte::ThinZoomy,
|
||||
BuiltInModeByte::WideZoomy,
|
||||
BuiltInModeByte::Comet,
|
||||
BuiltInModeByte::Flash,
|
||||
];
|
||||
}
|
||||
"GM501" => {
|
||||
@@ -78,7 +78,7 @@ fn choose_1866_device(prod: u16) -> LaptopBase {
|
||||
laptop.supported_modes = vec![
|
||||
BuiltInModeByte::Single,
|
||||
BuiltInModeByte::Breathing,
|
||||
BuiltInModeByte::Cycle,
|
||||
BuiltInModeByte::Strobe,
|
||||
BuiltInModeByte::Rainbow,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ static LED_SET: [u8; 17] = [0x5d, 0xb5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
|
||||
use crate::config::Config;
|
||||
use log::{error, info, warn};
|
||||
use rog_aura::{aura_brightness_bytes, error::AuraError, BuiltInModeByte};
|
||||
use rog_client::{aura_brightness_bytes, error::AuraError, BuiltInModeByte};
|
||||
use rusb::DeviceHandle;
|
||||
use std::marker::PhantomData;
|
||||
use std::ptr::NonNull;
|
||||
|
||||
@@ -3,12 +3,12 @@ use daemon::rogcore::FanLevel;
|
||||
use env_logger::{Builder, Target};
|
||||
use gumdrop::Options;
|
||||
use log::LevelFilter;
|
||||
use rog_aura::{
|
||||
use rog_client::{
|
||||
cli_options::{LedBrightness, SetAuraBuiltin},
|
||||
AuraDbusWriter, LED_MSG_LEN,
|
||||
};
|
||||
|
||||
static VERSION: &str = "0.10.0";
|
||||
static VERSION: &str = "0.11.0";
|
||||
|
||||
#[derive(Debug, Options)]
|
||||
struct CLIStart {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::daemon::{FanModeType, LedMsgType, NestedVecType};
|
||||
use crate::rogcore::FanLevel;
|
||||
use dbus::tree::{Factory, MTSync, Method, MethodErr, Signal, Tree};
|
||||
use rog_aura::{DBUS_IFACE, DBUS_PATH};
|
||||
use rog_client::{DBUS_IFACE, DBUS_PATH};
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
|
||||
@@ -35,13 +35,14 @@ pub struct RogCore {
|
||||
impl RogCore {
|
||||
pub fn new(vendor: u16, product: u16, led_endpoint: u8) -> Result<RogCore, Box<dyn Error>> {
|
||||
let mut dev_handle = RogCore::get_device(vendor, product).map_err(|err| {
|
||||
error!("Could not get device handle: {:?}", err);
|
||||
error!("Could not get keyboard device handle: {:?}", err);
|
||||
err
|
||||
})?;
|
||||
dev_handle.reset()?;
|
||||
dev_handle.set_active_configuration(0).unwrap_or(());
|
||||
|
||||
let dev_config = dev_handle.device().config_descriptor(0).map_err(|err| {
|
||||
error!("Could not get device config: {:?}", err);
|
||||
error!("Could not get keyboard device config: {:?}", err);
|
||||
err
|
||||
})?;
|
||||
// Interface with outputs
|
||||
@@ -69,7 +70,7 @@ impl RogCore {
|
||||
err
|
||||
})?;
|
||||
dev_handle.claim_interface(interface).map_err(|err| {
|
||||
error!("Could not claim device interface: {:?}", err);
|
||||
error!("Could not claim keyboard device interface: {:?}", err);
|
||||
err
|
||||
})?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user