Add extra models to ledmodes

- Configurable anime example
- Gfx power states as enum

Closes #72
This commit is contained in:
Luke D Jones
2021-03-29 19:36:30 +13:00
parent fbc248177a
commit 7ff01f12e9
52 changed files with 2983 additions and 564 deletions

View File

@@ -19,7 +19,7 @@
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use rog_types::anime_matrix::{AniMeDataBuffer, AniMeImageBuffer};
use rog_anime::AniMeDataBuffer;
use zbus::{dbus_proxy, Connection, Result};
#[dbus_proxy(
@@ -34,10 +34,7 @@ trait Daemon {
fn set_on_off(&self, status: bool) -> zbus::Result<()>;
/// WriteDirect method
fn write_direct(&self, input: &[u8]) -> zbus::Result<()>;
/// WriteImage method
fn write_image(&self, input: &[Vec<u8>]) -> zbus::Result<()>;
fn write(&self, input: &[u8]) -> zbus::Result<()>;
}
pub struct AnimeProxy<'a>(DaemonProxy<'a>);
@@ -63,12 +60,7 @@ impl<'a> AnimeProxy<'a> {
}
#[inline]
pub fn write_direct(&self, input: AniMeDataBuffer) -> Result<()> {
self.0.write_direct(input.get())
}
#[inline]
pub fn write_image(&self, input: AniMeImageBuffer) -> Result<()> {
self.0.write_image(input.get())
pub fn write(&self, input: AniMeDataBuffer) -> Result<()> {
self.0.write(input.get())
}
}

View File

@@ -21,7 +21,7 @@
use std::sync::{Arc, Mutex};
use rog_types::gfx_vendors::{GfxRequiredUserAction, GfxVendors};
use rog_types::gfx_vendors::{GfxPower, GfxRequiredUserAction, GfxVendors};
use zbus::{dbus_proxy, Connection, Result};
#[dbus_proxy(
@@ -30,7 +30,7 @@ use zbus::{dbus_proxy, Connection, Result};
)]
trait Daemon {
/// Power method
fn power(&self) -> zbus::Result<String>;
fn power(&self) -> zbus::Result<GfxPower>;
/// SetVendor method
fn set_vendor(&self, vendor: &GfxVendors) -> zbus::Result<GfxRequiredUserAction>;
@@ -60,7 +60,7 @@ impl<'a> GfxProxy<'a> {
}
#[inline]
pub fn gfx_get_pwr(&self) -> Result<String> {
pub fn gfx_get_pwr(&self) -> Result<GfxPower> {
self.0.power()
}