hid 1.0.7__py3-none-any.whl → 1.0.9__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]
@@ -171,7 +174,8 @@ class Device(object):
171
174
  raise ValueError('specify vid/pid or path')
172
175
 
173
176
  if not self.__dev:
174
- raise HIDException('unable to open device')
177
+ err = hidapi.hid_error(0)
178
+ raise HIDException('unable to open device: ' + err)
175
179
 
176
180
  def __enter__(self):
177
181
  return self
@@ -233,6 +237,13 @@ class Device(object):
233
237
  hidapi.hid_get_feature_report, self.__dev, data, size)
234
238
  return data.raw[:size]
235
239
 
240
+ if version >= (0, 14, 0):
241
+ def get_report_descriptor(self, size = 4096):
242
+ data = ctypes.create_string_buffer(size)
243
+ size = self.__hidcall(
244
+ hidapi.hid_get_report_descriptor, self.__dev, data, size)
245
+ return data.raw[:size]
246
+
236
247
  def close(self):
237
248
  if self.__dev:
238
249
  hidapi.hid_close(self.__dev)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hid
3
- Version: 1.0.7
3
+ Version: 1.0.9
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=E0it0KhXCgB96vpRGiqOEfFFnRkfh_ue-gY1LzlaH7w,8899
2
+ hid-1.0.9.dist-info/LICENSE,sha256=VSS0Jays3-3so_lZmA8M04sAF267spLkqWxSDWB0NT0,1070
3
+ hid-1.0.9.dist-info/METADATA,sha256=xcXvcey5SXCo2T8K6ESUG4GvMlNDJvm4MRBjBDtVksw,2579
4
+ hid-1.0.9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
5
+ hid-1.0.9.dist-info/top_level.txt,sha256=bXxY3NZgkyomYfSEeN2D5AV8XF79TNH_H5WknGUmLOg,4
6
+ hid-1.0.9.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- hid/__init__.py,sha256=ai8FhaPT_OMgMfl7RvMzWtbiSWJPgEafiIfCUARr5fg,8385
2
- hid-1.0.7.dist-info/LICENSE,sha256=VSS0Jays3-3so_lZmA8M04sAF267spLkqWxSDWB0NT0,1070
3
- hid-1.0.7.dist-info/METADATA,sha256=x8czjIHo_u0gaxeJCJtkw5RODvISFKrVHKbzIKNxSDg,2579
4
- hid-1.0.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
5
- hid-1.0.7.dist-info/top_level.txt,sha256=bXxY3NZgkyomYfSEeN2D5AV8XF79TNH_H5WknGUmLOg,4
6
- hid-1.0.7.dist-info/RECORD,,
File without changes
File without changes