mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-04 05:42:34 +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
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import bluetooth
|
import trezorble as ble
|
||||||
import usb
|
import usb
|
||||||
|
|
||||||
_WIRE_INTERFACE_USB = b"\x01"
|
_WIRE_INTERFACE_USB = b"\x01"
|
||||||
@ -18,7 +18,7 @@ def decode_iface(cached_iface: bytes) -> WireInterface:
|
|||||||
raise RuntimeError("There is no valid USB WireInterface")
|
raise RuntimeError("There is no valid USB WireInterface")
|
||||||
return iface
|
return iface
|
||||||
elif cached_iface == _WIRE_INTERFACE_BLE:
|
elif cached_iface == _WIRE_INTERFACE_BLE:
|
||||||
iface = bluetooth.iface_ble
|
iface = ble.interface
|
||||||
if iface is None:
|
if iface is None:
|
||||||
raise RuntimeError("There is no valid BLE WireInterface")
|
raise RuntimeError("There is no valid BLE WireInterface")
|
||||||
return iface
|
return iface
|
||||||
@ -29,6 +29,6 @@ def encode_iface(iface: WireInterface) -> bytes:
|
|||||||
"""Encode wire interface into bytes."""
|
"""Encode wire interface into bytes."""
|
||||||
if iface is usb.iface_wire:
|
if iface is usb.iface_wire:
|
||||||
return _WIRE_INTERFACE_USB
|
return _WIRE_INTERFACE_USB
|
||||||
if iface is bluetooth.iface_ble:
|
if iface is ble.interface:
|
||||||
return _WIRE_INTERFACE_BLE
|
return _WIRE_INTERFACE_BLE
|
||||||
raise Exception("Unknown WireInterface")
|
raise Exception("Unknown WireInterface")
|
||||||
|
Loading…
Reference in New Issue
Block a user