1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-19 08:39:03 +00:00

fixup! chore(core): adapt trezorlib transports to session based [no changelog]

This commit is contained in:
Roman Zeyde 2025-03-20 14:12:16 +02:00 committed by M1nd3r
parent 821e6b9fce
commit d12bf422f3

View File

@ -84,11 +84,11 @@ class ProtocolV1Channel(Channel):
buffer = bytearray(b"##" + header + message_data)
while buffer:
# Report ID, data padded to 63 bytes
# Report ID, data padded to (chunk_size - 1) bytes
chunk = b"?" + buffer[: chunk_size - 1]
chunk = chunk.ljust(chunk_size, b"\x00")
self.transport.write_chunk(chunk)
buffer = buffer[63:]
buffer = buffer[chunk_size - 1:]
def _read(self, timeout: float | None = None) -> t.Tuple[int, bytes]:
if timeout is None: