mirror of
https://github.com/MatMoul/g810-led.git
synced 2024-12-23 09:16:11 +00:00
include libusb.h and reindent libusb_device_descriptor desc
This commit is contained in:
parent
98b429f4e4
commit
519f20211c
@ -2,7 +2,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "/usr/include/libusb-1.0/libusb.h"
|
#include "libusb.h"
|
||||||
|
|
||||||
|
|
||||||
bool Keyboard::isAttached() {
|
bool Keyboard::isAttached() {
|
||||||
@ -21,20 +21,22 @@ bool Keyboard::attach() {
|
|||||||
int pid = 0;
|
int pid = 0;
|
||||||
for(ssize_t i = 0; i < cnt; i++) {
|
for(ssize_t i = 0; i < cnt; i++) {
|
||||||
libusb_device *device = devs[i];
|
libusb_device *device = devs[i];
|
||||||
libusb_device_descriptor desc = {0, // bLength
|
libusb_device_descriptor desc = {
|
||||||
0, // bDescriptorType
|
0, // bLength
|
||||||
0, // bcdUSB
|
0, // bDescriptorType
|
||||||
0, // bDeviceClass
|
0, // bcdUSB
|
||||||
0, // bDeviceSubClass
|
0, // bDeviceClass
|
||||||
0, // bDeviceProtocol
|
0, // bDeviceSubClass
|
||||||
0, // bMaxPacketSize0
|
0, // bDeviceProtocol
|
||||||
0, // idVendor
|
0, // bMaxPacketSize0
|
||||||
0, // idProduct
|
0, // idVendor
|
||||||
0, // bcdDevice
|
0, // idProduct
|
||||||
0, // iManufacturer
|
0, // bcdDevice
|
||||||
0, // iProduct
|
0, // iManufacturer
|
||||||
0, // iSerialNumber
|
0, // iProduct
|
||||||
0}; // bNumConfigurations
|
0, // iSerialNumber
|
||||||
|
0 // bNumConfigurations
|
||||||
|
};
|
||||||
libusb_get_device_descriptor(device, &desc);
|
libusb_get_device_descriptor(device, &desc);
|
||||||
if (desc.idVendor == 0x046d) {
|
if (desc.idVendor == 0x046d) {
|
||||||
if (desc.idProduct == 0xc331) { pid = desc.idProduct; break; } // G810 spectrum
|
if (desc.idProduct == 0xc331) { pid = desc.idProduct; break; } // G810 spectrum
|
||||||
|
Loading…
Reference in New Issue
Block a user