Device.Net
Device.Net copied to clipboard
Leading zero missing in TrezorExample?
The example code in https://github.com/MelbourneDeveloper/Device.Net#example-code has a leading zero added to the buffer...
//Create the request buffer
var buffer = new byte[65];
buffer[0] = 0x00;
buffer[1] = 0x3f;
buffer[2] = 0x23;
buffer[3] = 0x23;
but the source code sample does not... https://github.com/MelbourneDeveloper/Device.Net/blob/417330ef418a7bacce36dae29eb6f67fc7620723/src/Usb.Net.UWP.Sample/TrezorExample.cs#L85-L89
For my usb hid device on Windows 10, I needed to add the leading zero to get it working. I'm new to USB development, so found this quite confusing - WriteAndReadAsync() just blocks and never returns.
OK it's an extra byte for HID Report ID for HID transfers as discussed here... https://melbournedeveloper.github.io/Device.Net/articles/HidTransfer.html
Might be worth a comment in TrezorExample.cs to nudge USB novices in the right direction?