sowbug/trhid — pull request #1 by krockot (2014-08-12 23:11:00+00:00)
Title: Minor cleanup

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.