tools/ratbagctl.in:146:92: E128 continuation line under-indented for visual indent
tools/ratbagctl.in:147:92: E126 continuation line over-indented for hanging indent
tools/ratbagctl.in:154:91: E128 continuation line under-indented for visual indent
tools/ratbagctl.in:155:91: E126 continuation line over-indented for hanging indent
tools/ratbagctl.in:161:118: E128 continuation line under-indented for visual indent
tools/ratbagctl.in:162:118: E126 continuation line over-indented for hanging indent
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
A driver is supposed to know what type an LED is, unknown doesn't help anyone
here. So replace this with a private #define and abort when a driver doesn't
set the type. This also adds a requirement that any driver initializing a LED
must have the read_led() function, otherwise we can't fill it in correctly.
And bump the enum up by one, the first valid value should start at 1 (or some
other non-boolean value).
Related #365Fixes#364
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
It's a fixed value so it's much easier to set this in the test binaries rather
than requiring the user to set this in the env before running a test manually.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
1-bit RGB is needed for the Logitech G300, let's rename the main RGB to
indicate how many bits we actually have.
See #335
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Since we unconditionally call unlink() on that path later, let's make sure
we actually copy to that file.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The initial value of 400 in the enum is chosen so it looks weird when someone
tries to interpret the value as integer. Values of 1, 2, 4, etc. could be
confused with something realistic.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If we could not start the process, there is a high chance we are running
the tests against a different ratbagd implementation so there is no point.
Also, an exception will get raised later during the tear down of the
module saying that "'NoneType' object has no attribute 'terminate'".
This is less than ideal to notify that the process has not been started.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
If the other commands try to access a node, there will be an other error
("Unable to find device X"). So there is no points in having this as a
global check.
For the .devel and .test versions, we are guaranteed to have the
test_device at least, so no worries on this side too.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Only reading/writing full sectors are allowed (because we need to set and
read the crc anyway).
Fixes#122
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Starting with -vv, we print out the ratbagd log messages to stdout/stderr,
-vvv switches ratbagd to raw mode. We start at level 2 so that we can have the
single -v reserved for ratbagctl itself.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Plan is to remove the key mapping altogether and make it transparent from the
Macro mappings (in libratbag/the drivers). Meanwhile, remove the DBus API so
nothing can actually start using it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If we leave ratbagctl.devel too soon, ratbagd gets killed before it even
receives the async call for commmit(), meaning everything we do on the
device is lost.
0.5 is empirical. It seems on my system 0.2 is enough (0.1 doesn't seem
to work). Hopefully this value is not device dependent.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
not sure why, but stat.S_IEXEC only sets exec permission for the user,
meaning that the installed file can't be run by anybody else than root.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
A quick and easy way to sync anything coming from dbus (like property updates)
without needing to be hooked into a glib mainloop directly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Some devices can have a custom name, so let's export that capability.
In ratbagd, libratbag/ratbag_profile_set_name() returns an error, we
put it under silence, the client has to check for the capabilities
before asking ratbagd to change the profile name.
Fixes: #266
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
If we couldn't find the name on the bus or the ratbagd process already
terminated, return None and fail.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
I originally intended to have a dynamic use of argparse to generate
the commands, but it turned out to be a nightmare.
Just go down the tree of arguments and format the help properly.
Fixes#288
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
We shouldn't try to access input_string[0] if len(input_string) is null.
Meaning a condition in the break in the while loop could be checked
earlier (or later).
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
ns is never reset, so once it has a subparser, it'll keep it, so the try
catch is just too much
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Calling "ratbagctl profile -t" resulted in an infinite loop because it
tried again and again to parse "-t" in the profile
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>