1
0
forked from drath/libratbag
Commit Graph

400 Commits

Author SHA1 Message Date
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
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
Benjamin Tissoires
1cbbcae37c Add the G303 as a known device
The G303 is a wired device and we need to talk to it with 0xff (OK a
#define would be good). This was not a problem for all of the unifying
devices given that the kernel overwrites the device_id for us, but the
corded devices are a different kind, and this one rejects device id != ff.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-11 17:43:35 -04:00
bentiss
244e6cf570 Merge pull request #5 from phomes/master
Add G5 to the hidpp10 driver
2015-09-11 17:34:49 -04:00
Thomas Hindoe Paaboel Andersen
56effdfba9 Add G5 to the hidpp10 driver 2015-09-11 22:48:39 +02:00
Benjamin Tissoires
0429609634 tools: fix macro time conversion to str
Those breaks... I keep forgetting them

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-10 18:03:37 -04:00
Benjamin Tissoires
ad18c0fd55 TODO: add discussion regarding keys/macros
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-10 16:10:03 -04:00
Peter Hutterer
a4515a59ae tools: strncmp -> strneq
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-11 03:57:59 +10:00
Peter Hutterer
69bb5d2f48 Add a default profile capability
Not all devices allow setting a default profile, make it a capability

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-11 03:42:44 +10:00
Peter Hutterer
43386ae31d driver-hidpp20: enumerate all capability values
Don't use a default here, let the compiler tell us when we're not handling a
value expclicitly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-11 03:42:44 +10:00
Peter Hutterer
b5e8247f55 Add a couple of TODO items 2015-09-11 03:42:44 +10:00
Benjamin Tissoires
80041666f2 Merge branch 'wip/macro' 2015-09-10 13:25:42 -04:00
Benjamin Tissoires
c2e72f4154 etekcity: remove magic constant
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-10 09:08:17 -04:00
Benjamin Tissoires
f44f07c6a9 etekcity: fix the check for macro
The current code was checking if the previous action assigned to a button
was a macro, not that the action we are assigning will be a macro.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-10 09:06:38 -04:00
Benjamin Tissoires
d7ef078c02 tools: Now, we have foo and bar as macro
Still not a parsing of the user input...

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-10 08:49:51 -04:00
Benjamin Tissoires
c2272c4f76 drv-hidpp20: change log priority
Kind of annoying when using the command "list".

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-10 08:46:45 -04:00
Benjamin Tissoires
1e40cda292 data: minor adjustments to the SVGs
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-09 11:26:15 -04:00
Benjamin Tissoires
286f398763 tools: add a (currently fake) way of addressing a macro change
We need to implement a parsing of the given macro...

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-09 11:26:15 -04:00
Benjamin Tissoires
6910eabacc Add an additional macro API to commit the macro
Not very glorious

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-09 11:26:15 -04:00
Benjamin Tissoires
cdf710d807 add support for getting/setting the macro name
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-09 11:26:15 -04:00
Benjamin Tissoires
c7b7996f09 etekcity: actually write the macro to the device
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-09 11:26:15 -04:00
Benjamin Tissoires
e4f2f295c0 TODO: add macro todo list
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-09 11:26:15 -04:00
Benjamin Tissoires
ce10bb1e84 macro: add first implementation
The doctext needs fixes and the API might not be final.
This however works and allow to read the macro.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-09 11:26:15 -04:00
Benjamin Tissoires
a7a1f1a2a4 etekcity: retrieve the macros while reading the button
Avoids one for loop and will allow to store the macro in the button.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-09-08 11:34:56 -04:00
Benjamin Tissoires
7a679c9f97 hidraw: return -ETIMEDOUT when a timeout occured
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-07 16:12:00 -04:00
Benjamin Tissoires
a8e592e1bc hidraw: add ratbag_close_hidraw
Better to clean up the hidraw node too.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-09-07 16:12:00 -04:00
Peter Hutterer
4333a8d9c3 Merge pull request #4 from phomes/master
minor fixes
2015-09-08 04:53:28 +10:00