Add the HIDIOCGRAWCLIENTADDR ioctl to the hidraw sample program.
Signed-off-by: Frank Praznik <[email protected]>
---
samples/hidraw/hid-example.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/samples/hidraw/hid-example.c b/samples/hidraw/hid-example.c
index 512a7e5..dbf072d 100644
--- a/samples/hidraw/hid-example.c
+++ b/samples/hidraw/hid-example.c
@@ -23,6 +23,10 @@
#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
#endif
+#ifndef HIDIOCGRAWCLIENTADDR
+#warning Please have your distro update the userspace kernel headers
+#define HIDIOCGRAWCLIENTADDR(len) _IOC(_IOC_READ, 'H', 0x08, len)
+#endif
/* Unix */
#include <sys/ioctl.h>
@@ -93,6 +97,13 @@ int main(int argc, char **argv)
else
printf("Raw Phys: %s\n", buf);
+ /* Get Client Address */
+ res = ioctl(fd, HIDIOCGRAWCLIENTADDR(256), buf);
+ if (res < 0)
+ perror("HIDIOCGRAWCLIENTADDR");
+ else
+ printf("Raw Client Address: %s\n", buf);
+
/* Get Raw Info */
res = ioctl(fd, HIDIOCGRAWINFO, &info);
if (res < 0) {
--
1.8.5.3
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html