Claim an interface on a given device handle.

C# | Visual Basic | Visual C++ |
public static int ClaimInterface( MonoUsbDeviceHandle deviceHandle, int interfaceNumber )
Public Shared Function ClaimInterface ( _ deviceHandle As MonoUsbDeviceHandle, _ interfaceNumber As Integer _ ) As Integer
public: static int ClaimInterface( [InAttribute] MonoUsbDeviceHandle^ deviceHandle, int interfaceNumber )

- deviceHandle (MonoUsbDeviceHandle)
- A device handle.
- interfaceNumber (Int32)
- the bInterfaceNumber of the interface you wish to claim.

- 0 on success
- ErrorNotFound if the requested interface does not exist
- ErrorBusy if another program or driver has claimed the interface
- ErrorNoDevice if the device has been disconnected
- another MonoUsbError code on other failure

You must claim the interface you wish to use before you can perform I/O on any of its endpoints.
It is legal to attempt to claim an already-claimed interface, in which case libusb just returns 0 without doing anything.
Claiming of interfaces is a purely logical operation; it does not cause any requests to be sent over the bus. Interface claiming is used to instruct the underlying operating system that your application wishes to take ownership of the interface.
