Commit Graph

17 Commits

Author SHA1 Message Date
Benjamin Tissoires
1ad8b49be0 hidpp20: avoid writing of uninitialized value
The function does not take any argument, so the device ignores it,
but valgrind complains.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-21 13:26:43 -04:00
Peter Hutterer
472b394858 hidpp20: Implement support for battery level
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 15:11:57 +10:00
Peter Hutterer
d361bcb09f hidpp22: add a helper to not log some HID++ errors
The 2.0 GetProtocolVersion request will fail on 1.0 devices but there is no
equivalent for 1.0. The doc even suggests to detect this error to determine
whether a device is a 1.0 device. Thus, make it conditional on whether we
print the error or not (log it as debug message if turned off).

This should be reconsidered when we have everything in place and can think
about refacturing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 11:01:17 +10:00
Peter Hutterer
25036f6e3b hidpp20: automatically add the sw ID to the hid requests
0x8 was a random SW number picked, add that consistently and automatically so
it doesn't look like the command names require this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 10:46:53 +10:00
Peter Hutterer
75f4badbbb hidpp20: Fix copy/paste-o hidpp20_mousepointer_get_mousepointer_info
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 10:28:39 +10:00
Peter Hutterer
5e19d4e536 Print feature names as we're initializing them
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 10:10:18 +10:00
Peter Hutterer
35b5fa975e hidpp: Log the errno including strerror
Signed-off-by:Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 10:01:52 +10:00
Peter Hutterer
7f2d060ff9 Make libratbag-hidraw return negative errnos on error
Be consistent here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 10:01:52 +10:00
Benjamin Tissoires
a0f76f18f8 hidpp20: make the hidpp20_root_get_protocol_version compatible with bluetooth and corded
Lokks like the G500 needs a device_idx of 0x00, and the MX Master while on
Bluetooth only answers to report longs

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 19:56:38 -04:00
Benjamin Tissoires
eeccaa023c hidpp20: properly handle errors
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 17:19:46 -04:00
Benjamin Tissoires
81a77adf2d hidpp20: Implement feature 0x1b04: Special keys and mouse buttons
Still not writable.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 17:05:49 -04:00
Benjamin Tissoires
168473d6e3 hidpp20: export the defines for the page numbers
so the drivers could use them.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 15:38:00 -04:00
Benjamin Tissoires
0426f85163 hidpp20: use hidpp20_get_unaligned_u16
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 15:35:00 -04:00
Benjamin Tissoires
fdd47609cf hidpp20: implement 0x2201, adjustable dpi
only the getter right now.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 15:32:21 -04:00
Benjamin Tissoires
88a54e7acf hidpp20: add mouse pointer basic optical sensors
untested right now.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 14:38:31 -04:00
Benjamin Tissoires
9754810c38 unifying: retrieve the list of features available on HID++ 2.0 devices
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 14:12:56 -04:00
Benjamin Tissoires
b8637f0bc3 Add first hid++ 2.0 protocol support
The Logitech devices talk HID++, and we need a lib to handle that.
The first implemented command is the get protocol version which allows
to know if the device is using hid++ 1.0 or 2.0.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-08-20 14:12:08 -04:00