Impliments a HID USB connection to the flight hardware as a QIODevice.
More...
|
| | RawHIDReadThread::RawHIDReadThread (hid_device *device) |
| |
| virtual | RawHIDReadThread::~RawHIDReadThread () |
| |
| int | RawHIDReadThread::getReadData (char *data, int size) |
| |
| qint64 | RawHIDReadThread::getBytesAvailable () |
| |
| void | RawHIDReadThread::stop () |
| |
| void | RawHIDReadThread::run () |
| |
| | RawHIDWriteThread::RawHIDWriteThread (hid_device *device) |
| |
| virtual | RawHIDWriteThread::~RawHIDWriteThread () |
| |
| int | RawHIDWriteThread::pushDataToWrite (const char *data, int size) |
| |
| qint64 | RawHIDWriteThread::getBytesToWrite () |
| |
| void | RawHIDWriteThread::stop () |
| | Tell the thread to stop and make sure it wakes up immediately. More...
|
| |
| void | RawHIDWriteThread::run () |
| |
| | RawHID::RawHID () |
| |
| | RawHID::RawHID (USBDevice *deviceName) |
| |
| virtual | RawHID::~RawHID () |
| |
| virtual bool | RawHID::open (OpenMode mode) |
| |
| virtual void | RawHID::close () |
| |
| virtual bool | RawHID::isSequential () const |
| |
| virtual qint64 | RawHID::readData (char *data, qint64 maxSize) |
| |
| virtual qint64 | RawHID::writeData (const char *data, qint64 maxSize) |
| |
| virtual qint64 | RawHID::bytesAvailable () const |
| |
| virtual qint64 | RawHID::bytesToWrite () const |
| |
| | RawHIDConnection::RawHIDConnection () |
| |
| virtual | RawHIDConnection::~RawHIDConnection () |
| |
| virtual QList< Core::IDevice * > | RawHIDConnection::availableDevices () |
| |
| virtual QIODevice * | RawHIDConnection::openDevice (Core::IDevice *deviceName) |
| |
| virtual void | RawHIDConnection::closeDevice (const QString &deviceName) |
| |
| virtual QString | RawHIDConnection::connectionName () |
| |
| virtual QString | RawHIDConnection::shortName () |
| |
| virtual void | RawHIDConnection::suspendPolling () |
| |
| virtual void | RawHIDConnection::resumePolling () |
| |
| bool | RawHIDConnection::deviceOpened () |
| |
| unsigned char | USBPortInfo::getRunState () |
| |
| bool | USBPortInfo::operator== (USBPortInfo const &port) |
| |
| | Q_DECLARE_METATYPE (USBPortInfo) |
| |
| static USBMonitor * | USBMonitor::instance () |
| |
| | USBMonitor::USBMonitor (QObject *parent=nullptr) |
| |
| | USBMonitor::~USBMonitor () |
| |
| QList< USBPortInfo > | USBMonitor::availableDevices () |
| |
| QList< USBPortInfo > | USBMonitor::availableDevices (int vid, int pid, int boardModel, int runState) |
| | Be a bit more picky and ask only for a specific type of device: More...
|
| |
| | USBSignalFilter::USBSignalFilter (int vid, int pid, int boardModel, int runState) |
| |
| | USBSignalFilter::USBSignalFilter (QList< int > vid, int pid, int boardModel, int runState) |
| |
Impliments a HID USB connection to the flight hardware as a QIODevice.
Monitors the USB bus for devince insertion/removal.
Implements the USB monitor on Mac using*.
- Todo:
- XX
- Todo:
- XX
- Todo:
- XX
| Enumerator |
|---|
| Bootloader |
|
| Running |
|
| Upgrader |
|
Definition at line 90 of file usbmonitor.h.
| QList< USBPortInfo > USBMonitor::availableDevices |
( |
int |
vid, |
|
|
int |
pid, |
|
|
int |
bcdDeviceMSB, |
|
|
int |
bcdDeviceLSB |
|
) |
| |
Be a bit more picky and ask only for a specific type of device:
- Parameters
-
| [in] | vid | VID to screen or1 to ignore |
| [in] | pid | PID to screen or1 to ignore |
| [in] | bcdDeviceMSB | MSB of bcdDevice to screen or1 to ignore |
| [in] | bcdDeviceLSB | LSB of bcdDevice to screen or1 to ignore |
- Returns
- List of USBPortInfo that meet this criterion
- Note
- On OpenPilot, the bcdDeviceLSB indicates the run state: bootloader or running. bcdDeviceMSB indicates the board model.
Definition at line 159 of file usbmonitor.cpp.
| qint64 RawHID::bytesAvailable |
( |
| ) |
const |
|
protectedvirtual |
| qint64 RawHID::bytesToWrite |
( |
| ) |
const |
|
protectedvirtual |
| void RawHIDConnection::closeDevice |
( |
const QString & |
deviceName | ) |
|
|
virtual |
| QString RawHIDConnection::connectionName |
( |
| ) |
|
|
virtual |
| bool RawHIDConnection::deviceOpened |
( |
| ) |
|
|
inline |
| qint64 RawHIDReadThread::getBytesAvailable |
( |
| ) |
|
return the bytes buffered
Definition at line 113 of file rawhid.cpp.
| qint64 RawHIDWriteThread::getBytesToWrite |
( |
| ) |
|
Return the number of bytes buffered
Definition at line 215 of file rawhid.cpp.
| int RawHIDReadThread::getReadData |
( |
char * |
data, |
|
|
int |
size |
|
) |
| |
Return the data read so far without waiting
Definition at line 101 of file rawhid.cpp.
| unsigned char USBPortInfo::getRunState |
( |
| ) |
|
|
inline |
| bool RawHID::isSequential |
( |
| ) |
const |
|
virtual |
| bool RawHID::open |
( |
OpenMode |
mode | ) |
|
|
virtual |
| QIODevice * RawHIDConnection::openDevice |
( |
Core::IDevice * |
device | ) |
|
|
virtual |
Open a device, and return a QIODevice interface from it It should be a dynamically created object as it will be deleted by the connection manager.
Implements Core::IConnection.
Definition at line 110 of file rawhidplugin.cpp.
| bool USBPortInfo::operator== |
( |
USBPortInfo const & |
port | ) |
|
|
inline |
| int RawHIDWriteThread::pushDataToWrite |
( |
const char * |
data, |
|
|
int |
size |
|
) |
| |
Add some data to be written without waiting
Definition at line 205 of file rawhid.cpp.
| RawHIDConnection::RawHIDConnection |
( |
| ) |
|
| RawHIDReadThread::RawHIDReadThread |
( |
hid_device * |
device | ) |
|
| RawHIDWriteThread::RawHIDWriteThread |
( |
hid_device * |
device | ) |
|
| qint64 RawHID::readData |
( |
char * |
data, |
|
|
qint64 |
maxSize |
|
) |
| |
|
protectedvirtual |
| void RawHIDConnection::resumePolling |
( |
| ) |
|
|
virtual |
| void RawHIDReadThread::run |
( |
| ) |
|
|
protected |
| void RawHIDWriteThread::run |
( |
| ) |
|
|
protected |
| QString RawHIDConnection::shortName |
( |
| ) |
|
|
virtual |
| void RawHIDReadThread::stop |
( |
| ) |
|
|
inline |
| void RawHIDWriteThread::stop |
( |
| ) |
|
Tell the thread to stop and make sure it wakes up immediately.
Definition at line 196 of file rawhid.cpp.
| void RawHIDConnection::suspendPolling |
( |
| ) |
|
|
virtual |
| USBMonitor::USBMonitor |
( |
QObject * |
parent = nullptr | ) |
|
| USBSignalFilter::USBSignalFilter |
( |
int |
vid, |
|
|
int |
pid, |
|
|
int |
boardModel, |
|
|
int |
runState |
|
) |
| |
| USBSignalFilter::USBSignalFilter |
( |
QList< int > |
vid, |
|
|
int |
pid, |
|
|
int |
boardModel, |
|
|
int |
runState |
|
) |
| |
| qint64 RawHID::writeData |
( |
const char * |
data, |
|
|
qint64 |
maxSize |
|
) |
| |
|
protectedvirtual |
| RawHIDConnection::~RawHIDConnection |
( |
| ) |
|
|
virtual |
| RawHIDReadThread::~RawHIDReadThread |
( |
| ) |
|
|
virtual |
| RawHIDWriteThread::~RawHIDWriteThread |
( |
| ) |
|
|
virtual |
| USBMonitor::~USBMonitor |
( |
| ) |
|
| int USBPortInfo::bcdDevice |
| hid_device* RawHIDReadThread::m_handle |
|
protected |
| hid_device* RawHIDWriteThread::m_handle |
|
protected |
| hid_device* RawHID::m_handle |
|
protected |
| QWaitCondition RawHIDWriteThread::m_newDataToWrite |
|
protected |
Synchronize task with data arival
Definition at line 121 of file rawhid.h.
| QByteArray RawHIDReadThread::m_readBuffer |
|
protected |
QByteArray might not be the most efficient way to implement a circular buffer but it's good enough and very simple
Definition at line 79 of file rawhid.h.
| QMutex RawHIDReadThread::m_readBufMtx |
|
protected |
A mutex to protect read buffer
Definition at line 82 of file rawhid.h.
| bool RawHIDReadThread::m_running |
|
protected |
| bool RawHIDWriteThread::m_running |
|
protected |
| QByteArray RawHIDWriteThread::m_writeBuffer |
|
protected |
QByteArray might not be the most efficient way to implement a circular buffer but it's good enough and very simple
Definition at line 115 of file rawhid.h.
| QMutex RawHIDWriteThread::m_writeBufMtx |
|
protected |
A mutex to protect read buffer
Definition at line 118 of file rawhid.h.
| QString USBPortInfo::manufacturer |
| QString USBPortInfo::path |
| QString USBPortInfo::product |
| int USBPortInfo::productID |
| QString USBPortInfo::serialNumber |
| int USBPortInfo::vendorID |
| void USBSignalFilter::deviceDiscovered |
( |
| ) |
|
|
signal |
A new device has been connected to the system.
setUpNotifications() must be called first to enable event-driven device notifications. Currently only implemented on Windows and OS X.
- Parameters
-
| info | The device that has been discovered. |
| void USBSignalFilter::deviceRemoved |
( |
| ) |
|
|
signal |
A device has been disconnected from the system.
setUpNotifications() must be called first to enable event-driven device notifications. Currently only implemented on Windows and OS X.
- Parameters
-
| info | The device that was disconnected. |
| void RawHIDReadThread::readyToRead |
( |
| ) |
|
|
signal |
| void RawHIDConnection::onDeviceConnected |
( |
| ) |
|
|
protectedslot |
The USB monitor tells us a new device appeared
Definition at line 66 of file rawhidplugin.cpp.
| void RawHIDConnection::onDeviceDisconnected |
( |
| ) |
|
|
protectedslot |
The USB monitor tells us a device disappeard
Definition at line 74 of file rawhidplugin.cpp.