1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-20 17:19:01 +00:00

fixup! feat(core): add ble wire interface to interface_manager

This commit is contained in:
M1nd3r 2025-04-16 18:41:58 +02:00
parent 278f927f38
commit ffc950a116

View File

@ -1,6 +1,6 @@
from typing import TYPE_CHECKING
import bluetooth
import trezorble as ble
import usb
_WIRE_INTERFACE_USB = b"\x01"
@ -18,7 +18,7 @@ def decode_iface(cached_iface: bytes) -> WireInterface:
raise RuntimeError("There is no valid USB WireInterface")
return iface
elif cached_iface == _WIRE_INTERFACE_BLE:
iface = bluetooth.iface_ble
iface = ble.interface
if iface is None:
raise RuntimeError("There is no valid BLE WireInterface")
return iface
@ -29,6 +29,6 @@ def encode_iface(iface: WireInterface) -> bytes:
"""Encode wire interface into bytes."""
if iface is usb.iface_wire:
return _WIRE_INTERFACE_USB
if iface is bluetooth.iface_ble:
if iface is ble.interface:
return _WIRE_INTERFACE_BLE
raise Exception("Unknown WireInterface")