Add vendor control transfer support for UNI HUB SL v1.2 #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for UNI HUB SL v1.2 controllers (PID 0xa100, 0x7750) which use USB vendor control
transfers instead of HID.
What happened
So the v1.2 firmware completely ignores HID writes and needs vendor control transfers instead. I
fired up Wireshark and captured what L-Connect was doing, then implemented the same protocol here.
Turns out it's a 3-step process: setup the channel, send the RPM value (2 bytes little-endian),
then commit. The HID approach just doesn't work on these newer controllers.
The code now auto-detects v1.2 devices and uses the control transfer path, while older controllers
still use HID like before. Also fixed the RPM ranges - my fans are labeled 500-1500 RPM so that's
what 0xa100 uses now. There was also an integer overflow bug that made 100% speed wrap around to
like 40% - multiplying two u16s (1100 * 100) overflows at 65535, so it wrapped to 44464. Wasn't an
issue before since the old code sent single-byte speed values instead of actual RPM.
Tested on my controller and everything works great now.