1
0
forked from drath/libratbag

745 Commits

Author SHA1 Message Date
Benjamin Tissoires
b563467164 configure.ac: libratbag 0.4
Soname bump for liblur and libratbag as their ABI has been broken in
this release.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
v0.4
2016-03-14 19:55:43 +01:00
Benjamin Tissoires
86e9a7abcd lur: bump the version of the library
commit b3237fd0 ("lur: change new_from_hidraw to return an errno") broke
the API, so we need to bump the version too.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-14 19:54:39 +01:00
Benjamin Tissoires
030eaa7c1c Add G502 svg data
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-14 17:19:52 +01:00
Benjamin Tissoires
ae129fe911 Add G700 svg data
Most of the SVG work was made by Peter. Cheers!

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-14 16:20:56 +01:00
Benjamin Tissoires
6190f0c7bf Make sure we do not put random values in the .macro field of buttons
Otherwise, as soon as we set an action for a button, we get a nice
invalid free on cleanup.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-14 16:20:56 +01:00
Benjamin Tissoires
717505daef Test: add a set_button test
Which currently fails.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-14 16:20:56 +01:00
Benjamin Tissoires
8ede0b734f Test: make sure the macros ref/unref are tested
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-14 16:20:53 +01:00
Benjamin Tissoires
090851fce1 Test: add some generic tests for the buttons
Currently only ref/unref

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-14 16:20:50 +01:00
bentiss
164232bbbc Merge pull request #74 from whot/wip/macro-rewrite
Rewrite the macro API, which contains PR #72 (Some more cleanup) and PR #73 (Use error enums)
2016-03-14 11:07:28 +01:00
Peter Hutterer
4054616190 Revamp the button macro code
The previous API was inconsistent and different to the rest of libratbag's
API. Replace with one where a macro is a separate struct, can be initialized
and then written to the device with a set_macro() call. The device copies the
contents, the macro is otherwise unmodified and can be re-used by the client
if need be.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-14 14:22:22 +10:00
Peter Hutterer
578142964d Change ratbag_find_driver to ratbag_assign_driver()
We don't do anything with the return value anyway and we do assign the driver
in this function. Rename it and return a boolean only.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-14 14:20:50 +10:00
Peter Hutterer
37bd43511b Switch to using an emum for error codes
Whenever we do something that may fail, return an enum of possible errors.

This also changes the API for ratbag_device_new_from_udev_device() to return
an error code now too instead of just NULL on failure.

Error numbers start at -1000 to avoid overlap with errnos, error_code() should
be used internally to avoid returning an errno.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-14 14:20:47 +10:00
Peter Hutterer
b53981c439 Add a few client error messages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-14 11:54:46 +10:00
Peter Hutterer
bf8442a250 Use __cleanup__ to free the device name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-14 11:54:46 +10:00
Peter Hutterer
198523fe8f Simplify validity checks with assert
Let the caller check that what they're passing in is correct, we don't have to
respond with sensible error codes here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-14 11:54:46 +10:00
bentiss
7f7507a0dd Merge pull request #70 from whot/master
miscellaneous cleanups
2016-03-12 09:58:54 +01:00
bentiss
a08c8ebc60 Merge pull request #71 from cvuchener/fix-g500s-button-mapping
data: Fix G500s button labels and arrows

Fixes bug #69
2016-03-11 11:17:52 +01:00
Clément Vuchener
aa76cb5005 data: Fix G500s button labels and arrows
Changed button labels with their proper numbers and rotated arrows for wheel tilt buttons.
2016-03-11 11:07:01 +01:00
Peter Hutterer
be008cd86c Switch ratbag_get_num_resolutions() to return an unsigned
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-11 16:22:19 +10:00
Peter Hutterer
6f9aa5aa24 Coding style fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-11 16:22:19 +10:00
Peter Hutterer
bfe6d446ad Comment typo fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-11 16:22:15 +10:00
Peter Hutterer
855a6bd831 Fix error message on ENODEV
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-11 16:16:42 +10:00
Peter Hutterer
f5ff267c54 Improve a few error messages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-11 16:16:39 +10:00
Peter Hutterer
014c4105f4 Remove superfluous check for a NULL udev device
If the udev device is NULL, we should fail a lot earlier

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-11 16:16:37 +10:00
Peter Hutterer
52fea6f3ce Remove superfluous check for strdup() ENOMEM
If that happens, strdup_safe() will abort.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-11 16:16:35 +10:00
bentiss
43ab3c961e Merge pull request #68 from whot/wip/query-capability
Add a QUERY_CONFIGURATION capability
2016-03-10 14:31:39 +01:00
Peter Hutterer
f7523f000e Add a QUERY_CONFIGURATION capability
Designates a device that can be queried for the current configuration. Some
devices lack this ability so we rely on the caller to upload a known
configuration to the device before we can really proceed.

Set by default, devices without that capability should be the exception, not
the norm.

This patch just adds the capability, actual handling for this needs to be
added when we add the first device without this capability.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-10 16:53:55 +10:00
bentiss
765ee6c08c Merge pull request #67 from phomes/g9-read-dpi
hidpp10: Fix getting current resolution on G9
2016-03-04 09:02:55 +01:00
Thomas Hindoe Paaboel Andersen
577a7c52fc hidpp10: Fix getting current resolution on G9
On the G9 the response to a 0x63 is a short report. The G9 does
not have individual resolutions for X and Y and thus only needs
to report a single value.

The set version of 0x63 should probably also be updated. However,
while my testing of such a change worked better than with long
reports there are still strange side effects of setting resolution,
like turning off all the LED's. LGS also seems to do a full profile
read/write instead of using 0x63 when changing the resolution.
2016-03-04 00:19:10 +01:00
Benjamin Tissoires
85acab4642 hidpp20: fix correct number of resolutions in the profile
There are only 5 resolutions per profile.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-02 10:54:13 +01:00
Benjamin Tissoires
0b5ccfeaed hidpp20: re-enable G303
The G303 shares the same profile than the G402/G502. The only difference
is an extension at the end of the profile, but they are compatible.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-02 10:50:19 +01:00
Benjamin Tissoires
f108ffa9ff hidpp20: remove internal project name
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-02 10:49:07 +01:00
Peter Hutterer
f233b6bf77 data: add a README on how do do the data files
And update all devices to match the the requirements

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-02 09:09:17 +01:00
Peter Hutterer
c95d8e05ca lur: Add a note that we're not doing OOM
Mostly inherited from our zalloc() implementation. But really,
if you have no memory left, should you be trying to talk to receivers?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-02 09:08:58 +01:00
Peter Hutterer
b3237fd001 lur: change new_from_hidraw to return an errno
Makes debugging slightly more useful than just returning NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-02 09:08:13 +01:00
Benjamin Tissoires
7704c102e4 lur: add lur_device_get/set_userdata
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
BT: move the functions in LIBLUR_0.4.0
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-02 09:08:05 +01:00
Peter Hutterer
55cb7447f9 lur: capitalize use of Logitech Unifying Receiver
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-02 14:40:41 +10:00
bentiss
77eaa70f77 Merge pull request #63 from phomes/G9-set-profile
hidpp10: write profile for G9
2016-03-01 23:45:30 +01:00
Thomas Hindoe Paaboel Andersen
70d864af09 hidpp10: write profile for G9 2016-03-01 23:37:54 +01:00
bentiss
15968c8e39 Merge pull request #62 from phomes/g9-features
hidpp10: Add button mappings for G9
2016-03-01 23:12:00 +01:00
bentiss
0558bd4101 Merge pull request #61 from phomes/cleanup
Follow up for #56
2016-03-01 23:10:56 +01:00
Thomas Hindoe Paaboel Andersen
3962ec7745 hidpp10: Add button mappings for G9
There are 10 buttons defined in the profile but only 9 physical
buttons. LGS also only allows to configure 9 of them. Button 5
is the "dead" button in the list.
2016-03-01 22:11:47 +01:00
Thomas Hindoe Paaboel Andersen
2164a3b549 libratbag: remove unused variable 2016-03-01 21:20:23 +01:00
Thomas Hindoe Paaboel Andersen
f0417a9535 hidpp10: Add definition for buttons on the G9 2016-03-01 21:20:18 +01:00
Thomas Hindoe Paaboel Andersen
9d9c42cc6a hidpp10: rename structs wrt _sym vs. _dual
Follow up for review in #56
2016-03-01 21:20:13 +01:00
Benjamin Tissoires
efd15a33fb configure.ac: libratbag 0.3
Soname bump for liblur and libratbag as they were not properly versioned.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
v0.3
2016-03-01 17:04:39 +01:00
Benjamin Tissoires
b804e117c1 hidpp20drv: fix segfault when a device is not powered on
We were returning 0 and libratbag tried to access the profiles afterward.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 16:59:32 +01:00
Benjamin Tissoires
b54d28ec1a tools: add a man for ratbag-command
Just duplicated the help.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 16:46:31 +01:00
Benjamin Tissoires
388dae76bc libratbag.sym: bump symbols version
0.1.0 never existed, the first release was 0.2 :)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01 15:35:33 +01:00
Benjamin Tissoires
19f87790bb Add liblur versioning and pkg-config
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2016-03-01 15:34:46 +01:00