1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-26 08:08:51 +00:00
trezor-firmware/trezorlib/transport
matejcik 88988172b9 bridge: perform HTTP request in read, not write
This allows us to return early from a `write`, which we need in cases
where we want to perform an operation inbetween `read` and `write` -
namely, callback for ButtonRequest should technically be invoked after
returning ButtonAck but before waiting for device's response.

Of course that doesn't really work. The callback will actually be
invoked _before_ ButtonAck, so there's still the condition that it must
return immediately or the device gets stuck with a black screen.

But doing this allows us to write code *as if* it worked, which lets the
other transports run free and wild, by which I mean, do the Right Thing
2018-10-10 13:15:28 +02:00
..
__init__.py style: apply black/isort 2018-08-13 18:22:19 +02:00
bridge.py bridge: perform HTTP request in read, not write 2018-10-10 13:15:28 +02:00
hid.py style: uppercase hex constants to conform with black 18.9b0 style 2018-10-01 14:01:33 +02:00
udp.py style: apply black/isort 2018-08-13 18:22:19 +02:00
webusb.py style: uppercase hex constants to conform with black 18.9b0 style 2018-10-01 14:01:33 +02:00