Add GET/SET_REPORT support to HoG
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | hog: import latest uhid.h definitionprofiles/ | +105 | 0 replies | |
| 2/4 | hog: break out the report retrieval in its own functionprofiles/ | +25 | 0 replies | |
| 3/4 | hog: implement get_report functionalityprofiles/ | +86 | 0 replies | |
| 4/4 | hog: implement set_report functionalityprofiles/ | +76 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] Add GET/SET_REPORT support to HoG
Hi
With linux-3.18 uhid will gain GET/SET_REPORT support. 3.18 isn't released, yet, but the uhid features are part of 3.18-rc5 so I think it's fine to rely on it. We can always revert it if it will not be released (for whatever reason..).
Benjamin wrote these 4 patches about 2 months ago and I promised to fix a few bugs and send them upstream. I already feel bad for letting them rot for 2 months.. sorry!
Anyway, I fixed the ID tracking, some typos, and fixed handling of devices that dont send report IDs in GET_REPORT. Patches should be straightforward. The GET/SET_REPORT feature is important for nearly all non-standard HID device drivers. It's used to query and modify device behavior. With this in place, we should be able to use all the kernel hid drivers via uhid/hog.
Benjamin has an example program to modify MS Arc Surface Touch mouse behavior, which needs these patches to query/modify the device. See:
https://github.com/bentiss/mstouchmouse/tree/WIP-USB
(If you check it out, make sure to use the WIP-USB branch! You should also apply
the diff below, to make sure it works even if the report-ID is not prepended.)
Works fine with my devices here!
David
set_touchmode.c +5 -0
@@ -48,6 +48,11 @@ static int get_report(int fd, unsigned char id, ... }else {printf ("Report data (%d):\n\t" , id);pr_buffer (buf, res); +/* prepend report-ID if not sent by device */ +if (res >0 && buf[0 ] != id) { +memmove (buf +1 , buf, (res >= len) ? (res -1 ) : res); + buf[0 ] = id; + } }return res; }
Benjamin Tissoires (4):
hog: import latest uhid.h definition
hog: break out the report retrieval in its own function
hog: implement get_report functionality
hog: implement set_report functionality
profiles/input/hog.c | 204 +++++++++++++++++++++++++++++++++++++++++---- profiles/input/uhid_copy.h | 117 +++++++++++++++++++++++--- 2 files changed, 292 insertions(+), 29 deletions(-)
Signature · 1 line
2.1.3