mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-05 14:08:39 +00:00
18 lines
334 B
Python
18 lines
334 B
Python
|
from trezor.loop import wait
|
||
|
|
||
|
|
||
|
class MockHID:
|
||
|
def __init__(self, num):
|
||
|
self.num = num
|
||
|
self.data = []
|
||
|
|
||
|
def iface_num(self):
|
||
|
return self.num
|
||
|
|
||
|
def write(self, msg):
|
||
|
self.data.append(bytearray(msg))
|
||
|
return len(msg)
|
||
|
|
||
|
def wait_object(self, mode):
|
||
|
return wait(mode | self.num)
|