| Doc ID: | 53 |
| Product: | WinDriver |
| Version: | 5.04 - 5.22 |
How do I reset my USB device using WinDriver (versions 5.04 - 5.22)? |
WinDriver provides you with an API for resetting your USB device: WD_UsbResetDevice() and WD_UsbResetDeviceEx() (added in version 5.04 of WinDriver). These functions cause the hub driver to reinitialize the device, while preserving the existing configuration. WD_UsbResetDeviceEx() - added in version 5.04 - enables you to distinguish between performing a soft reset - which is similar to the reset performed with the WD_UsbResetDevice() function, used in previous versions; Or a hard reset. The differences between a soft reset and a hard reset, performed with WD_UsbResetDeviceEx(), are as follows:
Following is an an example of using WD_UsbResetEx() to perform a hard reset: WD_USB_RESET_DEVICE reset; BZERO(resest); reset.hDevice = hDevice; //The handle received from // WD_UsbDeviceRegister() reset.dwOptions = WD_USB_HARD_RESET; WD_UsbResetDeviceEx(hWD, &reset); NOTE: To prevent a system crash when performing hard reset, it is recommended to do the following: immediately after calling WD_UsbResetDeviceEx(), un-register the device (by calling WD_UsbDeviceUnregister()), scan for it (by calling WD_UsbScanDevice()) and then register it again (by calling WD_UsbDeviceRegister()). This will ensure that Windows will allocate all the resources for the device and will eliminate possible conflicts later on. Back to Top |
Documents Navigator: