LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / experimental / HIDTest / main.cpp
blob6734ae38b1dbc88ef14c8444c138f85e7c41b8dd
1 #include <QtCore/QCoreApplication>
2 #include <QThread>
3 #include <../../plugins/rawhid/pjrc_rawhid.h>
5 #define BUF_LEN 64
7 class MyThread : public QThread {
8 public:
10 void run()
12 qDebug() << "Hello";
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);
23 char buf[BUF_LEN];
24 buf[0] = 2;
25 buf[1] = 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);
40 MyThread b;
42 b.start();
44 return a.exec();