1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-958: WINDOWS HACK ONLY: This is to filter out gamepadcontroller HID device during reconnect.

This is temporary until multiple HID are supported (if needed).
This commit is contained in:
Mathieu Rondonneau 2013-05-28 21:36:10 -07:00
parent 74cc1315b4
commit 6a838417fb
2 changed files with 4 additions and 4 deletions

View File

@ -187,9 +187,8 @@ int opHID_hidapi::open(int max, int vid, int pid, int usage_page, int usage)
tmp_device_ptr->product_id,
NULL);
if (handle)
{
devices_found = 1 ;
if (handle) {
devices_found = 1;
break;
}

View File

@ -131,6 +131,7 @@ QList<USBPortInfo> USBMonitor::availableDevices(int vid, int pid, int bcdDeviceM
#define TCHARToQString(x) QString::fromLocal8Bit((x))
#define TCHARToQStringN(x, y) QString::fromLocal8Bit((x), (y))
#endif /*UNICODE*/
#define HIDMATCHSTRING "COL01"
void USBMonitor::setUpNotifications()
{
@ -193,7 +194,7 @@ bool USBMonitor::matchAndDispatchChangedDevice(const QString & deviceID, const G
DWORD nSize = 0;
TCHAR buf[MAX_PATH];
if (SetupDiGetDeviceInstanceId(devInfo, &spDevInfoData, buf, MAX_PATH, &nSize) &&
deviceID.contains(TCHARToQString(buf))) { // we found a match
deviceID.contains(TCHARToQString(buf)) && deviceID.contains(HIDMATCHSTRING)) { // we found a match
USBPortInfo info;
info.devicePath = deviceID;
if (wParam == DBT_DEVICEARRIVAL) {