Method: LIBUSB::DevHandle#release_interface

Defined in:
lib/libusb/dev_handle.rb

#release_interface(interface) ⇒ Object

Release an interface previously claimed with #claim_interface.

You should release all claimed interfaces before closing a device handle.

This is a blocking function. A SET_INTERFACE control request will be sent to the device, resetting interface state to the first alternate setting.

Parameters:

  • interface (Interface, Fixnum)

    the interface or it’s bInterfaceNumber you claimed previously



97
98
99
100
101
# File 'lib/libusb/dev_handle.rb', line 97

def release_interface(interface)
  interface = interface.bInterfaceNumber if interface.respond_to? :bInterfaceNumber
  res = Call.libusb_release_interface(@pHandle, interface)
  LIBUSB.raise_error res, "in libusb_release_interface" if res!=0
end