Refactor: Make all Aura type devices use "device_manager"

Open the door to adding many other types of "aura" devices later.
This commit is contained in:
Luke D. Jones
2024-11-04 08:55:37 +01:00
parent 0ddfe76c31
commit 19ffcf3376
48 changed files with 2349 additions and 2240 deletions

View File

@@ -247,19 +247,19 @@ impl From<AnimShutdown> for i32 {
///
/// The currently known USB device is `19b6`.
#[inline]
pub fn get_maybe_anime_type() -> Result<AnimeType, AnimeError> {
let dmi = DMIID::new().map_err(|_| AnimeError::NoDevice)?; // TODO: better error
pub fn get_anime_type() -> AnimeType {
let dmi = DMIID::new().unwrap_or_default();
let board_name = dmi.board_name;
if board_name.contains("GA401I") || board_name.contains("GA401Q") {
return Ok(AnimeType::GA401);
AnimeType::GA401
} else if board_name.contains("GA402R") || board_name.contains("GA402X") {
return Ok(AnimeType::GA402);
AnimeType::GA402
} else if board_name.contains("GU604V") {
return Ok(AnimeType::GU604);
AnimeType::GU604
} else {
AnimeType::Unsupported
}
log::warn!("AniMe Matrix device found but could be a slash");
Ok(AnimeType::Unsupported)
}
/// Get the two device initialization packets. These are required for device