hid 1.0.6__py3-none-any.whl → 1.0.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
hid/__init__.py CHANGED
@@ -130,6 +130,9 @@ hidapi.hid_send_feature_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, cty
130
130
  hidapi.hid_send_feature_report.restype = ctypes.c_int
131
131
  hidapi.hid_get_feature_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t]
132
132
  hidapi.hid_get_feature_report.restype = ctypes.c_int
133
+ if version >= (0, 14, 0):
134
+ hidapi.hid_get_report_descriptor.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t]
135
+ hidapi.hid_get_report_descriptor.restype = ctypes.c_int
133
136
  hidapi.hid_close.argtypes = [ctypes.c_void_p]
134
137
  hidapi.hid_close.restype = None
135
138
  hidapi.hid_get_manufacturer_string.argtypes = [ctypes.c_void_p, ctypes.c_wchar_p, ctypes.c_size_t]
@@ -165,7 +168,7 @@ class Device(object):
165
168
  elif serial:
166
169
  serial = ctypes.create_unicode_buffer(serial)
167
170
  self.__dev = hidapi.hid_open(vid, pid, serial)
168
- elif vid and pid:
171
+ elif vid and pid is not None:
169
172
  self.__dev = hidapi.hid_open(vid, pid, None)
170
173
  else:
171
174
  raise ValueError('specify vid/pid or path')
@@ -233,6 +236,13 @@ class Device(object):
233
236
  hidapi.hid_get_feature_report, self.__dev, data, size)
234
237
  return data.raw[:size]
235
238
 
239
+ if version >= (0, 14, 0):
240
+ def get_report_descriptor(self, size = 4096):
241
+ data = ctypes.create_string_buffer(size)
242
+ size = self.__hidcall(
243
+ hidapi.hid_get_report_descriptor, self.__dev, data, size)
244
+ return data.raw[:size]
245
+
236
246
  def close(self):
237
247
  if self.__dev:
238
248
  hidapi.hid_close(self.__dev)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hid
3
- Version: 1.0.6
3
+ Version: 1.0.8
4
4
  Summary: ctypes bindings for hidapi
5
5
  Home-page: https://github.com/apmorton/pyhidapi
6
6
  Author: Austin Morton
@@ -0,0 +1,6 @@
1
+ hid/__init__.py,sha256=Mb64F2-_g5ODbYDAo7tik74B0fQko5-SWgW0sJT9294,8853
2
+ hid-1.0.8.dist-info/LICENSE,sha256=VSS0Jays3-3so_lZmA8M04sAF267spLkqWxSDWB0NT0,1070
3
+ hid-1.0.8.dist-info/METADATA,sha256=-8TQmHVKUIIEMt7Y9izHeuqNXFQjOdZ5IvRBwWbBbKs,2579
4
+ hid-1.0.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
5
+ hid-1.0.8.dist-info/top_level.txt,sha256=bXxY3NZgkyomYfSEeN2D5AV8XF79TNH_H5WknGUmLOg,4
6
+ hid-1.0.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.45.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,6 +0,0 @@
1
- hid/__init__.py,sha256=YH3k4Hmp4ksTgOa15JWcajRNNy86-KkDHWvxGW0Di-0,8373
2
- hid-1.0.6.dist-info/LICENSE,sha256=VSS0Jays3-3so_lZmA8M04sAF267spLkqWxSDWB0NT0,1070
3
- hid-1.0.6.dist-info/METADATA,sha256=6SgTivZu5Y33YidLlw431r9ndBORtcsmaYmeexF1Fkc,2579
4
- hid-1.0.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
5
- hid-1.0.6.dist-info/top_level.txt,sha256=bXxY3NZgkyomYfSEeN2D5AV8XF79TNH_H5WknGUmLOg,4
6
- hid-1.0.6.dist-info/RECORD,,
File without changes