From 8a9072a200bff9864c4904b76c9eeba66aea3282 Mon Sep 17 00:00:00 2001 From: Filipe Laíns Date: Mon, 10 Aug 2020 21:13:05 +0100 Subject: tests: add tests file for hidraw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- test-hidraw.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 test-hidraw.py (limited to 'test-hidraw.py') diff --git a/test-hidraw.py b/test-hidraw.py new file mode 100755 index 0000000..f75b31a --- /dev/null +++ b/test-hidraw.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +import sys + +import ioctl.hidraw + + +if __name__ == '__main__': + if len(sys.argv) < 2: + print(f'usage: {sys.argv[0]} /dev/hidrawX') + exit(1) + + d = ioctl.hidraw.Hidraw(sys.argv[1]) + + print(f'Name: {d.name}') + print(f'Device Info: {", ".join(hex(value) for value in d.info)}') + print(f'Physical Name: {d.phys}') + print(f'Unique Name: {d.uniq or "None"}') + print(f'Report Descriptor Size: {d.report_descriptor_size}') + print(f'Report Descriptor: {d.report_descriptor}') -- cgit v1.2.3