Unify the aura data more. Prep for better format

This commit is contained in:
Luke D. Jones
2024-08-30 21:29:13 +12:00
parent 8f35220c5f
commit 4a97f173be
4 changed files with 153 additions and 195 deletions

View File

@@ -17,6 +17,7 @@ pub struct HidRaw {
syspath: PathBuf,
/// The product ID. The vendor ID is not kept
prod_id: String,
device_bcd: u32,
/// Retaining a handle to the file for the duration of `HidRaw`
file: RefCell<File>,
}
@@ -52,6 +53,12 @@ impl HidRaw {
devfs_path: dev_node.to_owned(),
prod_id: id_product.to_string(),
syspath: endpoint.syspath().into(),
device_bcd: usb_device
.attribute_value("bcdDevice")
.unwrap_or_default()
.to_string_lossy()
.parse()
.unwrap_or_default(),
});
}
}
@@ -70,6 +77,12 @@ impl HidRaw {
devfs_path: dev_node.to_owned(),
prod_id: id_product.to_string(),
syspath: endpoint.syspath().into(),
device_bcd: endpoint
.attribute_value("bcdDevice")
.unwrap_or_default()
.to_string_lossy()
.parse()
.unwrap_or_default(),
});
}
}
@@ -94,6 +107,12 @@ impl HidRaw {
devfs_path: dev_node.to_owned(),
prod_id: id_product.to_string_lossy().into(),
syspath: device.syspath().into(),
device_bcd: device
.attribute_value("bcdDevice")
.unwrap_or_default()
.to_string_lossy()
.parse()
.unwrap_or_default(),
});
}
}