mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-18 12:38:37 +00:00
fixup! fixup! feat(python): use dbus-next for BLE
This commit is contained in:
parent
a9ddd9d1ef
commit
2d15e9e770
@ -91,7 +91,7 @@ class BleTransport(ProtocolBasedTransport):
|
|||||||
self.ble().write(chunk)
|
self.ble().write(chunk)
|
||||||
|
|
||||||
def read_chunk(self) -> bytes:
|
def read_chunk(self) -> bytes:
|
||||||
chunk = self.ble().read()
|
chunk = self.ble().read(64)
|
||||||
# LOG.log(DUMP_PACKETS, f"received packet: {chunk.hex()}")
|
# LOG.log(DUMP_PACKETS, f"received packet: {chunk.hex()}")
|
||||||
if len(chunk) != 64:
|
if len(chunk) != 64:
|
||||||
raise TransportException(f"Unexpected chunk size: {len(chunk)}")
|
raise TransportException(f"Unexpected chunk size: {len(chunk)}")
|
||||||
@ -213,10 +213,10 @@ class BleAsync:
|
|||||||
].acquire()
|
].acquire()
|
||||||
self.current = address
|
self.current = address
|
||||||
|
|
||||||
async def read(self):
|
async def read(self, max_size):
|
||||||
assert self.tx is not None
|
assert self.tx is not None
|
||||||
await ready(self.tx)
|
await ready(self.tx)
|
||||||
return self.tx.read()
|
return self.tx.read(max_size)
|
||||||
|
|
||||||
async def write(self, chunk: bytes):
|
async def write(self, chunk: bytes):
|
||||||
assert self.rx is not None
|
assert self.rx is not None
|
||||||
|
Loading…
Reference in New Issue
Block a user