From 2e556a670664335eae46866f598c924501fd95ce Mon Sep 17 00:00:00 2001 From: Filipe Laíns Date: Mon, 10 Aug 2020 20:42:00 +0100 Subject: hidraw: add support for uniq MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- ioctl/hidraw.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ioctl/hidraw.py') diff --git a/ioctl/hidraw.py b/ioctl/hidraw.py index d72ec33..1d70012 100644 --- a/ioctl/hidraw.py +++ b/ioctl/hidraw.py @@ -46,6 +46,7 @@ class Hidraw(object): HIDIOCGRAWPHYS = 0x05 HIDIOCSFEATURE = 0x06 HIDIOCGFEATURE = 0x07 + HIDIOCGRAWUNIQ = 0x08 HID_NAME_SIZE = 1024 @@ -131,4 +132,13 @@ class Hidraw(object): 'H', self.HIDIOCGRAWPHYS, self.HID_NAME_SIZE ).perform(self._fd).decode('utf-8').strip('\x00') - # TODO: HIDIOCSFEATURE, HIDIOCGFEATURE, HIDIOCGRAWUNIQ + @property + def uniq(self) -> str: + ''' + Unique name of the hidraw node + ''' + return ioctl.IOCTL.IOR( + 'H', self.HIDIOCGRAWUNIQ, self.HID_NAME_SIZE + ).perform(self._fd).decode('utf-8').strip('\x00') + + # TODO: HIDIOCSFEATURE, HIDIOCGFEATURE -- cgit v1.2.3