mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 14:58:09 +00:00
64fadde3e0
WIP: Issue with console printing of protobuf messages (probably bug in protobuf for python3 itself). WIP: Disabled Bridge transport because of json_protobuf incompatibility with python3. WIP: Broken expectations of returned objects in unit tests
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
import sys
|
|
sys.path = ['../',] + sys.path
|
|
|
|
from trezorlib.transport_pipe import PipeTransport
|
|
from trezorlib.transport_hid import HidTransport
|
|
from trezorlib.transport_socket import SocketTransportClient
|
|
#from trezorlib.transport_bridge import BridgeTransport
|
|
|
|
devices = HidTransport.enumerate()
|
|
|
|
if len(devices) > 0:
|
|
if devices[0][1] != None:
|
|
print('Using TREZOR')
|
|
TRANSPORT = HidTransport
|
|
TRANSPORT_ARGS = (devices[0],)
|
|
TRANSPORT_KWARGS = {'debug_link': False}
|
|
DEBUG_TRANSPORT = HidTransport
|
|
DEBUG_TRANSPORT_ARGS = (devices[0],)
|
|
DEBUG_TRANSPORT_KWARGS = {'debug_link': True}
|
|
else:
|
|
print('Using Raspberry Pi')
|
|
TRANSPORT = HidTransport
|
|
TRANSPORT_ARGS = (devices[0],)
|
|
TRANSPORT_KWARGS = {'debug_link': False}
|
|
DEBUG_TRANSPORT = SocketTransportClient
|
|
DEBUG_TRANSPORT_ARGS = ('trezor.bo:2000',)
|
|
DEBUG_TRANSPORT_KWARGS = {}
|
|
else:
|
|
print('Using Emulator')
|
|
TRANSPORT = PipeTransport
|
|
TRANSPORT_ARGS = ('/tmp/pipe.trezor', False)
|
|
TRANSPORT_KWARGS = {}
|
|
DEBUG_TRANSPORT = PipeTransport
|
|
DEBUG_TRANSPORT_ARGS = ('/tmp/pipe.trezor_debug', False)
|
|
DEBUG_TRANSPORT_KWARGS = {}
|