LibUsb and C#

  • Thread starter Thread starter eusebiu
  • Start date Start date
E

eusebiu

Hello!
Did anyone used LibUsb-Win32 library or #usblib?
If so, I am getting an -22 error when I try to use BulkRead method.
The connected device is found but I can't read from it.

//code C#
IntPtr deviceHandle =
NativeMethods.usb_open(descriptor.NativeDevice);// returns a non-Zero
value - OK

//////////
NativeMethods.usb_set_configuration(deviceHandle, 1);
NativeMethods.usb_claim_interface(deviceHandle, 0);
NativeMethods.usb_set_altinterface(deviceHandle, 0);

//.. all methods return 0 = SUCCESS

NativeMethods is a class that wraps libusb0.dll

Any ideeas?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top