Trezor.Net icon indicating copy to clipboard operation
Trezor.Net copied to clipboard

Trezor.Net with LibUsb getting an error while reading response from a device

Open vnau opened this issue 1 year ago • 0 comments

Trezor.Net does not work properly with LibUsb on either Windows or Linux (mono) because the behavior of IDevice.ReadAsync differs from the native implementation, resulting in an error: An error occurred while attempting to read the message from the device. The last written message was a ButtonAck. In the first chunk of data the first byte was not 63the second byte was not 35the third byte was not 35

When using LibUsb, the ReadAsync method does not wait for data to be received and immediately returns a response with BytesTransferred property value of zero.

I can create a PR for either Trezor.Net or/and Device.Net.LibUsb (probably this would be a better approach) if that makes sense given the project is stalled.

Info

Platform: Windows / Linux(mono) Device.Net 4.2.1 Device.Net.LibUsb 4.2.1 LibUsbDotNet 2.2.29 Trezor.Net 5.0.0-beta

vnau avatar Sep 04 '23 11:09 vnau