mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-29 19:08:12 +00:00
wip
This commit is contained in:
parent
34ae443d82
commit
8599e2d320
@ -355,6 +355,7 @@ class Channel:
|
||||
ENCRYPTED_TRANSPORT, memoryview(self.buffer[:payload_length])
|
||||
)
|
||||
)
|
||||
utils.print_and_update_alloc("After establishing write task spawn")
|
||||
return None
|
||||
|
||||
def write_handshake_message(self, ctrl_byte: int, payload: bytes) -> None:
|
||||
@ -370,6 +371,8 @@ class Channel:
|
||||
async def _write_encrypted_payload_loop(
|
||||
self, ctrl_byte: int, payload: bytes
|
||||
) -> None:
|
||||
utils.print_and_update_alloc("Write encrypted payload loop start")
|
||||
|
||||
if __debug__ and utils.ALLOW_DEBUG_MESSAGES:
|
||||
log.debug(
|
||||
__name__,
|
||||
@ -381,12 +384,16 @@ class Channel:
|
||||
ctrl_byte = control_byte.add_seq_bit_to_ctrl_byte(ctrl_byte, sync_bit)
|
||||
header = PacketHeader(ctrl_byte, self.get_channel_id_int(), payload_len)
|
||||
self.transmission_loop = TransmissionLoop(self, header, payload)
|
||||
utils.print_and_update_alloc("Write encrypted payload loop before transmission")
|
||||
|
||||
await self.transmission_loop.start()
|
||||
utils.print_and_update_alloc("Write encrypted payload loop after transmission")
|
||||
|
||||
ABP.set_send_seq_bit_to_opposite(self.channel_cache)
|
||||
|
||||
# Let the main loop be restarted and clear loop, if there is no other
|
||||
# workflow and the state is ENCRYPTED_TRANSPORT
|
||||
|
||||
if self._can_clear_loop():
|
||||
if __debug__ and utils.ALLOW_DEBUG_MESSAGES:
|
||||
log.debug(
|
||||
|
@ -1,7 +1,7 @@
|
||||
from micropython import const
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from trezor import loop
|
||||
from trezor import loop, utils
|
||||
from trezor.wire.thp.thp_messages import PacketHeader
|
||||
from trezor.wire.thp.writer import write_payload_to_wire_and_add_checksum
|
||||
|
||||
@ -24,6 +24,7 @@ class TransmissionLoop:
|
||||
self.min_retransmisson_count_achieved: bool = False
|
||||
|
||||
async def start(self, max_retransmission_count: int = MAX_RETRANSMISSION_COUNT):
|
||||
utils.print_and_update_alloc("TransmissionLoop - start of start")
|
||||
self.min_retransmisson_count_achieved = False
|
||||
for i in range(max_retransmission_count):
|
||||
if i >= MIN_RETRANSMISSION_COUNT:
|
||||
|
Loading…
Reference in New Issue
Block a user