ratslap icon indicating copy to clipboard operation
ratslap copied to clipboard

interface number wrong

Open krayon opened this issue 5 years ago • 5 comments

I ran these apt-get commands and then make and everything worked except for the interface number, which defaults to 1 but had to be 0 on my system and which resulted in the fact that the kernel driver could not be detached.

sudo apt-get install build-essential pkg-config linux-headers-amd64 libusb-1.0-0-dev

Originally posted by @silkentrance in https://github.com/krayon/ratslap/issues/10#issuecomment-640623192

krayon avatar Jun 12 '20 13:06 krayon

@silkentrance Are you saying that the interface number in the source code needed to be 0?

Are you talking about here:

https://github.com/krayon/ratslap/blob/da173986e9818a49f5cab5b6848de9a73fd43761/main.c#L1341-L1342

krayon avatar Jun 12 '20 13:06 krayon

@krayon Yes, after having changed that to 0 it worked. Debian/Buster.

silkentrance avatar Jun 13 '20 15:06 silkentrance

Hello, I have more details about this issue and another one:

Compiling with Value 1 is the only way to detach the G300s Keyboard. Compiling with Value 0 is the only way to program and read profiles.

Here is a resume...

  1. Compile RATSLAP with USB_INTERFACE_INDEX set to 1

  2. Execute these two commands in the Terminal with that version...

sudo ./ratslap -s F3 sudo ./ratslap -p F3

These two commands and respective order is the ONLY way to detach the Keyboard. 1st Command executes successfully , 2nd fails BUT i have to issue it or Keyboard doesn't detach...you can use F4 or F5 to achieve same results.

  1. Compile other version of RATSLAP with USB_INTERFACE_INDEX set to 0.

  2. Execute any further commands that you need to read or program the G300s with this other version.

After all modifications are done to your profiles, reboot PC OR disconnect and reconnect G300s after some seconds. ALL Button assignments, etc. will be FULLY working, ANY further modifications, need execution again of the two RATSLAP versions with above commends to correctly initiate the Programming/Reading Mode of the G300s. .

Linux Distro : SLACKWARE-CURRENT 64bit

A-J-S-B avatar Dec 19 '20 00:12 A-J-S-B

So, I guess a solution is that program would be modified somehow to automatically, no matter the command we want to execute, the program silently (sending result to /dev/null) will internally issue by itself sudo ./ratslap -s , followed by sudo ./ratslap -s with usb_interface_index set to 1 and then execute user command with usb_interface_index set to 0....

A crude solution, i know...but it would work flawlessly and meanwhile you could find a better solution :D

A-J-S-B avatar Dec 19 '20 01:12 A-J-S-B

PS: Dunno what happened but i made fresh compilations of RATSLAP with values 1 and 0 and now all works well with version with Value at 1 and G300s "Keyboard" is not even (need to be) disabled at any moment, go figure.

Another thing is that the issue continued to happen with 0.4.1 Binary distributed from you.

A-J-S-B avatar Dec 19 '20 13:12 A-J-S-B