sowbug / trhid

1 stars 3 forks source link

Minor cleanup #1

Closed krockot closed 9 years ago

krockot commented 9 years ago

This cleans up the promise logic so that errors propagate correctly. Also fixes some assumptions:

  1. The Trezor always fails at feature reports. It's probably not handling the control transfer properly. This doesn't seem to inhibit proper initialization though, so sendFeatureReport failures should tentatively be ignored.
  2. There doesn't appear to be any support for reading input feature reports, so that bit of code has been removed.
  3. chrome.hid.receive gets an ArrayBuffer. Dumping this out for useful debugging requires typing the array (as e.g. a Uint8Array).

It looks like this code actually works, though I haven't validated any of the data coming back from the device.

sowbug commented 9 years ago

Thanks!