LibUsbDotNet 2.2.8
GetConfiguration Method (deviceHandle, configuration)
Library Reference ► MonoLibUsb ► MonoUsbApi ► GetConfiguration(MonoUsbDeviceHandle, Int32%)
|
Determine the bConfigurationValue of the currently active configuration.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public static int GetConfiguration( MonoUsbDeviceHandle deviceHandle, ref int configuration )
Public Shared Function GetConfiguration ( _ deviceHandle As MonoUsbDeviceHandle, _ ByRef configuration As Integer _ ) As Integer
public: static int GetConfiguration( [InAttribute] MonoUsbDeviceHandle^ deviceHandle, int% configuration )
Parameters
- deviceHandle (MonoUsbDeviceHandle)
- A device handle.
- configuration (Int32%)
- Output location for the bConfigurationValue of the active configuration. (only valid for return code 0)
Return Value
- 0 on success
- ErrorNoDevice if the device has been disconnected
- another MonoUsbError code on other failure
Remarks
You could formulate your own control request to obtain this information, but this function has the advantage that it may be able to retrieve the information from operating system caches (no I/O involved).
If the OS does not cache this information, then this function will block while a control transfer is submitted to retrieve the information.
This function will return a value of 0 in the configuration parameter if the device is in unconfigured state.
Note:
Member documentation was originally generated using the Libusb-1.0 API documentation:
Device handling and enumeration