Jan Pochyla
1f90e781d5
wire: simplify, use async codecs
2017-08-15 18:14:14 +02:00
Jan Pochyla
915cf849e9
trezor.msg: remove select, add poll
...
TODO: decide if we want to continue polling on interface numbers, or rather on usb/touch file objects
2017-06-26 16:03:20 +02:00
Jan Pochyla
98e82e3cd5
code style
2017-06-12 18:16:06 +02:00
Jan Pochyla
6e15b37205
trezor.wire: less logs
2017-06-12 18:05:06 +02:00
Jan Pochyla
e86924d645
trezor.wire: fix unexpected message error
2017-01-24 14:14:03 +01:00
Jan Pochyla
ec49c2d97a
trezor.wire: unexpected message should interrupt workflow silently
2017-01-18 18:00:38 +01:00
Jan Pochyla
8bdd59642f
trezor.wire: print session ID as hex
2017-01-06 14:07:18 +01:00
Jan Pochyla
d56dc88861
wire: refactoring
...
- prefer importing modules instead of module members
- session_id is always first argument
- prefer much shorter names, don't expect users to import module members
- shuffle around session-specific code
- reduce allocations
2016-12-08 16:19:09 +01:00
Jan Pochyla
0b7874ad43
loop: rename Future to Signal
...
Future semantics were changed to allow multiple deliveries to avoid allocating more future objects than neccessary, and Signal describes this behaviour more accurately.
2016-12-08 16:19:09 +01:00
Jan Pochyla
1b27bb480d
trezor.wire: rename modules
2016-12-08 16:19:09 +01:00
Jan Pochyla
02d615ff06
wire: convert to bytearray every time
2016-11-15 18:55:38 +01:00
Jan Pochyla
e556aea42b
wire: fix when the footer is too short
2016-11-15 18:09:45 +01:00
Jan Pochyla
83043f7aef
wire: update to latest changes in protobuf
2016-10-26 17:36:11 +02:00
Jan Pochyla
507d9bdf68
wire: add tests for v1 codec
2016-10-24 15:40:34 +02:00
Jan Pochyla
d0b29d4caa
wire: add tests, fix missing 0-padding
2016-10-21 15:02:20 +02:00
Jan Pochyla
688d293b01
wire: use memoryview() asap in the parsing process
2016-10-20 15:14:40 +02:00
Pavol Rusnak
882efbf21b
modtrezormsg: use interfaces index internally, usage_page externally
2016-10-11 13:15:13 +02:00
Pavol Rusnak
3f44dfedb5
modtrezormsg: use usage_page to identify interfaces
2016-10-11 12:14:17 +02:00
Jan Pochyla
6d5514ac4a
make logging less verbose
2016-10-06 15:05:14 +02:00
Jan Pochyla
c019741c33
wire: fix write_message, pbuf dumps is sync now
2016-10-06 15:05:14 +02:00
Jan Pochyla
4b0da8677a
wire: fix read_message for v1 protocol
2016-10-06 15:05:14 +02:00
Jan Pochyla
407169af01
import qualified const()
2016-09-29 12:29:43 +02:00
Jan Pochyla
c93133026e
autopep8 and minor cosmetics
2016-09-28 23:28:53 +02:00
Jan Pochyla
fb7b85e479
move protobuf to a single module
2016-09-28 23:17:11 +02:00
slush0
cb1dcc965d
TREZOR v1 protocol codec
2016-09-28 22:59:30 +02:00
slush0
e8850e4aa5
Fixing generator startup in read_message.
2016-09-28 22:57:45 +02:00
slush0
8a160becb9
Added support for TREZOR v1 protocol (acts as session 0 internally).
2016-09-28 22:34:12 +02:00
Pavol Rusnak
a3ec1c082a
add log to wire.io
2016-09-27 17:26:14 +02:00
Jan Pochyla
883b392fdb
adopt wire dispatching, log removed modules
2016-09-27 17:26:13 +02:00
Jan Pochyla
e9c7a67c73
make imports more local, remove trezor.workflows, minor tweaks
2016-09-27 17:26:13 +02:00
Jan Pochyla
34ed2fb86a
workflow monitor, reset_device layout work
...
- request/response manner of usual protobuf workflows is enforced, workflows are expected to either return a valid protobuf response, or raise an exception
- added wire.FailureError exception that allows workflow to provide Failure code & message
- pin workflows simplified
TODO: all this workflow work does not really belong in trezor.wire
2016-09-27 17:26:11 +02:00
Jan Pochyla
02b13af526
fix session id range
2016-09-27 17:26:11 +02:00
Jan Pochyla
64746d01b4
use memoryviews in wire_codec
2016-09-27 17:26:11 +02:00
Jan Pochyla
b8dd8ed90c
wire fixes
2016-09-27 17:26:06 +02:00
Jan Pochyla
099767d592
session/workflow overhaul
...
- lazy loading and importing of protobuf messages
- workflow dispatching through codec pipeline on the first message report
HACK: workflow killing
TODO: cap on concurrent sessions
TODO: ui locking/queuing
TODO: session storage
TODO: tests
2016-09-27 17:26:06 +02:00