diff options
author | Devaev Maxim <[email protected]> | 2020-10-29 13:51:58 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-11-11 22:24:25 +0300 |
commit | a5dbc1adeaa0d790206580d5f94c7503808ea1f0 (patch) | |
tree | ddb8d85b841cf075eafffbdf24e98f7cbfc0be70 /kvmd/plugins/hid/serial.py | |
parent | aaef672ac2ce5dd2cee17ad571e6cab35f284ee4 (diff) |
refactoring
Diffstat (limited to 'kvmd/plugins/hid/serial.py')
-rw-r--r-- | kvmd/plugins/hid/serial.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kvmd/plugins/hid/serial.py b/kvmd/plugins/hid/serial.py index d5de1cc7..9bfafc69 100644 --- a/kvmd/plugins/hid/serial.py +++ b/kvmd/plugins/hid/serial.py @@ -45,11 +45,12 @@ class _SerialPhyConnection(BasePhyConnection): def __init__(self, tty: serial.Serial) -> None: self.__tty = tty - def send(self, request: bytes, receive: int) -> bytes: + def send(self, request: bytes) -> bytes: + assert len(request) == 8 if self.__tty.in_waiting: self.__tty.read_all() - assert self.__tty.write(request) == len(request) - return self.__tty.read(receive) + assert self.__tty.write(request) == 8 + return self.__tty.read(4) class _SerialPhy(BasePhy): |