Clément Vuchener
bfd9c62963
Abort when the report id is invalid
2015-09-16 21:14:04 +02:00
Clément Vuchener
863b26eee2
Use defines instead of values for button types
2015-09-16 19:13:15 +02:00
Clément Vuchener
16c83975af
Added set current resolution function for G500s
2015-09-16 19:10:34 +02:00
Clément Vuchener
91dd957618
Added long command in hidpp_request_command
2015-09-16 19:08:56 +02:00
Clément Vuchener
cedab5cacc
Added G500 id
2015-09-16 18:42:59 +02:00
Peter Hutterer
298205f02e
Merge pull request #11 from phomes/led-colors
...
hidpp10: Add support for get/set of led color
2015-09-17 00:03:04 +10:00
Peter Hutterer
f846dd72d0
Merge pull request #10 from phomes/master
...
Fixes timeout problems with M705 and adds G9
2015-09-16 23:52:46 +10:00
Thomas Hindoe Paaboel Andersen
81dfec8f79
hidpp10: Add support for get/set of led color
...
For supported devices this can get and set the led colors in RGB.
This patch just adds the support in the lib. Later patches will
add it to the driver and expose it in libratbag.
2015-09-15 23:46:11 +02:00
Thomas Hindoe Paaboel Andersen
ab7b620dd4
hidpp10/20: fix a buffer overflow
...
We pass a negative length into log_buffer which expects a size_t.
This causes it to write past the allocated output_buf.
2015-09-15 20:24:56 +02:00
Thomas Hindoe Paaboel Andersen
a85a40b713
hidpp10: add G9
2015-09-15 20:24:56 +02:00
Thomas Hindoe Paaboel Andersen
6155d86923
hidpp10/20: retry on usb timeout
...
On the M705 I frequently get usb timeouts here if the device has
not been active for a while. Retrying after 10 ms seems to reliably
fix the timeout problem.
We could have just added the 10 ms sleep directly but it does not
seem to be neccesary on wired devices so I chose not to. Setting the
ret value to a face positive number and looping would also work but
we risk an endless loop. In the end I just went for a single retry
as that fixed the problem for me.
2015-09-15 20:24:56 +02:00
Benjamin Tissoires
e514da8218
drv interface: make the commit to the device mandatory
...
When writing a button, the given button should also be stored in the
memory of the device.
Amend the documentation
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com >
2015-09-15 11:06:30 -04:00
Benjamin Tissoires
c7f8e851c1
etekcity: write the profile to commit the button asap
...
we should not require to actually write the profile to actually write the
button in the memory of the device.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com >
2015-09-15 11:06:30 -04:00
Peter Hutterer
a3aacd3a99
Drop the _by_index suffix
...
This is the default, if we need a _by_name or so later we can add it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-16 00:55:12 +10:00
Benjamin Tissoires
41cf0176f0
roccat: remove spurious errors when waiting for the device to be ready
...
Not perfect but we need to figure out what 0x02 means eventually.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com >
2015-09-15 10:46:26 -04:00
Benjamin Tissoires
3dc8f466ec
roccat: abort if the macro does not match
...
If there is any problem while retrieving a macro, the first element in
the report might not match. In such cases, abort.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com >
2015-09-15 10:38:12 -04:00
Benjamin Tissoires
892497ca60
roccat: retrieve the macro if we are not in the default profile
...
When the macro is not on profile 0, we need to set the mouse in the
correct mode first.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com >
2015-09-15 10:37:17 -04:00
Benjamin Tissoires
ee0c58ca35
roccat: break infinite loops
...
When waiting for a status, the mouse sometimes answers 0x02, which seems
to be EINVAL (though it can be an ACK too). Treat this answer so we do
not end up in some infinite loops.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com >
2015-09-15 10:36:10 -04:00
Benjamin Tissoires
8a99ed6436
roccat: write the profile to commit the button asap
...
we should not require to actually write the profile to actually write the
button in the memory of the device.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com >
2015-09-15 10:34:42 -04:00
Peter Hutterer
5e4ac9f908
Merge branch 'ratbag-cmd-revamp'
...
This pull refactors ratbag-cmd to expose almost all functionality from
libratbag and introduces a structured set of arguments.
The history is a bit messy, for review it's recommended to look at the
resulting source file for errors more so than the actual patch set.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 23:41:00 +10:00
Peter Hutterer
a0795f0635
Update TODO
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 23:36:29 +10:00
Peter Hutterer
24bbf4b6db
tools: add test for macro arguments
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 23:36:29 +10:00
Peter Hutterer
6ddc529ff3
tools: append commands to array in test script, don't use manual indices
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 23:36:29 +10:00
Peter Hutterer
2d922012fd
tools: fix usage() indentation, add exit status
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 23:36:29 +10:00
Peter Hutterer
7ff92c4226
tools: add another "action" subcommand to set/get buttons
...
Like usage() already documented
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 23:36:29 +10:00
Peter Hutterer
e416722a12
TODO: remove the ratbag-command todo
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 23:36:29 +10:00
Peter Hutterer
1c84e74572
tools: Support macros
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 23:36:29 +10:00
Peter Hutterer
3b452df36c
tools: do a cap check before trying to set buttons/macros/..
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 06:23:27 +10:00
Peter Hutterer
fa06db8398
tools: use strtol(), not strtod() to convert ints
...
oops.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:52:25 +10:00
Peter Hutterer
834daebdd8
tools: support the button commands
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:52:25 +10:00
Peter Hutterer
c5d79f5806
tools: support resolution's "rate get/set"
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:52:25 +10:00
Peter Hutterer
d6153ddb92
tools: change the usage() output to a manual one
...
A bit easier to explain when we have more flexibility.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:52:25 +10:00
Peter Hutterer
0a3269dbdb
tools: improve profile active get/set/
...
Drop some unnecessary code, make the functions a bit smaller. Drop the printf
when we're activating the active profile.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:52:25 +10:00
Peter Hutterer
02b14046a3
tools: implement resolution active get/set
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:52:25 +10:00
Peter Hutterer
5f4b770283
tools: add a test for the ratbag commands
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:52:25 +10:00
Peter Hutterer
61d9c1006b
tools: return the right error from device_from_arg
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
7df7ed325a
tools: automatically print usage() on ERR_USAGE
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
839b31eb25
tools: categorize the return code
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
e7b421ae19
tools: fix resolution active get/set
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
6e56dec9ed
tools: add an error message for a missing device path
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
fb941b5f75
tools: let ratbag_device_from_arg reduce the argc
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
aee827efa1
tools: drop active profile check in "profile active set"
...
Once we have the profile, we can call set_active and be done with it. No need
to check if another profile is currently active.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
f97a3142d1
tools: use the new flags for switch-etekcity and change-button
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
87881fd9d5
tools: change error messages into a more terse format
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-15 04:48:14 +10:00
Peter Hutterer
5e3ca7692e
tools: auto-fill profile, resolution, device for each command
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-14 11:28:00 +10:00
Peter Hutterer
8af1530ea5
tools: make the top-level command list a subcommand itself
...
Allows us to reuse all the subcommand code, and factor out a bunch of helpers
later.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-14 11:28:00 +10:00
Peter Hutterer
26f82c7ecc
tools: use the same error path in main()
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-14 11:28:00 +10:00
Peter Hutterer
f2bbd411fe
tools: enable a plain dpi get/set
...
Works on the active profile, active resolution by default.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-14 11:28:00 +10:00
Peter Hutterer
9e02b26d74
tools: implement dpi get
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-14 11:28:00 +10:00
Peter Hutterer
b39a00d9e6
tools: update dpi set to work on the right resolution
...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net >
2015-09-14 11:28:00 +10:00