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:
parent
74cc1315b4
commit
6a838417fb
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user