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 <unistd.h>
|
||||
#include <algorithm>
|
||||
#include "/usr/include/libusb-1.0/libusb.h"
|
||||
#include "libusb.h"
|
||||
|
||||
|
||||
bool Keyboard::isAttached() {
|
||||
@ -21,7 +21,8 @@ bool Keyboard::attach() {
|
||||
int pid = 0;
|
||||
for(ssize_t i = 0; i < cnt; i++) {
|
||||
libusb_device *device = devs[i];
|
||||
libusb_device_descriptor desc = {0, // bLength
|
||||
libusb_device_descriptor desc = {
|
||||
0, // bLength
|
||||
0, // bDescriptorType
|
||||
0, // bcdUSB
|
||||
0, // bDeviceClass
|
||||
@ -34,7 +35,8 @@ bool Keyboard::attach() {
|
||||
0, // iManufacturer
|
||||
0, // iProduct
|
||||
0, // iSerialNumber
|
||||
0}; // bNumConfigurations
|
||||
0 // bNumConfigurations
|
||||
};
|
||||
libusb_get_device_descriptor(device, &desc);
|
||||
if (desc.idVendor == 0x046d) {
|
||||
if (desc.idProduct == 0xc331) { pid = desc.idProduct; break; } // G810 spectrum
|
||||
|
Loading…
Reference in New Issue
Block a user