mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
add some otg info
This commit is contained in:
parent
b2c5305564
commit
00ed5197b0
@ -112,7 +112,7 @@ class _GadgetConfig:
|
|||||||
self.__msd_instance = 0
|
self.__msd_instance = 0
|
||||||
_mkdir(meta_path)
|
_mkdir(meta_path)
|
||||||
|
|
||||||
def add_audio_capture(self, start: bool) -> None:
|
def add_audio_mic(self, start: bool) -> None:
|
||||||
eps = 2
|
eps = 2
|
||||||
func = "uac2.usb0"
|
func = "uac2.usb0"
|
||||||
func_path = self.__create_function(func)
|
func_path = self.__create_function(func)
|
||||||
@ -122,7 +122,7 @@ class _GadgetConfig:
|
|||||||
_write(join(func_path, "p_ssize"), 2)
|
_write(join(func_path, "p_ssize"), 2)
|
||||||
if start:
|
if start:
|
||||||
self.__start_function(func, eps)
|
self.__start_function(func, eps)
|
||||||
self.__create_meta(func, "Audio Capture", eps)
|
self.__create_meta(func, "Microphone", eps)
|
||||||
|
|
||||||
def add_serial(self, start: bool) -> None:
|
def add_serial(self, start: bool) -> None:
|
||||||
eps = 3
|
eps = 3
|
||||||
@ -308,8 +308,8 @@ def _cmd_start(config: Section) -> None: # pylint: disable=too-many-statements,
|
|||||||
gc.add_serial(cod.serial.start)
|
gc.add_serial(cod.serial.start)
|
||||||
|
|
||||||
if cod.audio.enabled:
|
if cod.audio.enabled:
|
||||||
logger.info("===== Audio Capture =====")
|
logger.info("===== Microphone =====")
|
||||||
gc.add_audio_capture(cod.audio.start)
|
gc.add_audio_mic(cod.audio.start)
|
||||||
|
|
||||||
logger.info("===== Preparing complete =====")
|
logger.info("===== Preparing complete =====")
|
||||||
|
|
||||||
|
|||||||
@ -134,6 +134,7 @@ class _GadgetControl:
|
|||||||
funcs = list(self.__read_metas())
|
funcs = list(self.__read_metas())
|
||||||
eps_used = sum(func.eps for func in funcs if func.enabled)
|
eps_used = sum(func.eps for func in funcs if func.enabled)
|
||||||
print(f"# Endpoints used: {eps_used} of {self.__eps}")
|
print(f"# Endpoints used: {eps_used} of {self.__eps}")
|
||||||
|
print(f"# Endpoints free: {self.__eps - eps_used}")
|
||||||
for func in funcs:
|
for func in funcs:
|
||||||
print(f"{'+' if func.enabled else '-'} {func.name} # [{func.eps}] {func.desc}")
|
print(f"{'+' if func.enabled else '-'} {func.name} # [{func.eps}] {func.desc}")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user