mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 03:32:00 +08:00
fix: 修正 iConfiguration 描述字符串
This commit is contained in:
@@ -300,7 +300,10 @@ impl OtgGadgetManager {
|
|||||||
|
|
||||||
let strings_path = self.config_path.join("strings/0x409");
|
let strings_path = self.config_path.join("strings/0x409");
|
||||||
create_dir(&strings_path)?;
|
create_dir(&strings_path)?;
|
||||||
write_file(&strings_path.join("configuration"), "Config 1: HID + MSD")?;
|
write_file(
|
||||||
|
&strings_path.join("configuration"),
|
||||||
|
self.configuration_label(),
|
||||||
|
)?;
|
||||||
|
|
||||||
write_file(&self.config_path.join("MaxPower"), "500")?;
|
write_file(&self.config_path.join("MaxPower"), "500")?;
|
||||||
|
|
||||||
@@ -308,6 +311,18 @@ impl OtgGadgetManager {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn configuration_label(&self) -> &'static str {
|
||||||
|
if self
|
||||||
|
.functions
|
||||||
|
.iter()
|
||||||
|
.any(|func| func.name().starts_with("mass_storage."))
|
||||||
|
{
|
||||||
|
"Config 1: HID + MSD"
|
||||||
|
} else {
|
||||||
|
"Config 1: HID"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn gadget_path(&self) -> &PathBuf {
|
pub fn gadget_path(&self) -> &PathBuf {
|
||||||
&self.gadget_path
|
&self.gadget_path
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user