diff options
author | Filipe Laíns <lains@archlinux.org> | 2020-08-10 21:13:05 +0100 |
---|---|---|
committer | Filipe Laíns <lains@archlinux.org> | 2020-08-10 21:29:16 +0100 |
commit | 8a9072a200bff9864c4904b76c9eeba66aea3282 (patch) | |
tree | bc32d38776ed1a365817ad657bea86dc512ca84a | |
parent | fe81a27bbbbe80cbc4c8a8f2499df118d3df5f7f (diff) |
tests: add tests file for hidraw
Signed-off-by: Filipe Laíns <lains@archlinux.org>
-rwxr-xr-x | test-hidraw.py | 19 |
1 files changed, 19 insertions, 0 deletions
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}') |