summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-11-12 17:03:20 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-11-13 14:00:29 +0200
commit7ed0fd653d6928e53418f98a5a58dd0b3b9e64e5 (patch)
tree46cdf8c5905d9d6225bea0d39bc9aed1b0145afb /profiles
parent718bad60d869ee8952db91d17bfd80c4280591c1 (diff)
downloadbluez-7ed0fd653d6928e53418f98a5a58dd0b3b9e64e5.tar.gz
input/hog-lib: Print report value handle and type
This adds better debug logs when discovering report type.
Diffstat (limited to 'profiles')
-rw-r--r--profiles/input/hog-lib.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c
index a45e59f43..1df1799b9 100644
--- a/profiles/input/hog-lib.c
+++ b/profiles/input/hog-lib.c
@@ -369,6 +369,20 @@ static void ccc_read_cb(guint8 status, const guint8 *pdu, guint16 len,
write_ccc(report->hog, report->hog->attrib, report->ccc_handle, report);
}
+static const char *type_to_string(uint8_t type)
+{
+ switch (type) {
+ case HOG_REPORT_TYPE_INPUT:
+ return "input";
+ case HOG_REPORT_TYPE_OUTPUT:
+ return "output";
+ case HOG_REPORT_TYPE_FEATURE:
+ return "feature";
+ }
+
+ return NULL;
+}
+
static void report_reference_cb(guint8 status, const guint8 *pdu,
guint16 plen, gpointer user_data)
{
@@ -390,7 +404,9 @@ static void report_reference_cb(guint8 status, const guint8 *pdu,
report->id = pdu[1];
report->type = pdu[2];
- DBG("Report ID: 0x%02x Report type: 0x%02x", pdu[1], pdu[2]);
+
+ DBG("Report 0x%04x: id 0x%02x type %s", report->decl->value_handle,
+ report->id, type_to_string(report->type));
/* Enable notifications only for Input Reports */
if (report->type == HOG_REPORT_TYPE_INPUT)