SetInterfaceAltSetting Method (deviceHandle, interfaceNumber, alternateSetting)

LibUsbDotNet

LibUsbDotNet 2.2.8 SetInterfaceAltSetting Method (deviceHandle, interfaceNumber, alternateSetting)
Library ReferenceMonoLibUsbMonoUsbApiSetInterfaceAltSetting(MonoUsbDeviceHandle, Int32, Int32)
LibUsbDotNet on SourceForge
Activate an alternate setting for an interface.
Declaration Syntax
C# Visual Basic Visual C++
public static int SetInterfaceAltSetting(
	MonoUsbDeviceHandle deviceHandle,
	int interfaceNumber,
	int alternateSetting
)
Public Shared Function SetInterfaceAltSetting ( _
	deviceHandle As MonoUsbDeviceHandle, _
	interfaceNumber As Integer, _
	alternateSetting As Integer _
) As Integer
public:
static int SetInterfaceAltSetting(
	[InAttribute] MonoUsbDeviceHandle^ deviceHandle, 
	int interfaceNumber, 
	int alternateSetting
)
Parameters
deviceHandle (MonoUsbDeviceHandle)
A device handle.
interfaceNumber (Int32)
The bInterfaceNumber of the previously-claimed interface.
alternateSetting (Int32)
The bAlternateSetting of the alternate setting to activate.
Return Value
  • 0 on success
  • ErrorNotFound if the interface was not claimed, or the requested alternate setting does not exist
  • ErrorNoDevice if the device has been disconnected
  • another MonoUsbError code on other failure
Remarks

The interface must have been previously claimed with ClaimInterface(MonoUsbDeviceHandle, Int32).

You should always use this function rather than formulating your own SET_INTERFACE control request. This is because the underlying operating system needs to know when such changes happen.

This is a blocking function.

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)