We now only use libratbag for logging. Abstract that away so we can use
hidpp10 separate from libratbag where needed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part 2 of disentangling libratbag from the hidpp10 library. Copy the hidraw_fd
into the hidpp_device struct and use that during read/write.
This temporarily disables logging, will be re-enabled with an upcoming commit.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
HID++ 1.0 doesn't need hidraw other than the fd itself, and this is the first
step to disentangling the hidpp10 code from libratbag.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Requires a ratbag_device argument (with the hidraw fd open) but then tries to
list them - that doesn't quite work.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We have documentation for that, it does what it's already doing. It's called
sector + entry in the doc, but leave it at page + offset since we've been
using this in other comments.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The caller doesn't need to worry about registers or something here, let's just
expose one single bitmask, provided by an enum.
This also adds s couple of missing bits from the previous implementation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The caller doesn't need to worry about registers or something here, let's just
expose one single bitmask, provided by an enum.
This also adds s couple of missing bits from the previous implementation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The request length doesn't tell us what the expected response length is, e.g.
0x63 (current resolution) is set with a long request but replies with a short
ack.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
First: there are 6 LEDs, not just 4. If the LEDs don't exist, the value is
UNCHANGED on the read request.
The value is more than a simple on/off, though at least the G500s only looks
at the lower two bits, so heartbeat and slow off both translate into "on" and
blink and slow on both translate to "off".
There doesn't seem to be a detection mechanism for what a device really
supports.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Rather than copy/pasting the script, let semaphore fetch it and execute it.
This way we only need to maintain it in one place.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
There's no good reason to return the object from the unref() call other than
for testing purposes, and we can work around this by using valgrind instead.
The API is a lot more consistent when we always return NULL.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Seen on the second input node of the Roccat Kone XTD:
"ratbag error: ROCCAT Kone XTD: driver specified in hwdb not found: roccat
With the new hwdb matching, we should not try any other driver not having
the right id, so simplify the for loop to find the driver only.
Fixes#32
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Blows up when sprintf encounters an error, the result string is empty or the
result string is truncated.
Note: sprintf_safe only works on static buffers, it uses ARRAY_LENGTH.
Fixes#14
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This patch adds nothing but some debug outputs and prepares the code
to support the recent gaming mice from Logitech.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The G502 uses the version 0 of the adjustable DPI feature. This version
does not echo the given parameters which raised a -EIO in libratbag.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
github is happy with the current README but doxygen is not.
Use the same formatting than the architecture.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>