mirror of
https://github.com/MatMoul/g810-led.git
synced 2025-07-01 17:17:01 +00:00
Merge 139af6c3b0dc87a51470099abb2e861df63e1a1e into 7646be49cbd3ad34c0be794ab6da033eee8964bf
This commit is contained in:
commit
af931a790e
@ -787,12 +787,10 @@ bool LedKeyboard::sendDataInternal(byte_buffer_t &data) {
|
||||
#if defined(hidapi)
|
||||
data.insert(data.begin(), 0x00);
|
||||
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;
|
||||
return false;
|
||||
std::cout<<"Error: Can not write to device. Exiting..."<<std::endl;
|
||||
exit(1);
|
||||
}
|
||||
byte_buffer_t data2;
|
||||
data2.resize(21, 0x00);
|
||||
hid_read_timeout(m_hidHandle, const_cast<unsigned char*>(data2.data()), data2.size(), 1);
|
||||
usleep(1100); // Do not remove or decrease this value below 1100 or there will be firmware crashes on G910.
|
||||
return true;
|
||||
#elif defined(libusb)
|
||||
if (data.size() > 20) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user