Method: LIBUSB::DevHandle#reset_device

Defined in:
lib/libusb/dev_handle.rb

#reset_deviceObject

Perform a USB port reset to reinitialize a device.

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 Exception of LIBUSB::ERROR_NOT_FOUND indicates when this is the case.

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


190
191
192
193
# File 'lib/libusb/dev_handle.rb', line 190

def reset_device
  res = Call.libusb_reset_device(@pHandle)
  LIBUSB.raise_error res, "in libusb_reset_device" if res!=0
end