1
0
forked from drath/libratbag
Commit Graph

1365 Commits

Author SHA1 Message Date
Peter Hutterer
d69a2ec5ba hidpp10: use _cleanup_ for a profile
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-09 12:01:56 +10:00
Peter Hutterer
4bfd5d9a13 Add helper functions to loop through profiles, buttons and leds
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-09 12:01:56 +10:00
Peter Hutterer
091e651831 Fix a comment, the deprecated functions *should* be removed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-09 12:01:56 +10:00
Thomas Hindoe Paaboel Andersen
d52c2c0320 hidpp10: remove empty callback
write_profile is deprecated and none of the other drivers have an empty
implementation like this.
2017-10-07 09:39:22 +10:00
Thomas Hindoe Paaboel Andersen
cd71ce67b1 hidpp10: only update current resolution once per commit
With the swtich to the commit style the function
hidpp10drv_write_resolution_dpi is doing too much work.

Before commit style the function would:
* get the profile
* get the current resolution
* write the profile (resets it to default dpi)
* set the current (updated) resolution

With the commit style we call the function for every resolution
in every dirty profile we now:
* get the current resolution
* set the current (updated) resolution
Then later:
* write the profile (resets to default dpi)

This patch changes this to only doing one set of the current resolution
when the active profile has been written. This reduces the traffic to the
device and sets the current resolution after the profile write.
2017-10-05 17:20:49 +02:00
Thomas Hindoe Paaboel Andersen
43f501907e hidpp10: fix setting resolution on G9
The G9 sends a short report and does not
have separate DPIs for x and y.
2017-10-05 17:20:49 +02:00
Peter Hutterer
d26d5b83f1 test: set RATBAG_TEST in code, not in meson
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>
2017-10-04 18:53:25 +10:00
Peter Hutterer
c401414310 tools: update ratbagd.py for the new logo types
Added in 835a694c4b

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-04 10:13:53 +10:00
Thomas Hindoe Paaboel Andersen
c34fe85780 G9: add entry for LEDs count 2017-10-03 23:06:01 +02:00
Thomas Hindoe Paaboel Andersen
a19a79d33a hidpp10: add Leds entry to .device file
For the device I have I do not see a way to get
this information by querying the device.

If the value is set in the .device file it will
override anything that the hidpp10 driver itself
would have found.
2017-10-03 23:06:01 +02:00
Ogier Bouvier
8edf6e7609 tools: use new RATBAG_LED_TYPEs
Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-10-03 19:48:32 +10:00
Ogier Bouvier
835a694c4b driver-hidpp20: add feature discovery for 0x1300
fix #325

Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-10-03 19:48:32 +10:00
Ogier Bouvier
a47492e62c hidpp20: add support for non-RGB LEDs, feature 0x1300
Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-10-03 19:48:32 +10:00
Peter Hutterer
186a1deda8 led: change RGB to RGB888 and add 1-bit RGB
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>
2017-10-03 08:58:34 +02:00
Thomas Hindoe Paaboel Andersen
132212652f G9: add .svg for GNOME 2017-10-02 22:31:40 +02:00
Peter Hutterer
5a40d93a30 ratbagd: disable coredumps in ratbagd.devel
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-02 10:25:24 +02:00
Peter Hutterer
f62940c1e5 tools: specify the full path for the dbus permissions file
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>
2017-10-02 10:25:24 +02:00
Peter Hutterer
0f808ed387 tools: fix a linebreak to be less confusing
We os.path.join the first to arguments, fix the line breaks so this is obvious

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-02 10:25:24 +02:00
Peter Hutterer
d8edf2d9e4 tools: unlink the dbus file if ratbagd.devel fails to start
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-02 10:25:24 +02:00
Jente Hidskes
6827f5ed81 tools/ratbagd.py: sync with Piper 2017-09-30 08:51:50 +10:00
Thomas Hindoe Paaboel Andersen
f3208b499b G300: set the color depth 2017-09-29 00:18:22 +02:00
Thomas Hindoe Paaboel Andersen
94e0842a06 G300: add support LEDs 2017-09-29 00:18:22 +02:00
Thomas Hindoe Paaboel Andersen
e0de98ba01 set CAP_LED for mice with only 1 LED
Even if there is only 1 LED we should set
the cap to let Piper change it in the GUI
2017-09-28 09:06:28 +10:00
Thomas Hindoe Paaboel Andersen
1adb147f6d expand documentation of probe call
Add a comment that drivers are expected to initialize and
read all profiles in the probe callback.

Fixes #333
2017-09-28 09:05:59 +10:00
Peter Hutterer
b1c4bba3b2 led: add support for color depth
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>
2017-09-22 09:18:28 +02:00
Thomas Hindoe Paaboel Andersen
cdbdcd23e6 G300: set min/max DPI 2017-09-21 19:21:28 +02:00
Thomas Hindoe Paaboel Andersen
23d1290b22 G300: set the active resolution
It was implemented but never used before. Use it when writing the
active profile.O
2017-09-21 08:51:21 +10:00
Thomas Hindoe Paaboel Andersen
5edcdfba5b G300: use int instead of signed 2017-09-20 15:55:37 +10:00
Thomas Hindoe Paaboel Andersen
6d105a002c G300: fix writing multiple profiles
Writing multiple changed profiles was broken as we would exit the
loop after the first profile write. We were returning the number
of bytes written and this was interpreted as an error.

Fix it my returning 0 when we have written the correct number of
bytes to the mouse.
2017-09-20 15:55:37 +10:00
Ogier Bouvier
3b1a41f154 hidpp20: fix special button mapping
fix #348

Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-09-19 13:48:17 +02:00
Peter Hutterer
0153efbf9c Remove now superfluous libratbag.sym
We don't ship a library anymore, so dealing with library symbols isn't
necessary.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-18 14:24:50 +02:00
Jente Hidskes
db34ab5255 RatbagdButton: fix missed dbus return value
I missed this one in #336.
2017-09-17 21:34:47 +10:00
Benjamin Tissoires
52e10d029f tools: ratbagctl.test: assert on the ratbagd process
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>
2017-09-15 08:55:34 +02:00
Benjamin Tissoires
1c94ef5c56 tools: ratbagctl: only warn that no devices are available in list_devices
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>
2017-09-15 08:55:34 +02:00
Benjamin Tissoires
5efd83fc41 tools: make sure we check for ratbagd_process returncode
It was accidentally put as a dead code in 6cfca9e34b.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-15 08:55:34 +02:00
Jente Hidskes
33966989db ratbagd: add ACTION_SPECIAL_INVALID to the table
So we at least don't crash, see #383.
2017-09-14 16:02:56 +02:00
Ogier Bouvier
c56c76e07d hidpp20: fix resolution count detection
fix #343

Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-09-14 16:02:40 +02:00
Thomas Hindoe Paaboel Andersen
8440a36f92 G300 SVG: add 20 px margin 2017-09-14 09:49:41 +02:00
Thomas Hindoe Paaboel Andersen
3e31b45db0 SVG for G300 in GNOME theme 2017-09-14 09:49:41 +02:00
Ogier Bouvier
548a40dba6 hidpp20: store correct size for feature list
Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-09-13 10:17:37 +02:00
Benjamin Tissoires
c437882e96 tools: ratbag-command: info: make use of _cleanup_
Better code :)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Ogier Bouvier
4a61dc413b support sector size that are not multiple of 16
Signed-off-by: Ogier Bouvier <obouvier@logitech.com>

Squashed the comment into this
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Benjamin Tissoires
59df7defdb tools: add hidpp20-reset
Basically a nuclear weapon to reset the flash to 0.
Use it with caution!

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Benjamin Tissoires
77fa6a1e65 hidpp20: fill in all profiles, even if they are not there
If a profile is either wrong or not there, we rely on the ROM to get
a correct profile.

Fixes #280

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Benjamin Tissoires
0f8031c201 hidpp20: add commit API for onboard profiles
The driver is supposed to prepare everything in memory and then, at the
end commit on the device.

Bug #280 is still not fixed as we should initialize empty profiles first.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Benjamin Tissoires
5842dccc2a hidpp20: check if crcs are valid once on plug
To check if device is using ROM or Flash settings.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Benjamin Tissoires
0c5b1998a5 hidpp20: move down hidpp20_initialize
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Benjamin Tissoires
f52ebd0dba hidpp20: move up hidpp20_internal_profile
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Benjamin Tissoires
1857378a76 hidpp20: new memory model
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>
2017-09-13 09:21:53 +02:00
Benjamin Tissoires
d2600583bb hidpp20: do not mixed hex and decimal
because this is bad

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00