Can't find device in windows, please help
Re: Can't find device in windows, please help
Christian -
Are you saying from usbFunctionSetup, I can still return values with the usb message pointer?
Tried this without any luck. Tried pointing usbmessage pointer to a character array and returning the size of the array.
Maybe I'm doing it wrong on the host but I always get zero back.
int return_value = usbSetReport(dev, USB_HID_REPORT_TYPE_FEATURE, buffer, 4); ?
is that right? Does usbSetReport return the value it receives back or am I supposed to pass it a return buffer?
Thanks again, almost there = ).
Jason
Are you saying from usbFunctionSetup, I can still return values with the usb message pointer?
Tried this without any luck. Tried pointing usbmessage pointer to a character array and returning the size of the array.
Maybe I'm doing it wrong on the host but I always get zero back.
int return_value = usbSetReport(dev, USB_HID_REPORT_TYPE_FEATURE, buffer, 4); ?
is that right? Does usbSetReport return the value it receives back or am I supposed to pass it a return buffer?
Thanks again, almost there = ).
Jason
Re: Can't find device in windows, please help
usbSetReport() sends data to the device. Use usbGetReport() to read data.
Re: Can't find device in windows, please help
Yeah, that's ridiculous. Because the data I send back is dependent on the data I send down with SetReport. So that means I need to implement a global variable that doesn't go away when functionsetup ends.
Is that right?
Is that right?
Re: Can't find device in windows, please help
Yes. That's the way how HID report descriptors work.
If you need a kind of RPC mechanism with only a couple of bytes sent to the device, consider raw setup requests with libusb-win32. This is an additional install, though.
If you need a kind of RPC mechanism with only a couple of bytes sent to the device, consider raw setup requests with libusb-win32. This is an additional install, though.
Re: Can't find device in windows, please help
But that's what started the discussion, I can't talk to an HID device with libusb because windows locks it. Is there a way to unlock it?
Re: Can't find device in windows, please help
Ah, sorry. Did not remember the context. Windows locks keyboards and mice, but not generic HIDs. If you have a keyboard or mouse, you probably need to send and receive a report.
Re: Can't find device in windows, please help
Afraid you were going to say that. What a bummer, I have re-write a lot of code to get this to work in Windows.
Re: Can't find device in windows, please help
snookie wrote:But that's what started the discussion, I can't talk to an HID device with libusb because windows locks it. Is there a way to unlock it?
There are 2 ways to communicate with locked device in Windows that I know of.
1 : Native win calls using the DDK -> Send / Receive feature reports.
2 : Install libusb (I recommend version libusb-win32-filter-bin-0.1.8.0.exe as others I have tried have issues) and make a call to -> usb_control_msg.
What compiler are you using for your Windows software as I can only show you examples for the above for use with VC++ 2003 - 2008 ?
Also, what do you prefer, to make everyone install libusb to use your app, or should the app run without any additional drivers ?
Also libusb is very slow to enumerate devices and send data compared to native Win calls.
Having said that, libusb has it's place as it can do some things that aren't too easy using native calls.