What is the best USB library to communicate with USB HID devices on Windows?

Torleif picture Torleif · Nov 11, 2008 · Viewed 29.7k times · Source

The library should;

  • Be easy to use and few lines of client code should accomplish much
  • Be as platform independent as possible. (In case of future ports to other platforms)
  • Have C++ bindings.
  • Be mature and stable

I would also like to be notified of most HID events through callbacks.

I have considered the following alternatives:

  • libhid - (Unfortunately?) this is GPL and cannot be used in my application.
  • WDK - Seems to be a bit low-level for my use. I don’t need that kind of control.
  • atusbhid - This has an appropriate level of abstraction, but it is firmly tied to the Windows messaging loop

Are there other alternatives to offer?

Answer

Femi picture Femi · Aug 11, 2011

Take a look at hidapi: it is C, which answers the C++ bindings question (effectively :)), is cross platform and has a very permissive license.

It doesn't appear to have the callbacks, but...