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
)

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