hid 1.0.7__tar.gz → 1.0.9__tar.gz
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-1.0.7/hid.egg-info → hid-1.0.9}/PKG-INFO +1 -1
- {hid-1.0.7 → hid-1.0.9}/hid/__init__.py +12 -1
- {hid-1.0.7 → hid-1.0.9/hid.egg-info}/PKG-INFO +1 -1
- {hid-1.0.7 → hid-1.0.9}/setup.py +1 -1
- {hid-1.0.7 → hid-1.0.9}/LICENSE +0 -0
- {hid-1.0.7 → hid-1.0.9}/MANIFEST.in +0 -0
- {hid-1.0.7 → hid-1.0.9}/README.md +0 -0
- {hid-1.0.7 → hid-1.0.9}/hid.egg-info/SOURCES.txt +0 -0
- {hid-1.0.7 → hid-1.0.9}/hid.egg-info/dependency_links.txt +0 -0
- {hid-1.0.7 → hid-1.0.9}/hid.egg-info/not-zip-safe +0 -0
- {hid-1.0.7 → hid-1.0.9}/hid.egg-info/top_level.txt +0 -0
- {hid-1.0.7 → hid-1.0.9}/setup.cfg +0 -0
|
@@ -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
|
-
|
|
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)
|
{hid-1.0.7 → hid-1.0.9}/setup.py
RENAMED
{hid-1.0.7 → hid-1.0.9}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|