mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-05 14:22:33 +00:00
TEMP: remove ACK sending, message retransmission and message sequence bit checks
- for tests of THP speed [no changelog]
This commit is contained in:
parent
d45491b57b
commit
e1f17dd576
@ -93,16 +93,16 @@ async def handle_received_message(
|
|||||||
raise ThpError("Message is not encrypted. Ignoring")
|
raise ThpError("Message is not encrypted. Ignoring")
|
||||||
|
|
||||||
# 2: Handle message with unexpected sequential bit
|
# 2: Handle message with unexpected sequential bit
|
||||||
if seq_bit != ABP.get_expected_receive_seq_bit(ctx.channel_cache):
|
# if seq_bit != ABP.get_expected_receive_seq_bit(ctx.channel_cache):
|
||||||
if __debug__:
|
# if __debug__:
|
||||||
log.debug(__name__, "Received message with an unexpected sequential bit")
|
# log.debug(__name__, "Received message with an unexpected sequential bit")
|
||||||
await _send_ack(ctx, ack_bit=seq_bit)
|
# await _send_ack(ctx, ack_bit=seq_bit)
|
||||||
raise ThpError("Received message with an unexpected sequential bit")
|
# raise ThpError("Received message with an unexpected sequential bit")
|
||||||
|
|
||||||
# 3: Send ACK in response
|
# # 3: Send ACK in response
|
||||||
await _send_ack(ctx, ack_bit=seq_bit)
|
# await _send_ack(ctx, ack_bit=seq_bit)
|
||||||
|
|
||||||
ABP.set_expected_receive_seq_bit(ctx.channel_cache, 1 - seq_bit)
|
# ABP.set_expected_receive_seq_bit(ctx.channel_cache, 1 - seq_bit)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await _handle_message_to_app_or_channel(
|
await _handle_message_to_app_or_channel(
|
||||||
|
@ -8,8 +8,8 @@ from trezor.wire.thp.writer import write_payload_to_wire_and_add_checksum
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from trezor.wire.thp.channel import Channel
|
from trezor.wire.thp.channel import Channel
|
||||||
|
|
||||||
MAX_RETRANSMISSION_COUNT = const(50)
|
MAX_RETRANSMISSION_COUNT = const(1)
|
||||||
MIN_RETRANSMISSION_COUNT = const(2)
|
MIN_RETRANSMISSION_COUNT = const(1)
|
||||||
|
|
||||||
|
|
||||||
class TransmissionLoop:
|
class TransmissionLoop:
|
||||||
|
Loading…
Reference in New Issue
Block a user