diff --git a/ground/openpilotgcs/src/plugins/rawhid/rawhidplugin.cpp b/ground/openpilotgcs/src/plugins/rawhid/rawhidplugin.cpp index 744000edd..d7b48745e 100644 --- a/ground/openpilotgcs/src/plugins/rawhid/rawhidplugin.cpp +++ b/ground/openpilotgcs/src/plugins/rawhid/rawhidplugin.cpp @@ -74,7 +74,6 @@ void RawHIDConnection::onDeviceConnected() */ void RawHIDConnection::onDeviceDisconnected() { - emit deviceClosed(this); if (enablePolling) emit availableDevChanged(this); } @@ -86,7 +85,7 @@ QStringList RawHIDConnection::availableDevices() { QStringList devices; - QList portsList = m_usbMonitor.availableDevices(0x20a0, -1, -1); + QList portsList = m_usbMonitor.availableDevices(USB_VID, -1, -1); // We currently list devices by their serial number foreach(USBPortInfo prt, portsList) { devices.append(prt.serialNumber); @@ -95,25 +94,6 @@ QStringList RawHIDConnection::availableDevices() return devices; } - -/// TODO: still needed ??? -void RawHIDConnection::onRawHidDestroyed(QObject *obj) // Pip -{ - if (!RawHidHandle || RawHidHandle != obj) - return; - - RawHidHandle = NULL; -} - -/// TODO: still needed ??? -void RawHIDConnection::onRawHidClosed() -{ - if (RawHidHandle) - { - emit deviceClosed(this); - } -} - QIODevice *RawHIDConnection::openDevice(const QString &deviceName) { //added by andrew @@ -123,13 +103,6 @@ QIODevice *RawHIDConnection::openDevice(const QString &deviceName) //return new RawHID(deviceName); RawHidHandle = new RawHID(deviceName); - - if (RawHidHandle) - { - connect(RawHidHandle, SIGNAL(closed()), this, SLOT(onRawHidClosed()), Qt::QueuedConnection); - connect(RawHidHandle, SIGNAL(destroyed(QObject *)), this, SLOT(onRawHidDestroyed(QObject *)), Qt::QueuedConnection); - } - return RawHidHandle; } @@ -144,8 +117,6 @@ void RawHIDConnection::closeDevice(const QString &deviceName) delete RawHidHandle; RawHidHandle = NULL; - - emit deviceClosed(this); } //end added by andrew } diff --git a/ground/openpilotgcs/src/plugins/rawhid/rawhidplugin.h b/ground/openpilotgcs/src/plugins/rawhid/rawhidplugin.h index 9d1096b6d..dea3f1668 100644 --- a/ground/openpilotgcs/src/plugins/rawhid/rawhidplugin.h +++ b/ground/openpilotgcs/src/plugins/rawhid/rawhidplugin.h @@ -66,19 +66,10 @@ public: bool deviceOpened() { return (RawHidHandle != NULL); } // Pip -signals: - void deviceClosed(QObject *obj); // Pip - -public slots: - void onRawHidClosed(); - protected slots: void onDeviceConnected(); void onDeviceDisconnected(); -private slots: - void onRawHidDestroyed(QObject *obj); - private: RawHID *RawHidHandle; bool enablePolling;