37 #include <QWaitCondition>
41 #include "hidapi/hidapi.h"
47 #define RAW_HID_QXTLOG_DEBUG(...) qDebug() << __VA_ARGS__
48 #else // RAW_HID_DEBUG
49 #define RAW_HID_QXTLOG_DEBUG(...)
50 #endif // RAW_HID_DEBUG
134 class RAWHID_EXPORT
RawHID :
public QIODevice
143 virtual bool open(OpenMode mode);
144 virtual void close();
145 virtual bool isSequential()
const;
148 void sendReadyRead();
151 virtual qint64 readData(
char *
data, qint64 maxSize);
152 virtual qint64 writeData(
const char *data, qint64 maxSize);
153 virtual qint64 bytesAvailable()
const;
154 virtual qint64 bytesToWrite()
const;
RawHIDReadThread * m_readThread
RawHIDReadThread(hid_device *device)
virtual ~RawHIDReadThread()
void stop()
Tell the thread to stop and make sure it wakes up immediately.
RawHIDWriteThread(hid_device *device)
int pushDataToWrite(const char *data, int size)
qint64 getBytesAvailable()
virtual ~RawHIDWriteThread()
RawHIDWriteThread * m_writeThread
int getReadData(char *data, int size)
QWaitCondition m_newDataToWrite