summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-12-13 00:00:53 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-12-13 00:00:53 +0100
commit9e13e4aac322bf23a9fa1eaf7d7a8d5e605233cb (patch)
tree38a3dc909318bb829cbdf206e9499e160e69f758
parent30c7e2000caf359e4f205c17fc822ebde629826e (diff)
downloadltunify-9e13e4aac322bf23a9fa1eaf7d7a8d5e605233cb.tar.gz
lib/hidpp10: fix report matching, support non-HID++ reports
DJ reports can also be accepted per previous commit. Also, fix typo.
-rw-r--r--lib/hidpp10.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/hidpp10.c b/lib/hidpp10.c
index efd0bee..b8a3b8a 100644
--- a/lib/hidpp10.c
+++ b/lib/hidpp10.c
@@ -45,8 +45,16 @@ static bool hidpp10_msg_filter(HidppMessage *msg, void *userdata)
}
ok = ok && msg->sub_id == out->sub_id && msg->address == out_addr;
+ /* Non-HID++ messages handling, maybe the callback is interested. */
+ if (msg->report_id != HIDPP_SHORT && msg->report_id != HIDPP_LONG) {
+ if (cd->cb) {
+ cd->cb(msg, cd->userdata);
+ }
+ return false;
+ }
- switch (out->report_id) {
+ /* HID++ report handling */
+ switch (msg->sub_id) {
case SUB_SET_REGISTER:
case SUB_GET_REGISTER:
case SUB_SET_LONG_REGISTER: