Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control transfers are incorrect when using LibUSB #240

Open
sanjay900 opened this issue Jul 11, 2022 · 1 comment
Open

Control transfers are incorrect when using LibUSB #240

sanjay900 opened this issue Jul 11, 2022 · 1 comment

Comments

@sanjay900
Copy link
Contributor

Describe the issue
It appears that the LibUsb UsbInterface is using just the RequestType when creating control transfers, instead of the entire UsbDeviceRequestType
I found that this would stop me from sending control transfers, but I could fix this by using the ToByte() method of UsbDeviceRequestType.

I have made a PR for this here: #237

Your Code

public uint WriteData(ushort id, byte[] buffer)
{
    SetupPacket packet = new SetupPacket(new UsbDeviceRequestType(RequestDirection.Out, RequestType.Class, RequestRecipient.Interface), 1, id, 2, (ushort)buffer.Length);
    TransferResult tr = device.PerformControlTransferAsync(packet, buffer).Result;
    return tr.BytesTransferred;
}

Info

  • Platform: Linux
  • Device Type: USB
  • Version: 4.3.0-beta
@sanjay900
Copy link
Contributor Author

sanjay900 commented Jul 24, 2022

Have you had a chance to look into getting a release out with this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant