HidSharp 2.0.2

HIDSharp is a cross-platform .NET wrapper for Windows, MacOS, and Linux (hidraw) USB HID APIs.
It can interface with arbitrary USB HID devices as well as read and write raw reports.

It also includes cross-platform serial port communications and supports interprocess communication for exclusion of HID devices between programs.

There is a newer version of this package available.
See the version list below for details.
Install-Package HidSharp -Version 2.0.2
dotnet add package HidSharp --version 2.0.2
<PackageReference Include="HidSharp" Version="2.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HidSharp --version 2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HidSharp, 2.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install HidSharp as a Cake Addin
#addin nuget:?package=HidSharp&version=2.0.2

// Install HidSharp as a Cake Tool
#tool nuget:?package=HidSharp&version=2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

2.0.1 (April 11, 2018):
 Fixed a bug on Windows where, in some cases, being unable to reconstruct a device's report descriptor could prevent that device from being opened at all.
 HIDSharp now includes assemblies for both .NET Framework 3.5+ and .NET Standard 2.0+.
2.0 (April 9, 2018):
 Vastly improved the report descriptor parsing functionality.
 You can now decode (nearly) any HID device's reports, on all platforms!
 Added GetReportDescriptor support on MacOS version 10.8 and higher.
 Added GetReportDescriptor support on Windows. This descriptor is a reconstruction as Windows does not provide a way to directly access this information.
 Added an AreDriversBeingInstalled property on DeviceList. (Windows will sometimes close streams of composite HID devices opened while their drivers are being installed.)
 Added a Changed event on DeviceList, for detecting device connect and disconnect.
 Added a NativeImplementation property to Device.
 Added an exclusivity layer, with the ability to request interruption. This is useful for interprocess cooperation, but must be enabled manually.
 Added support for serial ports. This is still somewhat buggy on Linux, but on MacOS it works better than the Mono native implementation.
 Added support for Linux libudev.so.1.
 Exposed GetFileSystemName(). This can be used on Linux to check hidraw permissions.
 Fixed max report lengths on MacOS for devices which do not use a Report ID.
 Fixed Linux and MacOS not throwing IOException on HID Read() when the device is disconnected.
 Fixed Linux support on recent Mono versions.
 Fixed 32-bit Linux support (Raspberry Pi).
 GetFeature() and SetFeature() now work on Linux.
 HIDSharp now uses the Apache open-source license.
 Feedback on the new features is appreciated. Some code modifications will be needed to use this new version.

1.5 (May 18, 2013):
 Added the DevicePath property to HidDevice.
 This is useful for differentiating devices with the same VID, PID, etc. (April 21, 2013):
 Added missing XML documentation file to the archive.

1.4 (April 20, 2013):
 Documented the most important classes.
 Fixed a problem with output reports on 64-bit Windows.
 Fixed a timeout bug on Windows.
 Parallelized device enumeration.
 Reordered platform detection to prevent binary planting on Windows.

1.3 (February 23, 2013):
 Fixed Linux libudev reference to not require developer package symlinks.
1.2 (October 16, 2012):
 Fixed MacOS support.

1.1 (July 28, 2012):
 Added experimental MacOS and Linux support.
 Added experimental report descriptor parsing.
1.0 (August 28, 2010):
 Initial release.


This package has no dependencies.

NuGet packages (15)

Showing the top 5 NuGet packages that depend on HidSharp:

Package Downloads
Buttplug Server Hid Device and Serial Port Subtype Manager, based on the HidSharp Library. (.Net Framework 4.7+/.Net Standard 2.0)
BlinkStick Generic Hid Library with KeesTalksTech modifications
Munts Technologies Remote I/O Library for .Net Standard 2.0
Monitor the temperature sensors, fan speeds, voltages, load and clock speeds of your computer.
Cross-platform .NET Standard library for asynchronous access to HID Devices (e.g. gamepads, joysticks, etc.)

GitHub repositories (7)

Showing the top 5 popular GitHub repositories that depend on HidSharp:

Repository Stars
Windows Driver and XInput Wrapper for Sony DualShock 3/4 Controllers
Libre Hardware Monitor, home of the fork of Open Hardware Monitor
DirectInput to XInput wrapper
Provides advanced unified lighting across many different brands RGB peripherals
The one-stop SDK for RGB-peripherals

Version History

Version Downloads Last updated
2.1.0 52,265 5/4/2019
2.0.8 7,053 1/21/2019
2.0.5 3,257 11/11/2018
2.0.2 16,049 5/5/2018
2.0.1 2,784 4/11/2018
1.5.0 33,169 5/18/2013 895 4/21/2013
1.4.0 937 4/20/2013
1.3.0 939 2/23/2013