907 Commits

Author SHA1 Message Date
Benjamin Tissoires
7da53c61cf meson.build: libratbag 0.9
- convert Logitech devices to the commit API (those compatible)
- fixes for ratbag-command regarding LEDs (still few caveats left)
- some coverity fixes
- a brand new lur-command man page

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
v0.9
2017-06-06 15:26:37 +02:00
Benjamin Tissoires
714c0d5330 hidpp20: reset the LEDs before writing to it
We somehow now know how to write effects.
No need to carry around some left overs from previous configurations.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
dc92abb5e5 tools: replace tabs by spaces in ratbag-command usage
It's a mix of tabs and spaces. Let's use spaces to keep the formatting.

And move "switch-etekcity" back to the end, it's a special case.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
b0c515b59d tools: allow to set more than one setting for the LEDs
Or we will take the defaults that are not intuitive (like white color
when setting to on).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
8e6c13832e hidpp20: led: document the internal structure and match the documentation
Shouldn't change the behavior, but this allows adding the other effects
found in the documentation.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
e33f655f61 hidpp20: do not waste memory
Currently we only support mice with 2 LEDs in the profile. No need
to have 32 placeholders.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
8e8b7b0611 hidpp20: make sure we read/write correct endianness to the device
rate is big endian, so we need to convert it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
d28f2f0123 hidpp20: keep function names consistent
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
a8eea870f5 hidpp20: make sure we check all modes in the switch statement
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
7e12e45311 hidpp20-drv: no need to use doubles
We are using a uint in the end, so better have proper order in the
multiplications/divisions than using doubles.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
b31c1d5ff3 tools: ratbag-command: have only one function to dump the LED settings
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
f6949458b7 tools: make led a first class citizen of ratbag-command
Allows to follow the usage message: we do not need to provide the
currently active profile.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Benjamin Tissoires
15dd6b4f2b hidpp20: color effects, fix endianness
We are receiving big endian, thus the weird power of two locations.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-06 15:03:47 +02:00
Stephen Kitt
7afd59149c Add lur-command manpage
This is copied from the Debian package.

Signed-off-by: Stephen Kitt <steve@sk2.org>
2017-05-30 14:11:48 +10:00
Stephen Kitt
a47f506293 Fix ratbag-command manpage
* Description capitalisation
* Grammar
* Hyphen encoding
* --version

Signed-off-by: Stephen Kitt <steve@sk2.org>
2017-05-30 14:11:48 +10:00
Benjamin Tissoires
f243abb65c release.sh: remove unreachable test now that we switched to meson
and I must say, why would you not run this script in the current
directory.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-29 17:29:12 +10:00
Benjamin Tissoires
a4b177436d hidpp20: take into account sectors on 16bits
First part of fixing #122.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-29 10:33:33 +10:00
Benjamin Tissoires
8367569236 hidpp10: fix coverity issue
profile->dpi_modes[i].led[] is an array of boolean.
Given that the callers (hidpp10_fill_dpi_modes_*()) already are doing the
comparison against 0x02, I guess this is just copy/paste error.

Fixes #152

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-29 10:32:08 +10:00
Benjamin Tissoires
5bbb2b28ea hidpp20drv: switch to the commit API
I do not like duplicating ratbag_old_write_profile() into each driver,
but, heh.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-29 09:15:07 +10:00
bentiss
2b92ab6dd6 hidpp20drv: fix segfault with G502 (#163)
When using the G502 without RGB LEDs, the feature 8070 is not here.
And this segfaults :)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-24 11:52:56 +03:00
Christian Kellner
c05c3dcaa3 tools: consistently call led mode "breathing"
Rename "breath" in the help text and reporting for the led mode to
"breathing". The actual command to set the mode was already called
that way.

Signed-off-by: Christian Kellner <christian@kellner.me>
2017-05-24 09:05:15 +10:00
Benjamin Tissoires
bf20845249 meson.build: libratbag 0.8
- coverity fixes
- new --version to ratbag-command
- cleaning up the meson build tools

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
v0.8
2017-05-09 14:55:15 +02:00
Peter Hutterer
eb01399f26 tools: fix OOB for LED color parsing
Let's not forget about the null-terminator, he feels lonely otherwise.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-09 10:14:47 +02:00
Peter Hutterer
c815654c94 tools: add --version to ratbag-command
Behold, the glory of our version number!

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-09 09:24:41 +02:00
Peter Hutterer
f1ce908b50 meson: quote the libratbag version properly
Otherwise ETOOMANYDECIMALSEPARATORS, confusion, mayham, anarchy, the lot.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-09 09:24:41 +02:00
Peter Hutterer
fb07204d9f meson: drop garbage argument from configure_file
Unsurprisingly, meson does not support the ratbag keyword argument. Though it
should, because we're great. But anyway, this lead to the argument being
ignored which means it didn't get an 'input' argument, which means that
libratbag-version.h.in was ignored. And since it all works anyway (Behold! The
magic! Ooooh! Aaaah!) we can just drop that file.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-09 09:24:41 +02:00
Peter Hutterer
1e5648b11d tools: terminate option list with a zero entry
Because, well, that's what we're supposed to do. Unless you want to think
outside the (array) box, but that has never helped anyone, has it?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-09 09:24:41 +02:00
Peter Hutterer
0902e3420f tools: replace getopt magic number 2 with 'optional_argument'
So *that's* what 2 means...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-09 09:24:41 +02:00
Peter Hutterer
698d8ab365 Replace ifndef include guards with pragma once
Now that we use meson exclusively and meson uses this for its config.h, you
wouldn't get around it anyway. Besides, the main compilers support it and
libratbag is too niche to worry about others.

This also *adds* the pragma to tools/shared.h where it was previously missing,
and changes it to be the top statement in hidpp-generic.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-05 09:02:15 +02:00
Peter Hutterer
ad1fa22196 hidpp10: fix out-of-bounds access
sizeof() gives us twice as many elements as we have indices for on this 16-bit
array.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
04ebd96bb7 roccat: fix the neverending story^Wtimeout
If we don't change count, the value of count < MAX_RETRY is always true.

Coverity is a champ, isn't it?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
09b5ae14b1 liblur: fix memory leak
Rather than having a bunch of gotos just define a cleanup for this device and
let the magic do the rest.

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
8aa127186c gskill: fix memory leak
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
a962082173 hidpp20: constify a helper function
Just because we can

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
5c0dbe4d5c hidpp20: fix dereference before null check
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
5934816b11 tools: check for negative index coming from argv
Coverity is unhappy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
28dd84713f Reset the button action struct to zero before use
A semi false-positive from Coverity, because action.macro is unset. Doesn't
matter because we never use it, but having it zeroed is the nice thing to do
(and what we do in the other functions).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
11b31cf9bd Fix a comment typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
dfd2d88953 tools: fix coverity warnings
Assigned but not used.

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:52:59 +02:00
Peter Hutterer
6a097bd691 meson: drop -g, the meson buildtype option takes care of that
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:49:34 +02:00
Peter Hutterer
2776d1ce8e meson: use warning_level=2 instead of manual -Wall -Wextra
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02 09:49:34 +02:00
Peter Hutterer
0834b210ca Remove now-obsolete autogen.sh script
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-26 08:26:07 +02:00
Peter Hutterer
cc41adbbf9 gitignore: drop build/ from gitignore again
As pointed out elsewhere, the build directory is decided by the user and
should thus be a user-specific gitignore configuration.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-26 08:26:07 +02:00
Peter Hutterer
63a666025f Update gitignore for meson
Drop all automake detritus, leave only the default build directory meson
suggests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-25 08:11:40 +02:00
Peter Hutterer
08ce9773dd Remove liblur.pc.in
Should've been removed with b8ed1ea

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-24 10:11:38 +02:00
Peter Hutterer
f745734d90 meson: generate the libratbag.pc file through configure_file
pkgconfig.generate() does not (yet) have a parameter for setting custom
variables - we need that for pkgdatadir to point to the SVG files. Swap to
using configure_file with the old .pc.in file that was forgotten in the tree
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-24 10:11:38 +02:00
Benjamin Tissoires
5443083b1d meson.build: libratbag 0.7
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
v0.7
2017-04-20 11:59:48 +02:00
Benjamin Tissoires
cc19496699 Fix release.sh for meson
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-04-20 11:59:48 +02:00
Peter Hutterer
b595691c5e meson: break up the two long error messages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-20 11:28:05 +02:00
Peter Hutterer
7d784a1a91 doc: use USE_MDFILE_AS_MAINPAGE to include the README.md as mainpage
Supported as of doxygen 1.8.3 (Dec 2012), see
http://www.stack.nl/~dimitri/doxygen/manual/changelog.html#log_1_8_3

Fixes #145

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-20 11:28:05 +02:00