mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
OP GCS/HID - Fixes a problem created with the conversion of the monitor class to singleton. I don't quite understand the problem so this is just a quick fix. Also changed PipXtreme gadget to use new PID.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3023 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
4fab429f50
commit
162deda2ba
@ -394,7 +394,7 @@ void PipXtremeGadgetWidget::getPorts()
|
||||
pjrc_rawhid *rawHidHandle = new pjrc_rawhid();
|
||||
if (rawHidHandle)
|
||||
{
|
||||
int opened = rawHidHandle->open(10, 0x20A0, 0x4117, 0xFF9C, 0x0001);
|
||||
int opened = rawHidHandle->open(10, 0x20A0, 0x415C, 0xFF9C, 0x0001);
|
||||
if (opened > 0)
|
||||
{
|
||||
QList<QString> usb_ports;
|
||||
|
@ -31,7 +31,6 @@
|
||||
|
||||
#include "usbmonitor.h"
|
||||
#include <QDebug>
|
||||
|
||||
#define printf qDebug
|
||||
|
||||
void USBMonitor::deviceEventReceived() {
|
||||
@ -80,6 +79,7 @@ QList<USBPortInfo> USBMonitor::availableDevices(int vid, int pid, int bcdDeviceM
|
||||
QList<USBPortInfo> thePortsWeWant;
|
||||
|
||||
foreach (USBPortInfo port, allPorts) {
|
||||
//qDebug()<<"USBMonitorWin:Port VID="<<port.vendorID<<"PID="<<port.productID<<"bcddevice="<<port.bcdDevice;
|
||||
if((port.vendorID==vid || vid==-1) && (port.productID==pid || pid==-1) && ((port.bcdDevice>>8)==bcdDeviceMSB || bcdDeviceMSB==-1) &&
|
||||
( (port.bcdDevice&0x00ff) ==bcdDeviceLSB || bcdDeviceLSB==-1))
|
||||
thePortsWeWant.append(port);
|
||||
@ -223,8 +223,11 @@ Returns a list of all currently available devices
|
||||
*/
|
||||
QList<USBPortInfo> USBMonitor::availableDevices()
|
||||
{
|
||||
GUID guid_hidd;
|
||||
HidD_GetHidGuid(&guid_hidd);
|
||||
QList<USBPortInfo> ports;
|
||||
enumerateDevicesWin(guid_hid, &ports);
|
||||
enumerateDevicesWin(guid_hidd, &ports);
|
||||
//qDebug()<<"USBMonitorWin availabledevices="<<ports.count();
|
||||
return ports;
|
||||
}
|
||||
|
||||
@ -232,10 +235,10 @@ void USBMonitor::enumerateDevicesWin( const GUID & guid, QList<USBPortInfo>* inf
|
||||
{
|
||||
HDEVINFO devInfo;
|
||||
USBPortInfo info;
|
||||
|
||||
//qDebug()<<"enumerateDevicesWin1";
|
||||
if( (devInfo = SetupDiGetClassDevs(&guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE)) != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
||||
//qDebug()<<"enumerateDevicesWin2";
|
||||
SP_DEVINFO_DATA devInfoData;
|
||||
devInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
|
||||
for(DWORD i = 0; SetupDiEnumDeviceInfo(devInfo, i, &devInfoData); i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user