2 ******************************************************************************
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup opHIDPlugin HID Plugin
10 * @brief Impliments a HID USB connection to the flight hardware as a QIODevice
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef OPHID_HIDAPI_H
29 #define OPHID_HIDAPI_H
35 #include "../hidapi/hidapi.h"
36 #include "ophid_const.h"
37 #include "ophid_global.h"
40 class OPHID_EXPORT opHID_hidapi
: public QObject
{
49 int open(int max
, int vid
, int pid
, int usage_page
, int usage
);
51 int receive(int, void *buf
, int len
, int timeout
);
55 int send(int num
, void *buf
, int len
, int timeout
);
57 QString
getserial(int num
);
61 int enumerate(struct hid_device_info
* *current_device_pptr
, int *devices_found
);
65 /** A mutex to protect hid write */
68 /** A mutex to protect hid read */
72 void deviceUnplugged(int);
75 #endif // ifndef OPHID_HIDAPI_H