LibUsbDotNet 2.2.8
UsbDevice Class
Library ReferenceLibUsbDotNetUsbDevice
LibUsbDotNet on SourceForge
Contains non-driver specific USB device communication members.
Declaration Syntax
C#Visual BasicVisual C++
public abstract class UsbDevice
Public MustInherit Class UsbDevice
public ref class UsbDevice abstract
Members
All MembersMethodsPropertiesFieldsEvents



IconMemberDescription
ActiveEndpoints
A list of endpoints that have beened opened by this UsbDevice class.

AllDevices
Gets a list of all available USB devices (WinUsb, LibUsb, Linux LibUsb v1.x).

AllLibUsbDevices
Gets a list of all available libusb-win32 USB devices.

AllWinUsbDevices
Gets a list of all available WinUSB USB devices.

Close()()()()
Closes the UsbDevice and disposes any ActiveEndpoints.

Configs
Gets all available configurations for this UsbDevice

ControlTransfer(UsbSetupPacket%, IntPtr, Int32, Int32%)
Transmits control data over a default control endpoint.

ControlTransfer(UsbSetupPacket%, Object, Int32, Int32%)
Transmits control data over a default control endpoint.

DriverMode
Returns the DriverMode this USB device is using.

Exit()()()()
De-initializes the USB driver.

ForceLibUsbWinBack
Setting this field to trueTruetrue will force LibUsbDotNet to use the Libusb-1.0 Windows-backend driver. For platforms other than windows, this setting has no effect.

GetAltInterfaceSetting(Byte, Byte%)
Gets the selected alternate interface of the specified interface.

GetConfiguration(Byte%)
Gets the USB devices active configuration value.

GetDescriptor(Byte, Byte, Int16, IntPtr, Int32, Int32%)
Gets a descriptor from the device. See DescriptorType for more information.

GetDescriptor(Byte, Byte, Int16, Object, Int32, Int32%)
Gets a descriptor from the device. See DescriptorType for more information.

GetLangIDs(array<Int16>[]()[][]%)
Asking for the zero'th index is special - it returns a string descriptor that contains all the language IDs supported by the device. Typically there aren't many - often only one. The language IDs are 16 bit numbers, and they start at the third byte in the descriptor. See USB 2.0 specification, section 9.6.7, for more information on this.

GetString(String%, Int16, Byte)
Gets a String descriptor from the device.

HasLibUsbDriver Obsolete.
True if the LibUsb driver is found on the system.

HasLibUsbWinBackDriver
True if the libusb-1.0 API is available.

HasWinUsbDriver
True if the WinUSB API is available.

Info
Gets the actual device descriptor the the current UsbDevice.

IsLinux
Returns true if the system is a linux/unix-like operating system.

IsOpen
Gets a value indication if the device handle is valid.

KernelType
Gets the kernel driver type in use by LibUsbDotNet. If NativeLibUsb is returned, LibUsbDotNet using using its native kernel driver. Basic usb device information is retreived from the windows registry which reduces USB IO overhead. If LegacyLibUsb is returned, LibUsbDotNet is using the orginal kernel available at the libusb-win32.sourceforge.net page and true windows registry support is unavailable. Under linux, MonoLibUsb is always returned.

KernelVersion
Gets the kernel driver version in use by LibUsbDotNet.

if BcdLibUsbDotNetKernelMod is non-zero then the kernel driver is native.


LastErrorNumber
Returns the last error number reported by LibUsbDotNet.

LastErrorString
Returns the last error string reported by LibUsbDotNet.

Open()()()()
Opens the USB device handle.

OpenEndpointReader(ReadEndpointID)
Opens a Bulk endpoint for reading

OpenEndpointReader(ReadEndpointID, Int32)
Opens a Bulk endpoint for reading

OpenEndpointReader(ReadEndpointID, Int32, EndpointType)
Opens an endpoint for reading

OpenEndpointWriter(WriteEndpointID)
Opens a Bulk endpoint for writing

OpenEndpointWriter(WriteEndpointID, EndpointType)
Opens an endpoint for writing

OpenUsbDevice(UsbDeviceFinder)
Opens the usb device that matches the UsbDeviceFinder.

OpenUsbDevice(Predicate<(Of <<'(UsbRegistry>)>>))
Opens the usb device that matches the find predicate.

OpenUsbDevice(Guid%, UsbDevice%)
Opens a WinUsb device by its DeviceInterfaceGUID.

OSVersion
Gets a OperatingSystem object that contains the current platform identifier and version number.

UsbErrorEvent
Global static error event for all Usb errors.

UsbRegistryInfo
Gets the UsbRegistry class that opened the device, or null if the device was not opened by the UsbRegistry class.

Remarks
This class is compatible with WinUSB, LibUsb-Win32, and linux libusb v1.x. Platform independent applications should only use usb device members from this class. If more functionality is required, it is up to the application to handle multi-driver and/or multi-platfrom requirements.
Inheritance Hierarchy

Assembly: LibUsbDotNet (Module: LibUsbDotNet) Version: 2.2.8.104 (2.2.8.104)