LibUsbDotNet 2.2.8
ClaimInterface Method (deviceHandle, interfaceNumber)
Library Reference ► MonoLibUsb ► MonoUsbApi ► ClaimInterface(MonoUsbDeviceHandle, Int32)
|
Claim an interface on a given device handle.
Declaration Syntax
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 )
Parameters
- deviceHandle (MonoUsbDeviceHandle)
- A device handle.
- interfaceNumber (Int32)
- the bInterfaceNumber of the interface you wish to claim.
Return Value
- 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
Remarks
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.
Note:
Member documentation was originally generated using the Libusb-1.0 API documentation:
Device handling and enumeration