QHidDevice Class
This class handles all HID operations. More...
Header: | #include <QHidDevice> |
qmake: | QT += usb |
Inherits: | QObject |
Note: All functions in this class are reentrant.
Public Functions
void | close() |
qint32 | getFeatureReport(QByteArray *data, int len = -1) |
bool | isOpen() const |
QString | manufacturer() |
bool | open(quint16 vid, quint16 pid, const QString *serial = Q_NULLPTR) |
QString | product() |
qint32 | read(QByteArray *data, int len = -1, int timeout = -1) |
qint32 | sendFeatureReport(const QByteArray *data, int len = -1) |
QString | serialNumber() |
qint32 | write(const QByteArray *data, int len = -1) |
Detailed Description
Member Function Documentation
void QHidDevice::close()
Close the device.
qint32 QHidDevice::getFeatureReport(QByteArray *data, int len = -1)
Get a feature report.
bool QHidDevice::isOpen() const
Returns true
if device is open.
QString QHidDevice::manufacturer()
Returns the manufacturer string.
bool QHidDevice::open(quint16 vid, quint16 pid, const QString *serial = Q_NULLPTR)
Opens the HID device, using vid Vendor ID, pid Product ID, and an optional serial number. Returns true
on sucess.
QString QHidDevice::product()
Returns the product string.
qint32 QHidDevice::read(QByteArray *data, int len = -1, int timeout = -1)
Read from device to data.
len defaults to the size of data. timeout defaults to -1 (unlimited, blocking).
qint32 QHidDevice::sendFeatureReport(const QByteArray *data, int len = -1)
Send a Feature report.
QString QHidDevice::serialNumber()
Returns the serial number string.
qint32 QHidDevice::write(const QByteArray *data, int len = -1)
Write data to device.
len defaults to the size of data.