Is there a C++ cross platform USB library?

前端 未结 2 1013
轻奢々
轻奢々 2021-02-02 17:07

I\'m (going to be) writing an application in Qt that will run on the 3 main OSes (Windows, Linux and Mac). One of the features of this app is that it needs USB to talk to a piec

2条回答
  •  时光取名叫无心
    2021-02-02 17:17

    I'd just like to update this post for anyone who is coming back to it nowadays...

    Libusb (version 0.1) has since been deprecated. The modern standard is to use libusb-1.0 or libusbx.

    Personally, I think there are many reasons to use libusbx. It was written by frustrated libusb-0.1 developers who wanted a more frequent update cycle and better bug maintenance system.

    My reasons for suggesting libusbx are as follows:

    • does not require sudo access
    • worked much better for me out of the box with reading incoming messages
    • better support and more frequent responses to bugs/issues
    • async and synchronous support for sending/receiving messages

    Granted, libusb-1.0 does support async/sync reporting... but the philosophy behind libusbx is much more appealing and the documentation is better.

    So it's totally up to you, if you or whoever would still like to know some more about the libraries, the history is very easy to find online. You can also see this stack question for some more info on the immediate subject.

提交回复
热议问题