summaryrefslogtreecommitdiff
path: root/kvmd/plugins/hid/spi.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/plugins/hid/spi.py')
-rw-r--r--kvmd/plugins/hid/spi.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/kvmd/plugins/hid/spi.py b/kvmd/plugins/hid/spi.py
index dadcc77e..cf58b5de 100644
--- a/kvmd/plugins/hid/spi.py
+++ b/kvmd/plugins/hid/spi.py
@@ -57,9 +57,9 @@ class _SpiPhyConnection(BasePhyConnection):
self.__xfer = xfer
self.__read_timeout = read_timeout
- def send(self, request: bytes) -> bytes:
- assert len(request) == 8
- assert request[0] == 0x33
+ def send(self, req: bytes) -> bytes:
+ assert len(req) == 8
+ assert req[0] == 0x33
deadline_ts = time.monotonic() + self.__read_timeout
dummy = b"\x00" * 10
@@ -70,26 +70,26 @@ class _SpiPhyConnection(BasePhyConnection):
get_logger(0).error("SPI timeout reached while garbage reading")
return b""
- self.__xfer(request)
+ self.__xfer(req)
- response: list[int] = []
+ resp: list[int] = []
deadline_ts = time.monotonic() + self.__read_timeout
found = False
while time.monotonic() < deadline_ts:
- for byte in self.__xfer(b"\x00" * (9 - len(response))):
+ for byte in self.__xfer(b"\x00" * (9 - len(resp))):
if not found:
if byte == 0:
continue
found = True
- response.append(byte)
- if len(response) == 8:
+ resp.append(byte)
+ if len(resp) == 8:
break
- if len(response) == 8:
+ if len(resp) == 8:
break
else:
get_logger(0).error("SPI timeout reached while responce waiting")
return b""
- return bytes(response)
+ return bytes(resp)
class _SpiPhy(BasePhy): # pylint: disable=too-many-instance-attributes