mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
add log to wire.io
This commit is contained in:
parent
dbfb06d30e
commit
a3ec1c082a
@ -1,5 +1,8 @@
|
|||||||
|
import ubinascii
|
||||||
|
|
||||||
from trezor import msg
|
from trezor import msg
|
||||||
from trezor import loop
|
from trezor import loop
|
||||||
|
from trezor import log
|
||||||
|
|
||||||
_DEFAULT_IFACE = const(0)
|
_DEFAULT_IFACE = const(0)
|
||||||
|
|
||||||
@ -7,10 +10,12 @@ _DEFAULT_IFACE = const(0)
|
|||||||
def read_report_stream(target, iface=_DEFAULT_IFACE):
|
def read_report_stream(target, iface=_DEFAULT_IFACE):
|
||||||
while True:
|
while True:
|
||||||
report, = yield loop.Select(iface)
|
report, = yield loop.Select(iface)
|
||||||
|
log.info(__name__, 'read report %s', ubinascii.hexlify(report))
|
||||||
target.send(report)
|
target.send(report)
|
||||||
|
|
||||||
|
|
||||||
def write_report_stream(iface=_DEFAULT_IFACE):
|
def write_report_stream(iface=_DEFAULT_IFACE):
|
||||||
while True:
|
while True:
|
||||||
report = yield
|
report = yield
|
||||||
|
log.info(__name__, 'write report %s', ubinascii.hexlify(report))
|
||||||
msg.send(iface, report)
|
msg.send(iface, report)
|
||||||
|
Loading…
Reference in New Issue
Block a user