ResetDevice Method (deviceHandle)

LibUsbDotNet

LibUsbDotNet 2.2.8 ResetDevice Method (deviceHandle)
Library ReferenceMonoLibUsbMonoUsbApiResetDevice(MonoUsbDeviceHandle)
LibUsbDotNet on SourceForge
Perform a USB port reset to reinitialize a device.
Declaration Syntax
C# Visual Basic Visual C++
public static int ResetDevice(
	MonoUsbDeviceHandle deviceHandle
)
Public Shared Function ResetDevice ( _
	deviceHandle As MonoUsbDeviceHandle _
) As Integer
public:
static int ResetDevice(
	[InAttribute] MonoUsbDeviceHandle^ deviceHandle
)
Parameters
deviceHandle (MonoUsbDeviceHandle)
A device handle.
Return Value
  • 0 on success
  • ErrorNotFound if re-enumeration is required, or if the device has been disconnected
  • another MonoUsbError code on other failure
Remarks

The system will attempt to restore the previous configuration and alternate settings after the reset has completed.

If the reset fails, the descriptors change, or the previous state cannot be restored, the device will appear to be disconnected and reconnected. This means that the device handle is no longer valid (you should close it) and rediscover the device. A return code of ErrorNotFound indicates when this is the case.

This is a blocking function which usually incurs a noticeable delay.

Note: Member documentation was originally generated using the Libusb-1.0 API documentation: Device handling and enumeration

Assembly: LibUsbDotNet (Module: LibUsbDotNet) Version: 2.2.8.104 (2.2.8.104)