1 #include <QtCore/QCoreApplication>
3 #include <../../plugins/rawhid/pjrc_rawhid.h>
7 class MyThread
: public QThread
{
13 pjrc_rawhid hidHandle
;
14 int numDevices
= hidHandle
.open(1, 0x20a0, 0x4117, 0, 0); // 0xff9c,0x0001);
15 if (numDevices
== 0) {
16 numDevices
= hidHandle
.open(1, 0x0483, 0, 0, 0);
19 qDebug() << numDevices
<< " device(s) opened";
21 // hidHandle.mytest(0);
26 int result
= hidHandle
.send(0, buf
, BUF_LEN
, 500);
28 qDebug() << result
<< " bytes sent";
30 int received
= hidHandle
.receive(0, buf
, BUF_LEN
, 3500);
32 qDebug("%u bytes received. First value %x second %x", received
, buf
[0], buf
[1]);
37 int main(int argc
, char *argv
[])
39 QCoreApplication
a(argc
, argv
);