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:
parent
278f927f38
commit
ffc950a116
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user