1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

add log to wire.io

This commit is contained in:
Pavol Rusnak 2016-09-26 21:27:44 +02:00
parent dbfb06d30e
commit a3ec1c082a
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -1,5 +1,8 @@
import ubinascii
from trezor import msg
from trezor import loop
from trezor import log
_DEFAULT_IFACE = const(0)
@ -7,10 +10,12 @@ _DEFAULT_IFACE = const(0)
def read_report_stream(target, iface=_DEFAULT_IFACE):
while True:
report, = yield loop.Select(iface)
log.info(__name__, 'read report %s', ubinascii.hexlify(report))
target.send(report)
def write_report_stream(iface=_DEFAULT_IFACE):
while True:
report = yield
log.info(__name__, 'write report %s', ubinascii.hexlify(report))
msg.send(iface, report)