From 9e13e4aac322bf23a9fa1eaf7d7a8d5e605233cb Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 13 Dec 2014 00:00:53 +0100 Subject: lib/hidpp10: fix report matching, support non-HID++ reports DJ reports can also be accepted per previous commit. Also, fix typo. --- lib/hidpp10.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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: -- cgit v1.2.1