A
A
Alexander2016-05-02 21:56:09
Qt
Alexander, 2016-05-02 21:56:09

How to combine Qt5 and WinUSB?

Good day.
The task is to write special software that would read packets in real time from an external sensor connected via USB and display the information received in the form of a graph. With the interface part, everything is clear (fortunately, in the beta version of Qt 5.7, access to QCharts was opened), but with connecting the sensor via USB, options are possible. I will say right away that cross-platform is not required, Windows only, but XP support may be required. Actually, I have found only two options so far:
1. libusb is easy to connect, but working examples are not enough and, as I understand from the documentation, detection of newly connected devices is not supported on Windows
2. WinUSB - did not understand what headers need to be connected in order to at least initialize work with USB, for some reason this is not written in the MSDN examples. Googling, I realized that it should be winusb.h and windows.devices.usb.h, but even after that the code from the examples does not want to compile.
Actually, is it possible to connect to the USB bus like Qt's "signal" model? Or perhaps there is Qt binding to existing libraries?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@ntkt, 2016-05-08
_

As MSDN advises,

Start with the WinUsb Application template included with Microsoft Visual Studio (Ultimate or Professional)

In fact, there is an error, the examples are in the latest versions of the DDK, and not in MSVS itself.
https://code.msdn.microsoft.com/windowshardware/wi...
The success criterion is a successful build of the mentioned example from the DDK.
How fast and easy it will be to start all this with QT, I don’t know.
If you need to quickly, simply and without jokes, then I would immediately implement it all on the Microsoft stack as a whole (.NET + WinUsbNet = these are .NET bindings for winusb).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question