Commit Graph

1475 Commits

Author SHA1 Message Date
Peter Hutterer
6e56dec9ed tools: add an error message for a missing device path
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-15 04:48:14 +10:00
Peter Hutterer
fb941b5f75 tools: let ratbag_device_from_arg reduce the argc
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-15 04:48:14 +10:00
Peter Hutterer
aee827efa1 tools: drop active profile check in "profile active set"
Once we have the profile, we can call set_active and be done with it. No need
to check if another profile is currently active.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-15 04:48:14 +10:00
Peter Hutterer
f97a3142d1 tools: use the new flags for switch-etekcity and change-button
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-15 04:48:14 +10:00
Peter Hutterer
87881fd9d5 tools: change error messages into a more terse format
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-15 04:48:14 +10:00
Peter Hutterer
5e3ca7692e tools: auto-fill profile, resolution, device for each command
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
8af1530ea5 tools: make the top-level command list a subcommand itself
Allows us to reuse all the subcommand code, and factor out a bunch of helpers
later.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
26f82c7ecc tools: use the same error path in main()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
f2bbd411fe tools: enable a plain dpi get/set
Works on the active profile, active resolution by default.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
9e02b26d74 tools: implement dpi get
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
b39a00d9e6 tools: update dpi set to work on the right resolution
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
ce4771456f tools: pre-load profile/resolution for the respective commands
So anything below either will have options->profile/resolution pre-set to the
right one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
c504d8c029 tools: always open the device for all args
Except for "list", all commands need a device argument. Open it ahead of time
to reduce the boilerplate in each function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
a0fb3a82f6 tools: implement dpi set, drop switch-dpi
Same code, except that we use a helper function to get the active profile.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
c89eb2f37b tools: improve the usage() output a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
a838d6d1cd tools: add the stubs for the button/resolution command
Only stubs, and the usage() output isn't correct anymore. But we need to fix
this anyway, the combination of arguments will be too complex to handle them
in such a simple approach.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
6f93b0da69 tools: add another helper to open the device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:28:00 +10:00
Peter Hutterer
59123945a7 tools: add profile active get|set commands
This replaces the switch-profile command

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:27:56 +10:00
Peter Hutterer
eb46a6581b tools: add a helper to get the device path
Doesn't do much, but it reduces some of the argc checking in the callers,
especially since we always expect the device as last argument

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:25:00 +10:00
Peter Hutterer
f99696e6d2 tools: use the parsed index instead of the argument
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:25:00 +10:00
Peter Hutterer
d0d5284132 tools: add ability to have subcommands in a ratbag_cmd
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 11:25:00 +10:00
Benjamin Tissoires
8e1d750ba1 roccat: add SVG for the Kone XTD
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-13 18:40:40 -04:00
Benjamin Tissoires
e73e1e2ab1 roccat: replace various msleep with actual device wait for readiness
The device can tell whether it is ready or not, so better poll for it
instead of waiting 100ms and hoping for the best.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-13 18:40:40 -04:00
Benjamin Tissoires
84edfc23fc roccat: add support for changing the DPI
Again, this differs from the etekcity by not having to set the config
report first.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-13 18:40:40 -04:00
Benjamin Tissoires
86a40ba519 roccat: add support to write profile and macros
There is a slight difference with etekcity:
- there is no need to first set the config macro element we are about to
  send (the information are already in the macro report)
- we need to be sure the mouse processed the macro and is ready to handle
  a new command. Thus the introduction of roccat_is_ready()

We should see if the etekcity does not require such check too (IIRC it did,
but the timeout were sufficient).

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-13 18:40:40 -04:00
Benjamin Tissoires
3ae353ffbf tools: add timeout events to our fake macro handling
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-13 18:40:40 -04:00
Peter Hutterer
585a59796b Merge pull request #9 from phomes/no-refcount
hidpp10: drop internal ref counts
2015-09-14 08:33:53 +10:00
Peter Hutterer
6555d6f2d2 Merge pull request #8 from phomes/fallback_profile_active_default
hidpp10: make the fallback profile active and default
2015-09-14 08:33:34 +10:00
Thomas Hindoe Paaboel Andersen
bb5a7cbd1f hidpp10: drop internal ref counts
This caused a problem since the hidpp10_device would keep a ref to
the ratbag_device - and the hidpp10_device would only get destroyed
when the ratbag_device got a ref count 0.
2015-09-13 23:14:29 +02:00
Thomas Hindoe Paaboel Andersen
0a8642a6b0 hidpp10: make the fallback profile active and default 2015-09-13 23:01:26 +02:00
Thomas Hindoe Paaboel Andersen
fc13c15fe2 hidraw: only show the report IDs once 2015-09-13 18:18:16 +02:00
Peter Hutterer
332a046cbb tools: stack the options into a struct passed to the functions
No functional changes, but this allows us to pass down profiles, resolutions,
etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-14 01:06:51 +10:00
Benjamin Tissoires
55fc8dc721 roccat/etekcity: check for the presence of the key mapping report ID
Removes the duplicate nodes found by the drivers.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-12 23:31:45 -04:00
Peter Hutterer
e90a6c601e TODO: more additions 2015-09-13 00:51:22 +10:00
Peter Hutterer
e981f1b2a7 README: add a short explanation on the architecture
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-13 00:40:09 +10:00
Benjamin Tissoires
90fa2251fa drv-hidpp**: check if the device accepts the HID++ reports
Removes the broken pipe on invalid nodes

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-12 10:17:34 -04:00
Benjamin Tissoires
84cfedbf5f hidraw: actually store the list of available report IDs
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-12 10:16:47 -04:00
Benjamin Tissoires
d065bda3a6 hidraw: implement a first dummy parsing of the report descriptor
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-12 09:48:01 -04:00
Benjamin Tissoires
24cb59af2f roccat: remove unused variable
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-12 09:46:54 -04:00
Benjamin Tissoires
b0e5508da9 Embbed the hidraw private elements in its own struct
mechanical patch

the hidraw_fd should only be used in libratbag_hidraw, so better having
it in its own struct so we can extend the hidraw elements without touching
ratbag_device.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

# Conflicts:
#	src/libratbag-hidraw.c
2015-09-12 09:46:08 -04:00
Benjamin Tissoires
1ca65ce7cb libratbag.c should not close directly the hidraw node
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-12 09:41:44 -04:00
bentiss
e67fc075b2 Merge pull request #6 from phomes/master
minor cleanups
2015-09-12 09:28:15 -04:00
Thomas Hindoe Paaboel Andersen
7fbadce2fe remove unused function 2015-09-12 08:48:25 +02:00
Thomas Hindoe Paaboel Andersen
6a4d747132 remove a variable only used for sizeof 2015-09-12 08:48:25 +02:00
Thomas Hindoe Paaboel Andersen
86960308e7 tools: add a missing prototype 2015-09-12 08:48:25 +02:00
Benjamin Tissoires
f99a675476 roccat: check the crc on the profile
for the key mapping

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-11 17:46:18 -04:00
Benjamin Tissoires
ce0c3c9d20 roccat: break out the crc check
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-11 17:46:18 -04:00
Benjamin Tissoires
7f3c974212 roccat: compute the CRC on the macro report
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-11 17:46:18 -04:00
Benjamin Tissoires
96dbf49c60 roccat: read also the waiting time
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-11 17:46:18 -04:00
Benjamin Tissoires
2bc5b1910a Add roccat implementation
This driver is basically a duplicate of the Etekcity.
After the copy-paste, I renamed all the the "etekcity"
by "roccat" and then rev-engineered the various constants.

Still a WIP, but it is getting usable.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-11 17:44:58 -04:00