Closed leogx9r closed 3 years ago
Could you create a PR with your changes? This will make it easier to check them out.
One problem is that host profiles is a very complex feature and may be different for different devices. I might be able to check out the differences.
Thanks for the acknowledgement. PR was created along with relevant changes for checks to pass.
Information
Output of
solaar show
for the target device (if applicable):Greetings,
I'm already aware of the previous efforts to add and as such, control the report/polling rates for HID++ 2.0+ devices, which was removed due to the insufficient documentation available of changing the device to Host-mode which seems to be required for this particular feature.
I've spent a couple hours trying to understand the code base of this project and managed to get it working. The device mode for HID++ 2.0 and beyond can be retrieved or changed by calling
0x8100
, labeled asFEATURE.ONBOARD_PROFILES
with the function ID0x20
and0x10
respectively. Setting the polling rate requires the device to be set in Host mode before it can be adjusted, as such the solution is simply to check what mode the device is in, before changing the polling rate and switch modes if required.The following patch is what I've managed to hack together in the brief time I spent with this code base. While it probably has mistakes, it's my hope that (while this isn't a pull request due to lacking time to properly respond to such engagements), someone can (properly) implement this feature. This was tested with my Logitech G305, which by default, uses a 1000 Hz polling rate when running the device in onboard mode. I've managed to change the polling rates using the following patch to all supported values, 125 Hz, 250 Hz, 500 Hz and 1000 Hz. The code itself should work on all HID++ 2.0+ devices since it is based off the work here as well as the previous code from pull requests like https://github.com/pwr-Solaar/Solaar/pull/840, https://github.com/pwr-Solaar/Solaar/pull/824, with relevant issues being https://github.com/pwr-Solaar/Solaar/issues/850, https://github.com/pwr-Solaar/Solaar/issues/792
This is based off the current HEAD on master branch, which at the time of writing is f68a831. Additionally, the
show
command was modified to show whether the device in question is in host mode or onboard mode.Below are a couple screenshots of said patch working, measured using
evhz
,Respectfully, Leonardo.