C# Class LibUsbDotNet.Main.UsbDeviceFinder

Finds and identifies usb devices. Used for easily locating
Instances of this class can optionally be passed directly into UsbDevice.OpenUsbDevice(LibUsbDotNet.Main.UsbDeviceFinder) to quickly find and open a specific usb device in one step. Pass instances of this class into the UsbRegDeviceList.Find(UsbDeviceFinder), UsbRegDeviceList.FindAll(UsbDeviceFinder), or UsbRegDeviceList.FindLast(UsbDeviceFinder) functions of a UsbRegDeviceList instance to find connected usb devices without opening devices or interrogating the bus. After locating the required UsbRegistry instance, call the UsbRegistry.Open method to start using the UsbDevice instance.
Inheritance: ISerializable
Mostrar archivo Open project: arvydas/BlinkStickDotNet Class Usage Examples

Public Properties

Property Type Description
NO_GUID System.Guid

Public Methods

Method Description
Check ( UsbDevice usbDevice ) : bool

Dynamic predicate find function. Pass this function into any method that has a Predicate{UsbDevice} parameter.

Override this member when inheriting the UsbDeviceFinder class to change/alter the matching behavior.

Check ( UsbRegistry usbRegistry ) : bool

Dynamic predicate find function. Pass this function into any method that has a Predicate{UsbRegistry} parameter.

Override this member when inheriting the UsbDeviceFinder class to change/alter the matching behavior.

GetObjectData ( SerializationInfo info, StreamingContext context ) : void

Store this class as a binary serializtion object.

Load ( Stream deviceFinderStream ) : UsbDeviceFinder

Load usb device finder properties from a binary stream.

Save ( UsbDeviceFinder usbDeviceFinder, Stream outStream ) : void

Saves a UsbDeviceFinder instance to a stream.

UsbDeviceFinder ( System.Guid deviceInterfaceGuid ) : System

Creates a UsbDeviceFinder class for locating usb devices by a unique Guid string.

UsbDeviceFinder ( int vid ) : System

Creates a UsbDeviceFinder class for locating usb devices.

UsbDeviceFinder ( int vid, int pid ) : System

Creates a UsbDeviceFinder class for locating usb devices vendor and product ID.

UsbDeviceFinder ( int vid, int pid, int revision ) : System

Creates a UsbDeviceFinder class for locating usb devices by VendorID, ProuctID, and Revision code.

UsbDeviceFinder ( int vid, int pid, int revision, string serialNumber, System.Guid deviceInterfaceGuid ) : System

Creates a UsbDeviceFinder class for locating and identifying usb devices.

UsbDeviceFinder ( int vid, int pid, string serialNumber ) : System

Creates a UsbDeviceFinder class for locating usb devices by VendorID, ProductID, and Serial number.

UsbDeviceFinder ( string serialNumber ) : System

Creates a UsbDeviceFinder class for locating usb devices by a serial number.

Protected Methods

Method Description
UsbDeviceFinder ( ) : System

UsbDeviceFinder ( SerializationInfo info, StreamingContext context ) : System

Use a serialization stream to fill the UsbDeviceFinder class.

Method Details

Check() public method

Dynamic predicate find function. Pass this function into any method that has a Predicate{UsbDevice} parameter.
Override this member when inheriting the UsbDeviceFinder class to change/alter the matching behavior.
public Check ( UsbDevice usbDevice ) : bool
usbDevice UsbDevice The UsbDevice to check.
return bool

Check() public method

Dynamic predicate find function. Pass this function into any method that has a Predicate{UsbRegistry} parameter.
Override this member when inheriting the UsbDeviceFinder class to change/alter the matching behavior.
public Check ( UsbRegistry usbRegistry ) : bool
usbRegistry UsbRegistry The UsbRegistry device to check.
return bool

GetObjectData() public method

Store this class as a binary serializtion object.
public GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info System.Runtime.Serialization.SerializationInfo The serialization instance to populate.
context System.Runtime.Serialization.StreamingContext
return void

Load() public static method

Load usb device finder properties from a binary stream.
public static Load ( Stream deviceFinderStream ) : UsbDeviceFinder
deviceFinderStream Stream The binary stream containing a ///
return UsbDeviceFinder

Save() public static method

Saves a UsbDeviceFinder instance to a stream.
public static Save ( UsbDeviceFinder usbDeviceFinder, Stream outStream ) : void
usbDeviceFinder UsbDeviceFinder
outStream Stream
return void

UsbDeviceFinder() protected method

protected UsbDeviceFinder ( ) : System
return System

UsbDeviceFinder() public method

Creates a UsbDeviceFinder class for locating usb devices by a unique Guid string.
public UsbDeviceFinder ( System.Guid deviceInterfaceGuid ) : System
deviceInterfaceGuid System.Guid The unique to find.
return System

UsbDeviceFinder() protected method

Use a serialization stream to fill the UsbDeviceFinder class.
protected UsbDeviceFinder ( SerializationInfo info, StreamingContext context ) : System
info System.Runtime.Serialization.SerializationInfo
context System.Runtime.Serialization.StreamingContext
return System

UsbDeviceFinder() public method

Creates a UsbDeviceFinder class for locating usb devices.
public UsbDeviceFinder ( int vid ) : System
vid int The vendor id of the usb device to find.
return System

UsbDeviceFinder() public method

Creates a UsbDeviceFinder class for locating usb devices vendor and product ID.
public UsbDeviceFinder ( int vid, int pid ) : System
vid int The vendor id of the usb device to find.
pid int The product id of the usb device to find.
return System

UsbDeviceFinder() public method

Creates a UsbDeviceFinder class for locating usb devices by VendorID, ProuctID, and Revision code.
public UsbDeviceFinder ( int vid, int pid, int revision ) : System
vid int The vendor id of the usb device to find.
pid int The product id of the usb device to find.
revision int The revision number of the usb device to find.
return System

UsbDeviceFinder() public method

Creates a UsbDeviceFinder class for locating and identifying usb devices.
public UsbDeviceFinder ( int vid, int pid, int revision, string serialNumber, System.Guid deviceInterfaceGuid ) : System
vid int The vendor id of the usb device to find, or to ignore.
pid int The product id of the usb device to find, or to ignore.
revision int The revision number of the usb device to find, or to ignore.
serialNumber string The serial number of the usb device to find, or null to ignore.
deviceInterfaceGuid System.Guid The unique guid of the usb device to find, or to ignore.
return System

UsbDeviceFinder() public method

Creates a UsbDeviceFinder class for locating usb devices by VendorID, ProductID, and Serial number.
public UsbDeviceFinder ( int vid, int pid, string serialNumber ) : System
vid int The vendor id of the usb device to find.
pid int The product id of the usb device to find.
serialNumber string The serial number of the usb device to find.
return System

UsbDeviceFinder() public method

Creates a UsbDeviceFinder class for locating usb devices by a serial number.
public UsbDeviceFinder ( string serialNumber ) : System
serialNumber string The serial number of the usb device to find.
return System

Property Details

NO_GUID public_oe static_oe property

The "exclude from search" value for DeviceInterfaceGuid.
public static Guid,System NO_GUID
return System.Guid