-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdevicecomm.h
34 lines (25 loc) · 846 Bytes
/
devicecomm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef DEVICECOMM_H
#define DEVICECOMM_H
#include <QString>
#include "libusb-1.0/libusb.h"
class DeviceComm
{
public:
DeviceComm();
~DeviceComm();
// find drevo device
QString enumerateDevice();
// get keyboard layout
int getKeyboardLayout() { return m_kb_layout; }
// set device data( length < 8)
int setDeviceData(const unsigned char *data, size_t length);
// set device datas ( length > 8)
int setDeviceDatas(const unsigned char *data, size_t length);
private:
QString IsExsitDevice(uint16_t dev_vid, uint16_t dev_pid);
libusb_device_handle* m_hid_device;
bool m_isconnect;
int m_interface; //default 0
int m_kb_layout;
};
#endif // DEVICECOMM_H