diff options
author | Devaev Maxim <[email protected]> | 2019-02-07 16:50:23 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-02-07 16:50:23 +0300 |
commit | fb235dd3a89ceb0b3f9d6f6b3e0ec84c9520f6ef (patch) | |
tree | ac3fd4bd90f893732167d96fb1c4be369f8d9474 /kvmd | |
parent | 4c0683735aed2fb5ea85feccdc214d22ecfcdd9d (diff) |
hid: fixed command processing
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/kvmd/hid.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kvmd/apps/kvmd/hid.py b/kvmd/apps/kvmd/hid.py index 3f329c64..b1b10422 100644 --- a/kvmd/apps/kvmd/hid.py +++ b/kvmd/apps/kvmd/hid.py @@ -202,7 +202,7 @@ class Hid(multiprocessing.Process): # pylint: disable=too-many-instance-attribu if os.path.exists(self.__device_path): try: with self.__get_serial() as tty: - self.__process_request(tty, b"\x10\x00\x00\x00\x00") + self.__process_command(tty, b"\x10\x00\x00\x00\x00") except Exception: get_logger().exception("Can't execute emergency clear HID events") @@ -217,12 +217,12 @@ class Hid(multiprocessing.Process): # pylint: disable=too-many-instance-attribu event = self.__events_queue.get(timeout=0.05) except queue.Empty: if passed >= 20: # 20 * 0.05 = 1 sec - self.__process_request(tty, b"\x01\x00\x00\x00\x00") # Ping + self.__process_command(tty, b"\x01\x00\x00\x00\x00") # Ping passed = 0 else: passed += 1 else: - self.__process_request(tty, event.make_command()) + self.__process_command(tty, event.make_command()) passed = 0 except Exception: get_logger().exception("Unhandled exception") @@ -231,7 +231,7 @@ class Hid(multiprocessing.Process): # pylint: disable=too-many-instance-attribu def __get_serial(self) -> serial.Serial: return serial.Serial(self.__device_path, self.__speed, timeout=self.__read_timeout) - def __process(self, tty: serial.Serial, command: bytes) -> None: + def __process_command(self, tty: serial.Serial, command: bytes) -> None: self.__process_request(tty, self.__make_request(command)) def __process_request(self, tty: serial.Serial, request: bytes) -> None: # pylint: disable=too-many-branches |