Or we need to maintain the list of supported capabilities in a different
place, and it gets error prone.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Allows to navigate in the source more easily if they share a common
name.
However, this is still not good because we need to know which feature
number is which.
Though the format is now in sync with write_button.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Still missing the consumer control HID keys, but the rest works (minus
the modifier keys).
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
To support profiles assignments, we need to split the various write
button functions.
Start with 1b04.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Not completely full features, but works to set the DPI, report rate and
buttons assignments (no macros yet).
The current code reads first the current values, changes that needs to be
changed and writes back the data. Long term, we want to build the data
directly from the profiles and just write them.
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>
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>
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>