Gets the first connected USB device that matches specified criteria.
Namespace: HidSharpAssembly: HidSharp (in HidSharp.dll) Version: 1.5.0.0 (1.5.0.0)
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:
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: System Nullable Int32
The vendor ID, or null to not filter by vendor ID.
- productID (Optional)
- Type: System Nullable Int32
The product ID, or null to not filter by product ID.
- productVersion (Optional)
- Type: System Nullable Int32
The product version, or null to not filter by product version.
- serialNumber (Optional)
- Type: System String
The serial number, or null to not filter by serial number.
Return Value
The device, or null if none was found.