C# Class LibUsbDotNet.Main.UsbRegistry

USB device registry members common to both LibUsb and WinUsb devices.
Mostra file Open project: arvydas/BlinkStickDotNet Class Usage Examples

Public Properties

Property Type Description
ForceSetupApi bool

Public Methods

Method Description
Open ( UsbDevice &usbDevice ) : bool

Opens the USB device for communucation.

this ( DevicePropertyType devicePropertyType ) : object

Gets a property from the registry. See the DevicePropertyType enumeration for more information.

this ( SPDRP spdrp ) : object

Gets a device property/key from the registry. See the SPDRP enumeration for more information.

this ( string name ) : object

Gets a device property/key from the registry.

Private Methods

Method Description
GetAsGuid ( byte buffer, int len ) : System.Guid
GetAsString ( byte buffer, int len ) : string
GetAsStringArray ( byte buffer, int len ) : string[]
GetAsStringInt32 ( byte buffer, int len ) : Int32

Method Details

Open() public abstract method

Opens the USB device for communucation.
public abstract Open ( UsbDevice &usbDevice ) : bool
usbDevice UsbDevice The newly created UsbDevice.
return bool

this() public method

Gets a property from the registry. See the DevicePropertyType enumeration for more information.
public this ( DevicePropertyType devicePropertyType ) : object
devicePropertyType DevicePropertyType The name of the property to retrieve.
return object

this() public method

Gets a device property/key from the registry. See the SPDRP enumeration for more information.
public this ( SPDRP spdrp ) : object
spdrp SPDRP The name of the property to retrieve.
return object

this() public method

Gets a device property/key from the registry.
public this ( string name ) : object
name string The name of the property to retrieve.
return object

Property Details

ForceSetupApi public_oe static_oe property

If true, LibUsbDotNet will use the vid, pid and revision of the UsbDevice.Info descriptor to lookup additional device information in the windows registry via the setupapi. Setting this field to false will cause all device information to come directly from the device descriptors.

If using WinUSB or the LibUsbDotNet-libusb-win32 native driver, information provided by the UsbRegistry class will come from the registry regardless of this setting because these drivers have direct support for this.

The Libusb-1.0 windows-backend driver and the legacy libusb-win32 driver have their own methods for listing, finding, and opening devices. For these drivers, the ForceSetupApi can be set to do a "reverse lookup" via the setupapi using only the vid, pid and revision of the UsbDeviceDescriptor. The UsbRegistry class is then populated with all available SPDRP properties, device interface guids, winusb device paths, etc.

public static bool ForceSetupApi
return bool