chmod222 / libcmmk

An unofficial LED control API for Coolermaster Masterkey keyboards
GNU Lesser General Public License v3.0
100 stars 24 forks source link

Packet captures #4

Open twifty opened 5 years ago

twifty commented 5 years ago

I'm guessing you used USBPCap and wireshark to sniff the packets. Would you mind sharing those logs?

I am working on the AMD Spire fan, which comes with the Ryzen 27000X. Cooler Master must be using the same protocol since the packets I've captured are very similar to what you have documented. I now need to cross reference my data with keyboard packets to try and figure out what the individual flags/values mean.

chmod222 commented 5 years ago

Sure. They are fairly unorganized and don't cover all use cases, but maybe they'll help anyway.

traces.tar.gz

Most of the information is distilled in the protocol file though.

twifty commented 5 years ago

Thanks for that. I've come across references to keyboard settings in both the firmware and software, even though the software is only for fans. Though there are some differences to your findings. I wouldn't be surprised if they have used the same, or slightly modified, firmware.

scottjbarr commented 5 years ago

Does anyone have a packet capture for a "set profile" command?

This is an on MK730, which is basially a tenkeyless MK750. I had to define some new values for this to work. (Happy to share once I've advanced a bit).

I am able to get the profile OK, but setting the profile using cmmk_set_active_profile doesn't actually change the profile.

Below is the request and response for the "set active profile" interaction. The first 2 bytes of the response are ff aa, which I suspect is an error code?

>>
        0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
000000: 51 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00  Q...............
000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
<<
        0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
000000: ff aa 00 00 51 00 00 00 00 00 00 00 00 00 00 00  ....Q...........
000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
sam97 commented 4 years ago

@scottjbarr I've just successfully tried setting the profile after getting the same "error codes" that you've mentioned. I know this is coming late, but have you tried setting the control mode to profile customization? Calling cmmk_set_control_mode(dev, CMMK_PROFILE_CUSTOMIZATION) before setting the profile should work. Don't forget to go back to CMMK_FIRMWARE once finished.