Skip to content

Commit d5db3d6

Browse files
dantheman4700CalcProgrammer1
authored andcommitted
Fix G703 Hero RGB control (wired and wireless)
1 parent b3c3e16 commit d5db3d6

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

Controllers/LogitechController/LogitechControllerDetect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ REGISTER_HID_DETECTOR_IPU("Logitech G502 HERO Gaming Mouse",
919919
REGISTER_HID_DETECTOR_IPU("Logitech G403 Prodigy Gaming Mouse", DetectLogitechWired, LOGITECH_VID, LOGITECH_G403_PID, 1, 0xFF00, 2);
920920
REGISTER_HID_DETECTOR_IPU("Logitech G403 Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G403_LIGHTSPEED_PID, 1, 0xFF00, 2);
921921
REGISTER_HID_DETECTOR_IPU("Logitech G703 Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G703_LIGHTSPEED_PID, 1, 0xFF00, 2);
922-
REGISTER_HID_DETECTOR_IPU("Logitech G703 HERO Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G703_HERO_LIGHTSPEED_PID, 1, 0xFF00, 2);
922+
REGISTER_HID_DETECTOR_PU("Logitech G703 HERO Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G703_HERO_LIGHTSPEED_PID, 0xFF00, 2);
923923
REGISTER_HID_DETECTOR_IPU("Logitech G900 Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G900_LIGHTSPEED_PID, 1, 0xFF00, 2);
924924
REGISTER_HID_DETECTOR_IPU("Logitech G903 Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G903_LIGHTSPEED_PID, 1, 0xFF00, 2);
925925
REGISTER_HID_DETECTOR_IPU("Logitech G903 HERO Wireless Gaming Mouse (wired)", DetectLogitechWired, LOGITECH_VID, LOGITECH_G903_LIGHTSPEED_HERO_PID, 2, 0xFF00, 2);

Controllers/LogitechController/LogitechProtocolCommon.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,11 +835,11 @@ uint8_t logitech_device::set8071Effects(uint8_t control)
835835
response.init();
836836

837837
/*-----------------------------------------------------------------*\
838-
| Turn the direct mode on or off via the RGB_feature_index |
838+
| Use longFAPrequest (20 bytes) for FP8071 CONTROL command |
839+
| Short messages (7 bytes) are not supported by some devices |
839840
\*-----------------------------------------------------------------*/
840-
shortFAPrequest set_effects;
841-
set_effects.init(device_index, RGB_feature_index);
842-
set_effects.feature_command = LOGITECH_FP8071_CONTROL;
841+
longFAPrequest set_effects;
842+
set_effects.init(device_index, RGB_feature_index, LOGITECH_FP8071_CONTROL);
843843
set_effects.data[0] = 1;
844844
set_effects.data[1] = 3; //Disables all FW control for PWR (0x02) and RGB (0x01)
845845
set_effects.data[2] = control;
@@ -855,14 +855,23 @@ uint8_t logitech_device::set8071Effects(uint8_t control)
855855
{
856856
std::lock_guard<std::mutex> guard(*mutex);
857857

858-
result = hid_write(dev_use2, set_effects.buffer, set_effects.size());
858+
hid_write(dev_use2, set_effects.buffer, set_effects.size());
859859
result = hid_read_timeout(dev_use2, response.buffer, response.size(), LOGITECH_PROTOCOL_TIMEOUT);
860860
}
861861
else
862862
{
863-
result = hid_write(dev_use2, set_effects.buffer, set_effects.size());
863+
hid_write(dev_use2, set_effects.buffer, set_effects.size());
864864
result = hid_read_timeout(dev_use2, response.buffer, response.size(), LOGITECH_PROTOCOL_TIMEOUT);
865865
}
866+
867+
/*-----------------------------------------------------*\
868+
| Check for HID++ error response (0x8F in feature_index)|
869+
\*-----------------------------------------------------*/
870+
if(response.feature_index == 0x8F)
871+
{
872+
LOG_WARNING("[%s] set8071Effects: HID++ ERROR! ErrCode=%02X",
873+
device_name.c_str(), response.data[2]);
874+
}
866875
}
867876
return result;
868877
}

0 commit comments

Comments
 (0)