summaryrefslogtreecommitdiff
path: root/kvmd/usb.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-03-31 04:25:37 +0300
committerMaxim Devaev <[email protected]>2022-03-31 04:40:24 +0300
commitc4ca7011bfdb0f24621ef4474eeec4d8d878bf84 (patch)
tree3cae868fa54e8b9cd5b44bbd23c696673f61b4ac /kvmd/usb.py
parent94dca7d7c677b62b1e8645afcf721118c7a60833 (diff)
removed UsbDeviceController() class
Diffstat (limited to 'kvmd/usb.py')
-rw-r--r--kvmd/usb.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/kvmd/usb.py b/kvmd/usb.py
index 1f60ba75..4242b1cb 100644
--- a/kvmd/usb.py
+++ b/kvmd/usb.py
@@ -22,8 +22,6 @@
import os
-from .logging import get_logger
-
from . import env
@@ -38,20 +36,3 @@ def find_udc(udc: str) -> str:
elif udc not in candidates:
raise RuntimeError(f"Can't find selected UDC: {udc}")
return udc # fe980000.usb
-
-
-class UsbDeviceController:
- def __init__(self, udc: str) -> None:
- self.__udc = udc
- self.__state_path = ""
-
- def find(self) -> None:
- udc = find_udc(self.__udc)
- self.__state_path = os.path.join(f"{env.SYSFS_PREFIX}/sys/class/udc", udc, "state")
- get_logger().info("Using UDC %s", udc)
-
- def can_operate(self) -> bool:
- assert self.__state_path
- with open(self.__state_path, "r") as state_file:
- # https://www.maxlinear.com/Files/Documents/an213_033111.pdf
- return (state_file.read().strip().lower() == "configured")