mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Add slash support for additional ga403 2025 models
This commit is contained in:
@@ -13,7 +13,7 @@ use crate::usb::{PROD_ID1, PROD_ID1_STR, PROD_ID2, PROD_ID2_STR};
|
|||||||
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub enum SlashType {
|
pub enum SlashType {
|
||||||
GA403,
|
GA403,
|
||||||
GA403W,
|
GA403_2025,
|
||||||
GA605,
|
GA605,
|
||||||
GU605,
|
GU605,
|
||||||
GU605C,
|
GU605C,
|
||||||
@@ -25,7 +25,7 @@ pub enum SlashType {
|
|||||||
impl SlashType {
|
impl SlashType {
|
||||||
pub const fn prod_id(&self) -> u16 {
|
pub const fn prod_id(&self) -> u16 {
|
||||||
match self {
|
match self {
|
||||||
SlashType::GA403W => PROD_ID2,
|
SlashType::GA403_2025 => PROD_ID2,
|
||||||
SlashType::GA403 => PROD_ID1,
|
SlashType::GA403 => PROD_ID1,
|
||||||
SlashType::GA605 => PROD_ID2,
|
SlashType::GA605 => PROD_ID2,
|
||||||
SlashType::GU605 => PROD_ID1,
|
SlashType::GU605 => PROD_ID1,
|
||||||
@@ -37,7 +37,7 @@ impl SlashType {
|
|||||||
|
|
||||||
pub const fn prod_id_str(&self) -> &str {
|
pub const fn prod_id_str(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
SlashType::GA403W => PROD_ID2_STR,
|
SlashType::GA403_2025 => PROD_ID2_STR,
|
||||||
SlashType::GA403 => PROD_ID1_STR,
|
SlashType::GA403 => PROD_ID1_STR,
|
||||||
SlashType::GA605 => PROD_ID2_STR,
|
SlashType::GA605 => PROD_ID2_STR,
|
||||||
SlashType::GU605 => PROD_ID1_STR,
|
SlashType::GU605 => PROD_ID1_STR,
|
||||||
@@ -51,8 +51,8 @@ impl SlashType {
|
|||||||
let board_name = DMIID::new().unwrap_or_default().board_name.to_uppercase();
|
let board_name = DMIID::new().unwrap_or_default().board_name.to_uppercase();
|
||||||
if board_name.contains("G614F") {
|
if board_name.contains("G614F") {
|
||||||
SlashType::G614F
|
SlashType::G614F
|
||||||
} else if board_name.contains("GA403W") {
|
} else if ["GA403W", "GA403UH", "GA403UM", "GA403UP"].iter().any(|s| board_name.contains(s)) {
|
||||||
SlashType::GA403W
|
SlashType::GA403_2025
|
||||||
} else if board_name.contains("GA403") {
|
} else if board_name.contains("GA403") {
|
||||||
SlashType::GA403
|
SlashType::GA403
|
||||||
} else if board_name.contains("GA605") {
|
} else if board_name.contains("GA605") {
|
||||||
@@ -72,7 +72,7 @@ impl FromStr for SlashType {
|
|||||||
|
|
||||||
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
||||||
Ok(match s.to_uppercase().as_str() {
|
Ok(match s.to_uppercase().as_str() {
|
||||||
"GA403W" => Self::GA403W,
|
"GA403_2025" => Self::GA403_2025,
|
||||||
"GA403" => Self::GA403,
|
"GA403" => Self::GA403,
|
||||||
"GA605" => Self::GA605,
|
"GA605" => Self::GA605,
|
||||||
"GU605C" => Self::GU605C,
|
"GU605C" => Self::GU605C,
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ pub fn get_slash_type() -> SlashType {
|
|||||||
let board_name = dmi.board_name.to_uppercase();
|
let board_name = dmi.board_name.to_uppercase();
|
||||||
if board_name.contains("G614F") {
|
if board_name.contains("G614F") {
|
||||||
SlashType::G614F
|
SlashType::G614F
|
||||||
} else if board_name.contains("GA403W") {
|
} else if ["GA403W", "GA403UH", "GA403UM", "GA403UP"].iter().any(|s| board_name.contains(s)) {
|
||||||
SlashType::GA403W
|
SlashType::GA403_2025
|
||||||
} else if board_name.contains("GA403") {
|
} else if board_name.contains("GA403") {
|
||||||
SlashType::GA403
|
SlashType::GA403
|
||||||
} else if board_name.contains("GA605") {
|
} else if board_name.contains("GA605") {
|
||||||
@@ -57,7 +57,7 @@ pub fn get_slash_type() -> SlashType {
|
|||||||
|
|
||||||
pub const fn report_id(slash_type: SlashType) -> u8 {
|
pub const fn report_id(slash_type: SlashType) -> u8 {
|
||||||
match slash_type {
|
match slash_type {
|
||||||
SlashType::GA403W => REPORT_ID_19B6,
|
SlashType::GA403_2025 => REPORT_ID_19B6,
|
||||||
SlashType::GA403 => REPORT_ID_193B,
|
SlashType::GA403 => REPORT_ID_193B,
|
||||||
SlashType::GA605 => REPORT_ID_19B6,
|
SlashType::GA605 => REPORT_ID_19B6,
|
||||||
SlashType::G614F => REPORT_ID_19B6,
|
SlashType::G614F => REPORT_ID_19B6,
|
||||||
|
|||||||
Reference in New Issue
Block a user