Check hidapi version

failbranch
Phil Taylor 2023-02-06 18:19:12 +00:00
rodzic 5654fa524e
commit 69afce7712
2 zmienionych plików z 16 dodań i 1 usunięć

Wyświetl plik

@ -40,6 +40,22 @@ usbController::~usbController()
void usbController::init()
{
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
qInfo(logUsbControl) << QString("Compile-time version matches runtime version of hidapi: %0.%1,%2")
.arg(hid_version()->major)
.arg(hid_version()->minor)
.arg(hid_version()->patch);
}
else {
qInfo(logUsbControl) << QString("Compile-time and runtime versions of hidapi do not match (%0.%1.%2 vs %0.%1.%2)")
.arg(HID_API_VERSION_MAJOR)
.arg(HID_API_VERSION_MINOR)
.arg(HID_API_VERSION_PATCH)
.arg(hid_version()->major)
.arg(hid_version()->minor)
.arg(hid_version()->patch);
}
hidStatus = hid_init();
if (hidStatus) {
qInfo(logUsbControl()) << "Failed to intialize HID Devices";

Wyświetl plik

@ -41,7 +41,6 @@
#endif
#ifndef Q_OS_WIN
//Headers needed for sleeping.
#include <unistd.h>
#endif