Show flags of connected devices
diff --git a/hidd/main.c b/hidd/main.c
index 9965d30..78501fe 100644
--- a/hidd/main.c
+++ b/hidd/main.c
@@ -255,6 +255,20 @@
"closed"
};
+static char *hidp_flagstostr(uint32_t flags)
+{
+ static char str[100] = "";
+
+ strcat(str, "[");
+
+ if (flags & (1 << HIDP_BOOT_PROTOCOL_MODE))
+ strcat(str, "boot-protocol");
+
+ strcat(str, "]");
+
+ return str;
+}
+
static void do_show(int ctl)
{
struct hidp_connlist_req req;
@@ -273,8 +287,9 @@
for (i = 0; i < req.cnum; i++) {
ba2str(&ci[i].bdaddr, addr);
- printf("%s %s [%04x:%04x] %s\n", addr, ci[i].name,
- ci[i].vendor, ci[i].product, hidp_state[ci[i].state]);
+ printf("%s %s [%04x:%04x] %s %s\n", addr, ci[i].name,
+ ci[i].vendor, ci[i].product, hidp_state[ci[i].state],
+ ci[i].flags ? hidp_flagstostr(ci[i].flags) : "");
}
}