mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
configurable bcdUSB
This commit is contained in:
parent
49faa1d28e
commit
066a2a4625
@ -478,6 +478,7 @@ def _get_config_scheme() -> Dict:
|
|||||||
"manufacturer": Option("Pi-KVM"),
|
"manufacturer": Option("Pi-KVM"),
|
||||||
"product": Option("Composite KVM Device"),
|
"product": Option("Composite KVM Device"),
|
||||||
"serial": Option("CAFEBABE"),
|
"serial": Option("CAFEBABE"),
|
||||||
|
"usb_version": Option(0x0200, type=valid_otg_id),
|
||||||
"remote_wakeup": Option(False, type=valid_bool),
|
"remote_wakeup": Option(False, type=valid_bool),
|
||||||
|
|
||||||
"gadget": Option("kvmd", type=valid_otg_gadget),
|
"gadget": Option("kvmd", type=valid_otg_gadget),
|
||||||
|
|||||||
@ -172,10 +172,10 @@ def _cmd_start(config: Section) -> None: # pylint: disable=too-many-statements
|
|||||||
gadget_path = join(f"{env.SYSFS_PREFIX}/sys/kernel/config/usb_gadget", config.otg.gadget)
|
gadget_path = join(f"{env.SYSFS_PREFIX}/sys/kernel/config/usb_gadget", config.otg.gadget)
|
||||||
_mkdir(gadget_path)
|
_mkdir(gadget_path)
|
||||||
|
|
||||||
_write(join(gadget_path, "idVendor"), f"0x{config.otg.vendor_id:X}")
|
_write(join(gadget_path, "idVendor"), f"0x{config.otg.vendor_id:04X}")
|
||||||
_write(join(gadget_path, "idProduct"), f"0x{config.otg.product_id:X}")
|
_write(join(gadget_path, "idProduct"), f"0x{config.otg.product_id:04X}")
|
||||||
_write(join(gadget_path, "bcdDevice"), "0x0100")
|
_write(join(gadget_path, "bcdDevice"), "0x0100")
|
||||||
_write(join(gadget_path, "bcdUSB"), "0x0200")
|
_write(join(gadget_path, "bcdUSB"), f"0x{config.otg.usb_version:04X}")
|
||||||
|
|
||||||
lang_path = join(gadget_path, "strings/0x409")
|
lang_path = join(gadget_path, "strings/0x409")
|
||||||
_mkdir(lang_path)
|
_mkdir(lang_path)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user