mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Attempt to get multi-static working
This commit is contained in:
@@ -82,6 +82,26 @@ impl AuraDbusWriter {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn write_multizone(
|
||||
&mut self,
|
||||
group: &[[u8; LED_MSG_LEN]; 4],
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
self.connection.process(Duration::from_micros(300))?;
|
||||
|
||||
let msg = Message::new_method_call(DBUS_NAME, DBUS_PATH, DBUS_IFACE, "LedWriteEffect")?
|
||||
.append1(&group[0].to_vec())
|
||||
.append1(&group[1].to_vec())
|
||||
.append1(&group[2].to_vec())
|
||||
.append1(&group[3].to_vec());
|
||||
self.connection.send(msg).unwrap();
|
||||
thread::sleep(Duration::from_millis(self.block_time));
|
||||
if self.stop.load(Ordering::Relaxed) {
|
||||
panic!("Go signal to stop!");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn write_bytes(&self, bytes: &[u8]) -> Result<String, Box<dyn std::error::Error>> {
|
||||
let msg = Message::new_method_call(DBUS_NAME, DBUS_PATH, DBUS_IFACE, "LedWriteBytes")?
|
||||
|
||||
@@ -107,6 +107,7 @@ pub enum BuiltInModeByte {
|
||||
Pulse = 0x0a,
|
||||
ThinZoomy = 0x0b,
|
||||
WideZoomy = 0x0c,
|
||||
MultiStatic,
|
||||
None,
|
||||
}
|
||||
impl Default for BuiltInModeByte {
|
||||
@@ -160,6 +161,7 @@ impl From<BuiltInModeByte> for u8 {
|
||||
BuiltInModeByte::Pulse => 0x0a,
|
||||
BuiltInModeByte::ThinZoomy => 0x0b,
|
||||
BuiltInModeByte::WideZoomy => 0x0c,
|
||||
BuiltInModeByte::MultiStatic => 0x00,
|
||||
BuiltInModeByte::None => 0xff,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user