Ports and Interfaces > USB
Device reset
ChicagoMike:
Hi,
I'm working on a WinXP C++ application that I use to communicate with a full speed device that implements HID DC. I've been able to enumerate and communicate with the device beautifully.
My question is this: How can I reset the port using only the Windows API? I tried using DeviceIoControl() with both IOCTL_INTERNAL_USB_CYCLE_PORT and IOCTL_INTERNAL_USB_RESET_PORT, but neither seems to work reliably. The LVR developer's guide doesn't seem to address this (unless I'm missing something).
Any suggestions?
Thanks in advance for your kind assistance.
Mike
Jan Axelson:
Why does your host application need to reset the port?
Jan
ChicagoMike:
Both the device firmware and the host application are legacy products with thousands of copies in the field. After all this time, a bug has emerged on the device end. Resetting the port from the application end is a possible workaround. This might seem kludgy to you (it certainly does to me), but a point release of the host application via FTP is much less painful than having to patch embedded code.
Which, since I'm getting the feeling that you don't want to answer my original question, I'll ask another: A different workaround would be to send a Set Configuration request to the device, but when I try to do that with HidD_SetConfiguration(), I get the error 'Incorrect function', and I can't figure out why.
In both cases I'm using the device handle obtained from the CreateFile() call during the device discovery process.
Any advice?
Thanks,
Mike
ChicagoMike:
P.S.
HidD_GetConfiguration() fails in exactly the same manner.
Thanks again,
Mike
Jan Axelson:
The DevCon example in the WDK shows how to enable, disable, restart, update, remove and query devices. I don't know if any of those would solve your problem.
HidD_GetConfiguration and HidD_SetConfiguration are reserved for internal use:
http://msdn.microsoft.com/en-us/library/ff543370%28VS.85%29.aspx
Sending a Set_Configuration request would require a custom driver. I believe IOCTL_INTERNAL_USB_RESET_PORT must be called by a low-level driver as well.
Jan
Navigation
[0] Message Index
[#] Next page
Go to full version