mirror of
https://github.com/MatMoul/g810-led.git
synced 2024-12-23 09:16:11 +00:00
Stop prepending a zero byte to the input of hid_write()
hid_write() expects a report ID in the first byte. The 0x11 and 0x12 values sent as the first byte of commands are consistent with report IDs published in the keyboard's USB descriptors. This change was motivated by commands not working reliably using hidapi on macOS with a G Pro keyboard.
This commit is contained in:
parent
3c42eee3e8
commit
d438ec2e3a
@ -798,7 +798,6 @@ bool LedKeyboard::sendDataInternal(byte_buffer_t &data) {
|
|||||||
if (data.size() > 0) {
|
if (data.size() > 0) {
|
||||||
#if defined(hidapi)
|
#if defined(hidapi)
|
||||||
if (! open(currentDevice.vendorID, currentDevice.productID, currentDevice.serialNumber)) return false;
|
if (! open(currentDevice.vendorID, currentDevice.productID, currentDevice.serialNumber)) return false;
|
||||||
data.insert(data.begin(), 0x00);
|
|
||||||
if (hid_write(m_hidHandle, const_cast<unsigned char*>(data.data()), data.size()) < 0) {
|
if (hid_write(m_hidHandle, const_cast<unsigned char*>(data.data()), data.size()) < 0) {
|
||||||
std::cout<<"Error: Can not write to hidraw, try with the libusb version"<<std::endl;
|
std::cout<<"Error: Can not write to hidraw, try with the libusb version"<<std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user