Setting the special command and displaying it were using a different
spelling. Fix that.
We should really only have one entry point for that.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
profiles_list is not used anymore in hidpp20_onboard_profiles_get_current_profile
let's remove it.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
hidpp20-dump-page.c: In function ‘dump_everything’:
hidpp20-dump-page.c:85:1: warning: control reaches end of non-void function
[-Wreturn-type]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
There is only one constructor left.
Get rid of the static hidpp10_device_new() that is not adding much.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
hidpp10_device_new_from_wpid() can not work anymore given that we are not
talking to the receiver anymore, but directly to the device.
The proof being that .wpid is never set in struct hidpp10_device.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
It looks like we can not use a section > 0xff and that the first
parameter corresponds to the type of the available memory (rom or flash).
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
It looks like we can not use a section > 0xff and that the first
parameter corresponds to the type of the available memory (rom or flash).
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
We already know the indexes in the table, so there is no point in making
a round trip to the device.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
We need hidpp20 to handle the list of available features. So we need to be
sure in hidpp20 that we are talking to a hidpp20 device.
Move the version retrieval in hidpp20 where it makes sense.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This struct will be used to store the table features/index and probably
others. It also allows a single entry point to set the device index.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Etekcity and Roccat are using raw HID code to send the macros. The Logitech
hid++ 2.0 are too so let's centralize the code in hidraw and simplify
the code per-driver.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
RATBAG_BUTTON_ACTION_SPECIAL_RESOLUTION_ALTERNATE (for the "sniper switch")
RATBAG_BUTTON_ACTION_SPECIAL_RESOLUTION_DEFAULT -> means what it means
And fix one missing entry in str_to_special_action.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
'base' was wrongly inherited from the hidpp10 implementation, but actually
it makes no sense in this context.
Also, we want to reserve the keyword 'base' for when we introduce
hidpp20_device.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The current API takes offset in 2-byte values. Taking a byte value
is more natural. We need to upgrade the type of offset to uint16_t
to handle values > 256.
For protocol debugging, it's a lot easier to go have a simple helper than
having to go through the whole of libratbag.
And remove the page-dump helper from the main code.
Note that this tool needs a /dev/hidraw device directly, not an event node. It
is a debugging tool after all.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>