Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HidDevice ¶
type HidDevice struct {
io.ReadWriteCloser
}
HidDevice should be used to wrap a *hid.Device when used with `Communication`.
On macOS only, we want to write only 64 bytes at a time. There was a bug in the BitBox firmware (fixed in v9.23.1, see https://github.com/BitBoxSwiss/bitbox02-firmware/pull/1526) - when signing a transaction, during the second inputs pass, 128 bytes are written to the hid device in one shot, which results in a IOKit Timeout error. Writing only 64 bytes at a time (the HID report size) fixes that. Otherwise we feed as many bytes as possible, which is important especially on iOS, where we want to send as much as possible over Bluetooth instead of many little chunks. / From BitBox02 v9.23.1 onwards, this fix is not required, but we also saw some cases of firmware upgrades failing on macOS, and we suspect the same bug in the bootloader <v1.1.2 might be causing it, and writing 64 bytes at a time might fix it.