GetDeviceOrDefault Method

HidSharp

HidDeviceLoader GetDeviceOrDefault Method HIDSharp
Gets the first connected USB device that matches specified criteria.

Namespace: HidSharp
Assembly: HidSharp (in HidSharp.dll) Version: 1.5.0.0 (1.5.0.0)

Syntax

public HidDevice GetDeviceOrDefault(
	Nullable<int> vendorID = null,
	Nullable<int> productID = null,
	Nullable<int> productVersion = null,
	string serialNumber = null
)
public HidDevice GetDeviceOrDefault(
	Nullable<int> vendorID = null,
	Nullable<int> productID = null,
	Nullable<int> productVersion = null,
	string serialNumber = null
)
Public Function GetDeviceOrDefault ( _
	Optional vendorID As Nullable(Of Integer) = Nothing, _
	Optional productID As Nullable(Of Integer) = Nothing, _
	Optional productVersion As Nullable(Of Integer) = Nothing, _
	Optional serialNumber As String = Nothing _
) As HidDevice
Public Function GetDeviceOrDefault ( _
	Optional vendorID As Nullable(Of Integer) = Nothing, _
	Optional productID As Nullable(Of Integer) = Nothing, _
	Optional productVersion As Nullable(Of Integer) = Nothing, _
	Optional serialNumber As String = Nothing _
) As HidDevice
public:
HidDevice^ GetDeviceOrDefault(
	Nullable<int> vendorID = nullptr, 
	Nullable<int> productID = nullptr, 
	Nullable<int> productVersion = nullptr, 
	String^ serialNumber = nullptr
)
public:
HidDevice^ GetDeviceOrDefault(
	Nullable<int> vendorID = nullptr, 
	Nullable<int> productID = nullptr, 
	Nullable<int> productVersion = nullptr, 
	String^ serialNumber = nullptr
)
member GetDeviceOrDefault : 
        ?vendorID : Nullable<int> * 
        ?productID : Nullable<int> * 
        ?productVersion : Nullable<int> * 
        ?serialNumber : string 
(* Defaults:
        let _vendorID = defaultArg vendorID null 
        let _productID = defaultArg productID null 
        let _productVersion = defaultArg productVersion null 
        let _serialNumber = defaultArg serialNumber null
*)
-> HidDevice
member GetDeviceOrDefault : 
        ?vendorID : Nullable<int> * 
        ?productID : Nullable<int> * 
        ?productVersion : Nullable<int> * 
        ?serialNumber : string 
(* Defaults:
        let _vendorID = defaultArg vendorID null 
        let _productID = defaultArg productID null 
        let _productVersion = defaultArg productVersion null 
        let _serialNumber = defaultArg serialNumber null
*)
-> HidDevice

Parameters

vendorID (Optional)
Type: OnlineSystem Nullable OnlineInt32 
The vendor ID, or null to not filter by vendor ID.
productID (Optional)
Type: OnlineSystem Nullable OnlineInt32 
The product ID, or null to not filter by product ID.
productVersion (Optional)
Type: OnlineSystem Nullable OnlineInt32 
The product version, or null to not filter by product version.
serialNumber (Optional)
Type: OnlineSystem String
The serial number, or null to not filter by serial number.

Return Value

The device, or null if none was found.
See Also