diff options
-rw-r--r-- | ioctl/hidraw.py | 12 |
1 files changed, 11 insertions, 1 deletions
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 |